nemo_automodel.components.models.step5.model
nemo_automodel.components.models.step5.model
Native Step-5 Preview text and vision-language training models.
Module Contents
Classes
Data
API
Bases: HFCheckpointingMixin, PreTrainedModel, MoEFSDPSyncMixin
Step-5 causal LM with native grouped experts and model-owned CP.
Identify a stage after AutoPipeline removes modules owned by other stages.
Evaluate all local query positions.
Parameters:
Int64 tensor of shape [batch, local_sequence], or the FP32 residual tensor [batch, local_sequence, hidden] on later pipeline stages.
Optional tensor of shape [batch, local_sequence, hidden].
Optional tensor of shape [batch, local_sequence], resetting at document starts.
Optional tensor of shape [batch, local_sequence], one for valid tokens.
Optional bool tensor of shape [batch, local_sequence], true for padding.
Last-token count or tensor of sequence indices to project.
Return final hidden states for native fused CE.
Optional tensor of shape [batch, local_sequence] for serial HF-style shifted CE.
Optional [batch, local_sequence] document IDs from native packing.
Recipe metadata. BSHD inputs are used even for concatenated documents.
Returns: CausalLMOutputWithPast | torch.Tensor
Output with logits [batch, selected_sequence, vocab], optional final
Construct a model through the AutoModel registry.
Return the language embedding module.
Return the untied language-model head.
Declare stage I/O without rounding the FP32 residual at a pipeline boundary.
Parameters:
Whether this stage receives token IDs.
Number of sequences in each pipeline microbatch.
Local sequence length after any context-parallel sharding.
Compute dtype for the final normalized hidden states or logits.
Returns: tuple[torch.Tensor, ...]
Input and output metadata tuples. First-stage input IDs have shape
Initialize all trainable tensors for checkpoint-free construction.
Initialize after meta allocation and apply precision-aware casting.
Choose the framework’s contiguous sharder.
Parameters:
Mapping with [batch, global_sequence] token and label tensors, optional [batch, global_sequence, hidden] embeddings and image tensors.
Number of pipeline microbatches; each uses the same sequence sharder.
Returns: dict[str, ContextParallelSharder | torch.Tensor]
Mapping containing the model’s ContextParallelSharder.
Bases: Step5ForCausalLM
Step-5 language model with the compatible Step perception encoder.
Encode overview or crop images.
Parameters:
Tensor of shape [images, channels, height, width].
Dtype of the completed language embedding projection.
Returns: torch.Tensor
Tensor of shape [images, image_tokens, hidden].
Inject projected crop/overview tokens and run the text backbone.
Parameters:
Tensor of shape [batch, local_sequence].
Optional tensor of shape [batch, local_sequence, hidden].
Optional tensor of shape [images, channels, height, width].
Optional tensor of shape [crops, channels, height, width].
Crop counts of shape [images], or equivalent list.
Tensor and scalar arguments from Step5ForCausalLM.forward.
Returns: CausalLMOutputWithPast
Language output with logits of shape [batch, local_sequence, vocab].
Initialize both towers after meta allocation, then apply compute dtype.
Bases: Module
Embedding, decoder stack and final normalization.
Evaluate the decoder stack with FP32 residuals.
Parameters:
Tensor of shape [batch, local_sequence, hidden].
Tensor of shape [batch, local_sequence].
Boolean tensor of shape [batch, local_sequence], true for padding.
Optional independent document IDs [batch, local_sequence], positive for real tokens and zero for padding.
Returns: torch.Tensor
Tensor of shape [batch, local_sequence, hidden]: FP32 residuals on