nemo_automodel.components.models.deepseek_v41.indexer
nemo_automodel.components.models.deepseek_v41.indexer
Fused frozen V4.1 indexer scoring with the released BF16 rounding boundaries.
The tiled GEMM/head-reduction structure follows the vendored V4 TileLang indexer. V4.1 rounds the GEMM and weighted head scores to BF16 before reducing in FP32. Visibility is supplied by the existing attention metadata path, including packed document boundaries and global CP positions; top-k/candidate selection stays there.
Module Contents
Functions
API
Compile a query/key tile; per-head intermediates remain on chip.
Fuse frozen indexer scoring without materializing per-head global scores.
Parameters:
BF16 CUDA queries [batch, local_sequence, heads, index_dim]. Heads must be a power of two no larger than 128; index_dim must be divisible by 16. Quantize/dequantize and RoPE are already applied.
BF16 CUDA keys [batch, global_compressed, index_dim], gathered across CP ranks before this call.
BF16 CUDA weights [batch, local_sequence, heads], including the released head/dimension scaling.
Boolean CUDA visibility [batch, local_sequence, global_compressed], including global causality, valid compression groups and packed document isolation. All inputs must reside on the same CUDA device.
Returns: torch.Tensor
Independent BF16 scores [batch, local_sequence, global_compressed],