nemo_automodel.components.models.qwen3_vl_moe.model
nemo_automodel.components.models.qwen3_vl_moe.model
Module Contents
Classes
Data
API
Bases: Qwen3VLMoeTextRotaryEmbedding
Ensure inv_freq stays in float32
Bases: Qwen3VLMoeVisionRotaryEmbedding
Ensure the vision rotary inv_freq buffer remains float32.
Bases: HFCheckpointingMixin, HFQwen3VLMoeForConditionalGeneration, MoEFSDPSyncMixin
Qwen3-VL conditional generation model using the Qwen3-MoE backend components.
Run text and media inputs while preserving their distinct leading axes.
Parameters:
Token IDs of shape [batch, sequence] or [tokens] for THD.
Rotary coordinates of shape [3, batch, sequence], with a placeholder batch axis of size one for THD.
Optional binary padding mask of shape [batch, sequence].
Dense NEAT masks are unsupported; packed inputs use THD with
qkv_format="thd" and attention_mask=None.
Optional padding flags of shape [batch, sequence] or [tokens] for THD.
Optional embeddings of shape [batch, sequence, hidden] supplied by a preceding pipeline stage.
Optional token positions of shape [sequence].
Number of trailing logits, or token indices of shape [selected_tokens], to retain.
Return hidden states for fused loss computation.
Attention metadata, including cu_seqlens and
cu_seqlens_padded of shape [documents + 1] (optionally with
a leading placeholder batch axis), and scalar max_seqlen.
Media tensors retain pixel_values/pixel_values_videos
of shape [patches, patch_features] and image/video grid_thw
of shape [media_items, 3], including when media_items is one.
Returns:
Model output with logits of shape [batch, sequence, vocab], with a
Bases: HFQwen3VLMoeModel
Fuse packed vision patches into padded text sequences.
Parameters:
Integer tensor of shape [batch, sequence].
Padding mask of shape [batch, sequence], or per-layer masks.
Rotary coordinates of shape [3, batch, sequence].
Hugging Face decoder cache, unused by the native text backend.
Optional embeddings of shape [batch, sequence, hidden].
Image patches of shape [image_patches, patch_features], where patch_features flattens channels, temporal depth, height, and width.
Video patches of shape [video_patches, patch_features].
Integer tensor of shape [images, 3] with temporal/height/width grids.
Integer tensor of shape [videos, 3] with temporal/height/width grids.
Optional positions of shape [sequence].
Backend options, including mm_token_type_ids of shape [batch, sequence].
Returns:
Model output with last_hidden_state of shape [batch, sequence, hidden].
Bases: Module
Qwen3-VL text decoder rebuilt on top of the Qwen3-MoE block implementation.
Run the text decoder; packed (THD) input from the multimodal wrapper 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 padding or attention mask for unpacked input.
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 wrapper’s squeezed positions.
Optional token positions of shape [sequence].
Optional bool mask of shape [batch, sequence], true at visual tokens.
Optional per-layer visual features, each of shape [visual_tokens, hidden].
Optional bool mask with the token layout of input_ids, true at padding.
Unsupported cache.
Whether to use a cache; only False or None is supported.
Backend metadata, including packed sequence boundaries.
Returns: Qwen3VLMoeModelOutputWithPast
Model output whose last_hidden_state has shape [batch, sequence, hidden], or [1, tokens, hidden]