nemo_automodel.components.models.qwen3_omni_moe.model
nemo_automodel.components.models.qwen3_omni_moe.model
Module Contents
Classes
Data
API
Bases: HFCheckpointingMixin, HFQwen3OmniMoeThinkerForConditionalGeneration, MoEFSDPSyncMixin
Qwen3OmniMoe Thinker for Conditional Generation with multimodal support.
Forward pass with multimodal fusion.
Parameters:
Integer token IDs of shape [batch, sequence], or packed (THD) IDs of shape [1, tokens], which this method squeezes to [tokens].
Audio features of shape [audios, mel_bins, frames].
Packed image patches of shape [image_patches, patch_features], where patch_features flattens channels, temporal depth, height, and width.
Packed video patches of shape [video_patches, patch_features].
Integer temporal/height/width grids of shape [images, 3].
Integer temporal/height/width grids of shape [videos, 3].
Padding mask of shape [batch, sequence].
Valid audio frames of shape [audios, frames].
Valid frame counts of shape [audios].
Rotary coordinates of shape [3, batch, sequence].
Optional bool mask of shape [batch, sequence], or [1, tokens] when packed, true at padding; the decoder ignores it and derives padding from attention_mask.
Optional embeddings of shape [batch, sequence, hidden].
Target token IDs of shape [batch, sequence].
Whether to output router logits
Whether audio is in video
Temporal grid spacing of shape [videos].
Integer count or index tensor of shape [selected_positions].
If > 0, only compute logits for the last
logits_to_keep token positions (0 = all positions). Enables
memory-efficient fused cross-entropy by letting the recipe request
a single-position lm_head projection alongside the final hidden
states.
When set, the returned output carries the final
hidden states (the input to lm_head) so the recipe can run
fused linear cross-entropy.
Additional attention arguments
Returns: torch.Tensor | dict | CausalLMOutputWithPast
With labels or output_router_logits, a dict holding logits, a scalar loss when labels are
Bases: Module
Qwen3OmniMoe Thinker Text Model with MRoPE and sparse MoE layers.
Run the thinker text decoder; packed (THD) input comes back batched.
Parameters:
Optional token IDs of shape [batch, sequence], or packed [tokens].
Optional embeddings of shape [batch, sequence, hidden], or packed [tokens, hidden].
Optional positions of shape [batch, sequence] or [axes, batch, sequence], with 3 multimodal rotary axes (a 4th leading axis is dropped); packed input passes the thinker’s squeezed positions.
Tensor of shape [batch, sequence], 1 at valid tokens and 0 at padding; the decoder derives the MoE padding mask from it.
Ignored; the MoE padding mask is derived from attention_mask.
Optional bool mask of shape [batch, sequence, 1], true at visual placeholder tokens; only its […, 0] slice is read.
Optional list with one Tensor of shape [visual_tokens, hidden] per DeepStack level (https://arxiv.org/abs/2406.04334), taken from successive vision-encoder layers; entry i is added to the visual-token hidden states after decoder layer i.
Backend metadata, including packed sequence boundaries.
Returns: torch.Tensor
Hidden states of shape [batch, sequence, hidden], or [1, tokens, hidden] for packed input.
Bases: HFQwen3OmniMoeThinkerTextRotaryEmbedding
Ensure HF rotary frequency buffers stay fp32 across module-wide casts.