nemo_automodel.components.models.mimo_v2_flash.model
nemo_automodel.components.models.mimo_v2_flash.model
Module Contents
Classes
Functions
Data
API
Bases: Module
MiMo-V2 attention with a Transformer Engine THD context-parallel path.
Apply partial RoPE to BSHD or flattened THD query/key tensors.
Run TE attention with native V dimensions, padding for legacy TE a2a CP.
Parameters:
Tensor of shape [batch, sequence, hidden] for BSHD, or [tokens, hidden] for THD; a singleton batch is also accepted.
Cosine and sine tensors aligned to the input sequence, each ending in the rotary feature dimension.
Optional mask of shape [batch, sequence] for BSHD.
TE attention metadata, including one-dimensional cumulative sequence-length tensors for THD inputs.
Returns: torch.Tensor
Attention output with the same shape as hidden_states.
Validate the head partition required by TE’s a2a CP transport.
Validate and attach TE all-to-all context parallelism.
Bases: Module
Decoder block that alternates dense MLP and routed-MoE layers.
Bases: HFCheckpointingMixin, Module, MoEFSDPSyncMixin
Causal LM wrapper for MiMo-V2-Flash with Automodel checkpoint adapters.
Encode global media and splice only this TE THD shard’s feature rows.
Map local TE THD placeholders to rows in globally ordered media features.
Retrieve PP media using global masks so every CP rank runs the same vision work.
Keep both rotary embeddings per stage and the vision tower on stage zero.
Run text or VLM forward with TE-local packed media placement.
Describe PP tensors using the already TE-sharded local token length.
Install MiMo’s model-local adapter around framework TE THD sharding.
Bases: Module
Backbone model for Xiaomi MiMo-V2-Flash.
Run the text backbone in BSHD or genuine TE THD layout.
THD batches must already have passed through the framework TE sharder. Their cumulative lengths delimit packed documents and are forwarded to every attention layer, including non-first pipeline stages.
Bases: Module
Rotary embedding module matching MiMo-V2-Flash partial-RoPE behavior.
Build the FP32 inverse frequencies on the requested device.
Restore a non-persistent RoPE buffer after meta-model materialization.
Bases: MiMoV2FlashForCausalLM
MiMo-V2.5/V2.6 wrapper using the mimo_v2 checkpoint config.
Resolve a MiMo-V2 config while checkpoint loading remains framework-owned.
Bases: Module
RMSNorm used by MiMo-V2-Flash decoder blocks.
Construct a MiMo RMSNorm from the configured backend.
Apply causal sliding-window bounds to an existing 4D document mask.
Accept the THW grids emitted by Qwen processors and PP’s HW alias.
Replace one kind of multimodal placeholder while preserving gradients.
Reject the known pre-9.26 cuDNN ragged dSink kernel bug.