All stories

NVIDIA maps sparse attention's indexer bottleneck

NVIDIA has published a hardware co-design primer on sparse attention, arguing that the indexer that picks which tokens to attend to has become a major cost in long-context inference.

NVIDIA published a primer for model developers on designing sparse attention that runs efficiently on its GPUs. Its central point is that sparse attention does not remove the cost of long context. It moves that cost.

In sparse attention, each query attends only to its top k keys, usually a few thousand, so core attention no longer grows with context length N. But the indexer that chooses those keys still scores all N of them. NVIDIA reports that in a DeepSeek V3.2 prefill layer, the indexer and Top-k together take 47% of the time. Dense attention, by comparison, can take most of a layer's prefill time at 128K tokens.

The post covers sparsity that is trained into the model, not drop-in methods applied after training such as BLASST, MInference or Quest. It surveys indexer designs in DeepSeek Sparse Attention, GLM 5.2, GLM 5.3 Flash, LongCat LSA-Flash, CSA, Qwen QSA, MiniMax MSA, NSA and MoBA. Most use one key head, 32 to 64 query heads combined into a single score with a ReLU and weighted sum, a head dimension of 128, and token-level or small-block selection.

Using a production FP8 kernel, NVIDIA tests five indexer settings: query heads, key heads, head dimension, compression ratio and speculative-decoding depth. Its arithmetic-intensity analysis finds:

  • Sequence length and compression ratio change the total work but not the ratio of FLOPs to bytes.
  • Intensity scales with the group size G, the number of query heads per key head. Designs that do not combine heads into one score, such as MSA and MoBA, lose that factor.
  • In decode, intensity grows almost linearly with the number of draft tokens plus one.

The material provided ends before the post's measured results and design recommendations.

Sources