nemo_automodel.components.models.deepseek_v4.kernels.tilelang_sparse_mla_fwd
nemo_automodel.components.models.deepseek_v4.kernels.tilelang_sparse_mla_fwd
Module Contents
Functions
API
Forward interface for V4 sparse MQA attention.
Parameters:
Contiguous CUDA BF16 queries [batch, sequence, heads, head_dim].
Contiguous CUDA BF16 shared keys/values [batch, kv_sequence, head_dim].
CUDA FP32 denominator biases [heads].
Contiguous CUDA integer indices [batch, sequence, slots]. Entries outside [0, kv_sequence) are masked; slots are internally padded to a multiple of block_I.
Score multiplier, defaulting to head_dim**-0.5.
Sparse-key slots processed by each kernel iteration.
Pipeline stages for the generated kernel.
CUDA threads per block.
Match the original inference kernel’s scaled-logit FP32 arithmetic while retaining log2 LSE for the existing backward.
Returns: torch.Tensor
Independent BF16 output [batch, sequence, heads, head_dim] and FP32