Co-Designing AI Model Attention for Fast, Interactive Long-Context Inference
AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.
Why it matters
LLM builders can cut decode latency roughly 2x per doubling of group size by choosing GQA/MQA, head dimensions of 128 or 256, and smaller KV states during model design.
NVIDIA engineers published guidance on designing AI model attention, the part of a language model that reads long prompts, so it runs fast on NVIDIA chips. They found that sharing one memory bank among many query heads (a scheme called GQA) makes generating each response token roughly twice as fast for every doubling, while leaving prompt processing unaffected. They also recommend head sizes of 128 or 256, which fit chip hardware neatly. Anyone building or deploying long-context AI models on NVIDIA GPUs benefits.
As context lengths grow, attention consumes most inference time, NVIDIA measured its share of DeepSeek-R1 prefill rising from 18% at 4K context to 85% at 128K. NVIDIA argues these costs are set by model design choices: group size, head dimension, sequence length and tensor parallelism. Teams training their own models on NVIDIA GPUs can roughly halve token-generation time per group-size doubling by following the guidelines; teams serving existing models gain little directly. The analysis appears in TensorRT-LLM tooling.
Prefill is compute-bound (quadratic in ISL); decode is memory-bound on KV cache reads, with arithmetic intensity ≈ 2×G independent of KVSL. Measured FP8 kernels show decode runtime falling ~2x per doubling of G (MHA G=1 to MQA G=64), flattening beyond G=16 at KVSL=32K due to flash-decoding reduction overheads. Hsz of 64 pays for a 128-wide tile and 512 nears TMEM limits, so 128/256 are optimal. Tensor parallelism must not exceed KV head count; few-KV-head models need Wide EP or Helix Parallelism, as in Nemotron 3's GQA with two KV heads.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
FlashAttention TensorRT-LLM Nemotron 3 DeepSeek-R1 GQA MQA Helix Parallelism
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.