NVIDIAAtharva JoshiExplainer
How to Optimize NVFP4 Attention on NVIDIA RTX Blackwell Through Register Recycling
Summary
Attention is a major bottleneck when serving world foundation models with long sequences, and NVFP4 offers hardware-accelerated 4-bit matrix multiplication on NVIDIA RTX Blackwell but requires careful scheduling to avoid Tensor Core idle time. The post describes a register recycling technique that splits each N128 score tile into two N64 halves, reusing score registers after quantization to overlap the next tile’s QK computation with the current tile’s remaining softmax and PV operations. This approach reduces Tensor Core idle time without allocating a second complete score buffer, improving utilization on the SM120 architecture. Benchmarks from Reactor’s production serving across world models show end-to-end latency reductions of up to 15.34% on the NVIDIA RTX PRO 6000 Blackwell. The optimization has been merged into FlashInfer, and the post provides guidance for integrating NVFP4 attention into models on NVIDIA RTX Blackwell.
Context
NVIDIA RTX Blackwell GPUs (SM120 architecture) have lower BF16 matmul throughput than data center variants, making attention MMA-bound rather than softmax-bound. NVFP4 offers higher TFLOP/s but requires careful scheduling to avoid Tensor Core idle time due to dependencies between QK, softmax, and PV operations.
Approach / What changed
The optimized CTA design splits each N128 score tile into two N64 halves, each occupying a separate register slot. After one half is exponentiated and quantized, its score registers are reused to compute the corresponding QK half of the next tile. This interleaves the next tile’s QK with the current tile’s remaining softmax, quantization, and PV operations, filling gaps in tensor-core activity without allocating a second complete score tile.
Takeaways
On NVIDIA RTX Blackwell, attention is MMA-bound for BF16, while on data center GPUs it is softmax-bound; NVFP4 shifts the bottleneck by providing higher TFLOP/s.
The register recycling technique splits score tiles into N64 halves and reuses registers after quantization to overlap computation across tiles, reducing Tensor Core idle time.
Reactor’s production benchmarks show end-to-end latency reductions of up to 15.34% on world models like OmniDreams when using NVFP4 attention with this optimization.
FAQ
Why is NVFP4 attention beneficial on NVIDIA RTX Blackwell?
NVFP4 offers higher TFLOP/s than BF16 on RTX Blackwell, where attention is MMA-bound. This allows higher throughput, but requires careful scheduling to avoid Tensor Core idle time.
How does register recycling work in SageAttention3?
The score tile is split into two N64 halves. After one half is quantized, its registers are reused for the next tile's QK computation, overlapping work from adjacent tiles without needing a second full score buffer.
What latency improvements were observed in production?
Reactor saw end-to-end latency reductions of up to 15.34% on OmniDreams models, with consistent improvements across LongLive and Helios models on NVIDIA RTX PRO 6000 Blackwell.
Source and freshness
- Source
- developer.nvidia.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.