nemo_automodel.components.models.hy_mt2
nemo_automodel.components.models.hy_mt2
Submodules
nemo_automodel.components.models.hy_mt2.confignemo_automodel.components.models.hy_mt2.dispatchnemo_automodel.components.models.hy_mt2.layersnemo_automodel.components.models.hy_mt2.modelnemo_automodel.components.models.hy_mt2.state_dict_adapter
Package Contents
Classes
API
Bases: HFCheckpointingMixin, Module, MoEFSDPSyncMixin
Hy-MT2-30B-A3B causal-LM wrapper.
Mixes in MoEFSDPSyncMixin so EP / FSDP2 expert-gradient sync works
out of the box (set distributed.ep_size in the YAML; must divide
num_experts=128). The HFCheckpointingMixin provides
from_pretrained / save_pretrained over the HF safetensors layout.
Run the decoder and project the kept positions to vocabulary logits.
Parameters:
Token IDs of shape [batch, sequence], or packed (THD) IDs of shape [1, tokens], which the decoder squeezes to [tokens]. Later pipeline stages pass hidden states of shape [batch, sequence, hidden] or [1, tokens, hidden].
Optional positions of shape [batch, sequence], or [1, tokens] for packed input, which requires them.
Optional Tensor of shape [batch, sequence], 1 at valid tokens and 0 at padding, or, with SDPA and an explicit padding_mask, a dense mask of shape [batch, 1, sequence, sequence]; packed input ignores it.
Optional bool Tensor of shape [batch, sequence], or [1, tokens] when packed, true at padding; when None, the MoE layers derive it from attention_mask.
0 keeps every position, a positive int keeps the last N positions, and an integer
Tensor of shape [kept] keeps those positions.
Whether the output carries the final hidden states; None reads
config.output_hidden_states.
Backend metadata for the decoder. Packed input sets qkv_format="thd" and passes
int32 cu_seqlens and cu_seqlens_padded of shape [1, documents + 1], padded with -1000, and
max_seqlen.
Returns: CausalLMOutputWithPast
CausalLMOutputWithPast whose logits have shape [batch, kept, vocab], or [1, kept, vocab] for packed