Co-Designing Sparse Attention for Efficient Long-Context Inference
AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.
Why it matters
Sparse attention's indexer and Top-k stages can eat nearly half of prefill time at 128K context, and NVIDIA's measured guidelines tell model designers how to avoid that hidden cost.
NVIDIA published a guide on sparse attention, a technique where an AI model looks at only a few thousand relevant tokens instead of an entire 128,000-token document. Finding those tokens still costs time, and the guide explains how to design that part to run fast on NVIDIA chips. It matters to people building large language models for very long documents and codebases.
As AI workloads move to contexts of 128K tokens or more, attention becomes the dominant cost, and NVIDIA's measurements show the token-selection machinery takes 47% of prefill time in DeepSeek V3.2. Teams training long-context models gain concrete speed guidelines; those using hosted APIs are unaffected. Fused implementations already exist in TensorRT LLM and FlashInfer.
The post benchmarks an FP8 sparse-attention indexer, showing decode arithmetic intensity scales with group size G=QH/KH and draft length D+1, which must fit in one Tensor Core tile (~200 rows, 256 with FP16 epilogue). KH=1 with cross-head reduction avoids linear decode growth (7.6x cost at KH=8); Hsz=128 or 256 is optimal. Fusing Top-k plus reusing the prior step's selection gives 2.1x-2.4x Top-k speedup.
Questions this answers
The article above answers these:
- why is sparse attention still expensive at 128K context length
- how many indexer query heads and key heads should I use
- how do I speed up Top-k selection in decode
Read the original
This summary exists to save you time, not to replace the source.
Key terms
NVIDIA TensorRT LLM FlashInfer DeepSeek V3.2 DeepSeek Sparse Attention GLM 5.2 MoBA
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Samsung is testing a feature that changes the angle of photos you’ve already taken
Samsung’s new Recompose lets users change photo angles after shooting, potentially reducing the need for multiple shots and improving post-capture editing workflows for photographers and casual users alike.
Frame generation on NVIDIA cards: DLSS on RTX 40/50, FSR 3 elsewhere
Enabling frame generation on non-RTX 40/50 GPUs lets gamers run console-build games at higher frame rates without buying new hardware.
Taking Trainium3 to the Track: Generating Videos with LTX-2.5
Video generation on AWS Trainium3 can now rival Lightricks' paid API in speed, giving teams a non-CUDA inference option, though only after heavy custom patching.
The Download: Better bionic hands and AI’s natural-gas boom
This newsletter roundup mostly relays other outlets' reporting; its two own stories flag sensory-linked prosthetics reaching home use and AI data centers locking the US grid into natural gas.
Introducing the llama.cpp benchmark dashboard for AMD Ryzen and Radeon
AMD developers running llama.cpp locally on Ryzen/Radeon GPUs can now compare prompt-processing and token-generation speeds across builds, models and quantizations on a public dashboard.