Optimizing NVFP4 Attention on NVIDIA RTX Blackwell with Register Recycling

NVIDIA RTX Spark launch begins with global events for Windows PCs




Home

Latest reporting

News


NVIDIA’s SageAttention3 kernel improves NVFP4 attention on RTX Blackwell GPUs by reducing Tensor Core idle time through register recycling.






NVIDIA has introduced a significant optimization for NVFP4 attention on its RTX Blackwell GPUs, leveraging register recycling to enhance performance. The SageAttention3 kernel, specifically designed for the SM120 architecture of the NVIDIA RTX PRO 6000 Blackwell Series, addresses bottlenecks in attention computation by reducing Tensor Core idle time and improving throughput.

NVFP4 and its Role in Attention Optimization

The NVIDIA Blackwell architecture introduced NVFP4, a hardware-accelerated 4-bit matrix multiplication capability that offers higher Tensor Core throughput compared to BF16. This advancement creates opportunities to accelerate attention workloads, particularly in video generation models and world foundation models, where long sequences make inference computationally demanding. However, achieving high throughput with NVFP4 requires careful coordination of softmax operations, data movement, and intermediate storage to avoid idle Tensor Cores.

SageAttention3 Kernel and Register Recycling

The SageAttention3 kernel optimizes the NVFP4 attention pipeline by reclaiming score registers after softmax outputs are packed into NVFP4. This allows the next tile’s matrix multiplication to overlap with the ongoing softmax operations of the current tile. By splitting each N128 score tile into two N64 register slots, the kernel eliminates the need for a second full score buffer, reducing latency and improving efficiency.

In the cooperative thread array (CTA) design of SageAttention3, four producer warps and eight consumer warps handle data loading and attention computations. Despite the sequential execution of operations like Query-Key (QK) matrix multiplication, softmax, and Probability-Value (PV) matrix multiplication, the register recycling approach minimizes gaps in Tensor Core activity, enhancing utilization.

Performance Gains and Real-World Integration

Reactor, a developer platform for real-time video and robotics models, integrated the optimized SageAttention3 kernel into its production serving stack. Benchmarks revealed end-to-end inference latency reductions of up to 15.34% across workloads such as LongLive, Helios, OmniDreams, and Cosmos 3 Nano. Additionally, the NVFP4 attention kernel achieved latency improvements of up to 1.64x compared to BF16.

This optimization has been merged into the FlashInfer main branch, enabling broader adoption for developers working with NVIDIA RTX Blackwell GPUs. By integrating the SM120 NVFP4 attention API, developers can achieve significant performance improvements in supported attention layers.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest