nemo_automodel.components.models.inkling2.attention
nemo_automodel.components.models.inkling2.attention
Learned-relative GQA with eager reference and compiled training attention.
Module Contents
Classes
API
Bases: NamedTuple
Q/K/V inputs, each [batch, sequence, hidden], after its respective norm.
Bases: Module
Local or full GQA with relative features, convolutions, gate and sink.
Evaluate the quadratic reference without mutating inputs.
Parameters:
Tensor of shape [batch, sequence, heads, head_dim].
Tensor of shape [batch, key_sequence, kv_heads, head_dim].
Tensor of shape [batch, key_sequence, kv_heads, head_dim].
Tensor of shape [batch, heads, sequence, relative_extent].
Tensor of shape [batch, sequence, heads].
Boolean tensor of shape [batch, sequence].
Integer logical positions [batch, local_sequence].
Boolean validity [batch, key_sequence], global under CP.
Integer logical positions [batch, key_sequence].
First local query’s column in the global token stream.
Returns: torch.Tensor
FP32 context of shape [batch, sequence, heads, head_dim].
Evaluate the configured attention backend with a zero-valued virtual sink.
Parameters:
Q/K/V tensors of shape [batch, sequence, hidden].
Boolean tensor of shape [batch, sequence], true for real tokens.
Integer tensor of shape [batch, sequence], logical token positions.
Returns: torch.Tensor
Tensor of shape [batch, sequence, hidden] in sources.q’s dtype.
Initialize fused projections, relative table, scales and convolution weights.
Configure model-owned KV transport through the shared MoE CP hook.