nemo_automodel.components.models.deepseek_v32.model
nemo_automodel.components.models.deepseek_v32.model
DeepSeek V3.2 Model.
Contains DeepseekV32Block, DeepseekV32Model, and DeepseekV32ForCausalLM. These classes subclass from DeepSeek V3, with the main difference being the use of DeepseekV32MLA (with Indexer) instead of the standard MLA.
Module Contents
Classes
Data
API
Bases: Block
Transformer block for DeepSeek V3.2.
Subclasses V3 Block, using DeepseekV32MLA (with Indexer) instead of the standard MLA.
Bases: DeepseekV3ForCausalLM
DeepSeek V3.2 for Causal Language Modeling.
Subclasses V3 ForCausalLM, using DeepseekV32Model and DeepSeekV32StateDictAdapter.
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 additive mask of shape [batch, 1, sequence, sequence], 0 to attend and -inf to mask, for unpacked input with SDPA. The sparse indexer also adds it to its top-k scores, and padding_mask should accompany it. Packed input ignores it.
Optional bool Tensor of shape [batch, sequence], or [1, tokens] when packed, true at padding.
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
Bases: DeepseekV3Model
DeepSeek V3.2 Model.
Subclasses V3 Model, using DeepseekV32Block instead of Block.