nemo_automodel.components.models.d1.causal
nemo_automodel.components.models.d1.causal
Released D1-3B rotary precision on the standard LFM2 causal stack.
Module Contents
Classes
API
Bases: Lfm2Attention
Reuse an HF attention block’s weights with the released float32 rotation.
Run standard GQA after the checkpoint’s float32 half-split rotation.
Parameters:
Tensor of shape [batch, sequence, hidden].
Pair of float32 cosine/sine Tensors, each of shape [batch, sequence, head_dim].
Optional additive Tensor of shape [batch, 1, sequence, key_sequence], with zero for allowed keys and a negative sentinel for causal/padding exclusions.
Optional HF autoregressive cache, updated in place.
Additional HF attention dispatcher arguments.
Returns: torch.Tensor
Pair of output Tensor of shape [batch, sequence, hidden] and
Bases: Lfm2RotaryEmbedding
Keep frequencies and trigonometry in float32, as the released D1 decoder.
Compute the release’s float32 rotary factors.
Parameters:
Tensor of shape [batch, sequence, hidden], supplying the device.
Long Tensor of shape [batch, sequence].
Returns: torch.Tensor
Pair of float32 cosine and sine Tensors, each of shape
Bases: Lfm2ShortConv
Retain HF checkpoint/cache ownership with the release’s chain convolution.
Run the released depthwise kernel for independent uncached chains.
Cached decoding and packed sequence indices retain HF’s implementation. Training uses uncached chains and preserves the publisher’s convolution accumulation rather than the optional fused causal-conv kernel.
Parameters:
Tensor of shape [batch, sequence, hidden].
Optional HF cache. Cached decoding delegates to HF and updates its per-layer convolution state in place.
Optional Tensor of shape [batch, sequence], with one/true for real tokens and zero/false for padding.
Optional integer Tensor of shape [batch, sequence] giving packed sequence IDs. When present the HF path owns segment boundary handling and its optional causal-convolution kernel.
Returns: torch.Tensor
Tensor of shape [batch, sequence, hidden] in the input dtype.