nemo_automodel.components.models.hy_v3.layers

View as Markdown

Module Contents

Classes

NameDescription
HYV3AttentionHYV3 attention with GQA, per-head Q/K RMSNorm, and RoPE.

API

class nemo_automodel.components.models.hy_v3.layers.HYV3Attention(
config: typing.Any,
backend: nemo_automodel.components.models.common.BackendConfig
)

Bases: Module

HYV3 attention with GQA, per-head Q/K RMSNorm, and RoPE.

head_dim
k_norm
k_proj
num_heads
= config.num_attention_heads
num_kv_heads
= config.num_key_value_heads
o_proj
q_norm
q_proj
v_proj
nemo_automodel.components.models.hy_v3.layers.HYV3Attention.forward(
x: torch.Tensor,
freqs_cis: torch.Tensor,
attention_mask: torch.Tensor | None = None,
attn_kwargs: typing.Any = {}
) -> torch.Tensor
nemo_automodel.components.models.hy_v3.layers.HYV3Attention.init_weights(
buffer_device: torch.device,
init_std: float = 0.02
)