cd /news/ai-infrastructure/how-to-optimize-nvfp4-attention-on-n… · home › topics › ai-infrastructure › article
[ARTICLE · art-176335] src=developer.nvidia.com ↗ pub= topic=ai-infrastructure verified=true sentiment=↑ positive

How to Optimize NVFP4 Attention on NVIDIA RTX Blackwell Through Register Recycling

NVIDIA detailed a register-recycling technique that accelerates NVFP4 attention on its RTX PRO 6000 Blackwell Series (SM120) GPUs by reclaiming score registers after softmax outputs are packed into NVFP4, letting the next tile's matrix multiplication overlap with remaining softmax work without a second full score buffer. Reactor, a developer platform for real-time video, robotics and world models, integrated the kernel into its production serving stack and reported "tremendous speedups" on real customer traffic, though the post did not disclose specific figures. The work matters because BF16 attention on RTX Blackwell is MMA-bound rather than softmax-bound like data center GPUs, and NVFP4's higher Tensor Core throughput can lift attention performance only if softmax, data movement and intermediate storage are scheduled together.

recommendation

On RTX Blackwell (SM120), pack softmax outputs to NVFP4 and recycle the freed score registers so the next tile's matmul overlaps remaining softmax, keeping Tensor Cores busy without a second score buffer.

more in playbook: Inference and self-hosting
by read12 min views13 publishedNov 25, 2026
How to Optimize NVFP4 Attention on NVIDIA RTX Blackwell Through Register Recycling
Image: NVIDIA Developer Blog

Attention can be a major bottleneck when serving world foundation models, where long sequences make inference computationally demanding. On NVIDIA Hopper and NVIDIA Blackwell data center GPUs, FlashAttention3 and FlashAttention4 improve attention performance by overlapping matrix multiply-accumulate (MMA) operations through softmax within a thread block.

However, these hardware-specific pipelines cannot be applied directly to the NVIDIA RTX PRO 6000 Blackwell Series (SM120), which uses a different Tensor Core architecture. For video generation models using BF16 inference, attention remains primarily MMA-bound on NVIDIA Blackwell RTX GPUs, while softmax is a major bottleneck in forward attention on Blackwell data center GPUs.

Introduced with NVIDIA Blackwell architecture, NVFP4 offers hardware-accelerated 4-bit matrix multiplication, enabling higher Tensor Core throughput and creating an opportunity to accelerate attention beyond BF16. But sustaining high throughput requires careful coordination of softmax, data movement, and intermediate storage. Dependencies between these stages can leave Tensor Cores idle, limiting how effectively the kernel uses the available compute.

This post explains how to accelerate NVFP4 attention on the SM120 architecture through register recycling and improved scheduling. By reclaiming score registers after the softmax outputs have been packed into NVFP4, the next tile’s matrix multiplication can overlap with remaining softmax work on the current tile. This creates a more efficient pipeline that reduces Tensor Core idle time and improves utilization without requiring a second full score buffer.

Reactor, a developer platform that provides global low-latency infrastructure and APIs for deploying and scaling real-time video, robotics, and world models, integrated this kernel in their production serving stack to serve real customer traffic and saw tremendous speedups. Their benchmarks are shared in this post.

Improving throughput with NVFP4 #

NVIDIA RTX Blackwell has lower BF16 matmul throughput compared to the data center variants. While data center workloads are bounded by softmax (FlashAttention4 tries to solve this through pipelining and exp2 emulation), the NVIDIA RTX Blackwell is bounded by MMA on BF16 Attention. Due to higher TFLOP/s for NVFP4, throughput can be improved to achieve better performance.

Attention compute

The general attention computation and the two core matrix multiplications it involves are:

  • Query-Key matrix multiplication ($QK$) : The first matmul in attention, $QKᵀ$, where $Q$ contains query vectors and $K$ contains key vectors. It computes the attention scores used by softmax.
  • Attention-Weight Value matrix multiplication ($PV$) : The second matmul in attention, $PV$, where $P$ contains softmax-derived attention weights and $V$ contains value vectors. It combines the value vectors according to their attention weights to produce the output. In the tiled attention kernel discussed here, $P$ contains unnormalized softmax weights, and final normalization is applied after the output has been accumulated across tiles (similar to FlashAttention).

How SageAttention3 accelerates attention using NVFP4

SageAttention3 is a native NVFP4 attention mechanism specifically designed for NVIDIA RTX Blackwell streaming multiprocessor (SM) 120. It performs both $QK$ and $PV$ using NVFP4. Its primary innovation came from performing two-level scaling for $P$.

NVFP4 quantization generates two tensors: an NVFP4 data tensor and an FP8 scaling tensor. Because softmax outputs are bound to a narrow [0, 1] range, they can underutilize the NVFP4 dynamic range, resulting in accuracy degradation. Two-level scaling addresses this by first normalizing the values to fully utilize dynamic range before quantizing the result.

SageAttention3 cooperative thread array stable state design

The SageAttention3 cooperative thread array (CTA) design is as follows:

  • The CTA uses four producer warps and eight consumer warps. For each N128 tile, consumers execute $QK$, softmax and probability quantization, and $PV$ in sequence.
  • While consumers perform softmax, scaling, and quantization, tensor-core activity has gaps. Video 1 illustrates this sequential execution.

For each N tile:
    AsyncLoad(Q)
    AsyncLoad(K, V, Scale_Factors, delta_s)


    Execute_QK_OMMA()
    Apply_delta_s_correction()

    Apply_Masking()
    Execute_Online_Softmax()
    Execute_NVFP4_Probability_Quantization()

    Execute_PV_OMMA()

The following observations can be drawn from this CTA design and the parallel thread execution (PTX) and instruction set architecture (ISA) for NVIDIA RTX Blackwell GPUs:

First, TMA Loads are bound to Shapes of 128×128, not utilizing the entire shape would mean underutilizing our GPU bandwidth.

Second, the NVIDIA Blackwell RTX OMMA operation remains constrained to m16, n8, k64 (where m and n represent LHS/RHS free dimensions, while k is the contraction axis), as specified by the PTX instruction mma.sync.aligned.kind::mxf4nvf4.block_scale.scale_vec::4X.m16n8k64.

To cover the full contraction dimension of k=128, two MMA instructions with k=64 must be issued. The current CTA design issues these instructions for $QK$ in succession. Because MMA execution is synchronous, the issuing consumer warps wait for completion before proceeding to online softmax and intermediate quantization.

This means that the operations within the stable loop are sequentially pipelined. There is a large gap in MMA activity, as there is no compute scheduled on the tensor cores. The warps are busy computing the softmax, scaling, and quantization operations.

Video 1 shows the attention-kernel timeline, including sequential $QK$ matrix multiplication, softmax, and $PV$ matrix multiplication.

Register constraints

Producer warps use 3,072 registers, and consumer warps use 59,392 registers. The total of 62,464 registers occupies approximately 95.3% of the SM’s register capacity. This leaves little room to hold an additional score tile while processing the current tile.

Optimized CTA design

The design retains four producer warps, eight consumer warps, and complete N128 K/V tile loads. The change is in how consumers compute and store attention scores. Each N128 score tile is split into two N64 halves, and each occupies a separate register slot.

After one half has been 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$ to work with the current tile’s remaining softmax, quantization, and $PV$ operations.

The online-softmax state is still updated across the complete N128 score tile before either half is consumed.

Video 2 shows how this schedule fills gaps in tensor-core activity without allocating a second complete score tile.

The following pseudocode illustrates the optimized schedule, including the initial score computation, steady-state register reuse, and processing of the final tile.

Unlike the original design, which completes $QK$, softmax, quantization, and $PV$ sequentially for each N128 tile, the optimized design splits the score tile into two N64 register slots. When half is quantized, its score registers are reused for the next tile’s $QK$ computation. This allows work from adjacent tiles to be interleaved without allocating a second complete score tile, while retaining the same four producer warps and eight consumer warps.

#

AsyncLoad(Q, Q_ScaleFactors)

for N_tile in traversal_order:
    AsyncPrefetch(
          K[N_tile],
          V[N_tile],
          K_ScaleFactors[N_tile],
          V_ScaleFactors[N_tile],
          delta_s[N_tile],
      )

CurrentTile = First_N_Tile()

ScoreSlot0 = Execute_QK_OMMA_N64(Q, K[CurrentTile, 0:64], delta_s[CurrentTile, 0:64],)
ScoreSlot1 = Execute_QK_OMMA_N64(Q, K[CurrentTile, 64:128], delta_s[CurrentTile, 64:128],)

  while HasNextTile(CurrentTile):
      NextTile = Next_N_Tile(CurrentTile)

      Update_Online_Softmax_State(ScoreSlot0, ScoreSlot1, OnlineMax, OnlineSum,)
      Rescale_Output_Accumulator(Output, OnlineMax)


      Probability0 = Exponentiate_And_NVFP4_Quantize(ScoreSlot0)

      ScoreSlot0 = Execute_QK_OMMA_N64(Q, K[NextTile, 0:64], delta_s[NextTile, 0:64],)

      Output += Execute_PV_OMMA_N64(Probability0, V[CurrentTile, 0:64],)

      Probability1 = Exponentiate_And_NVFP4_Quantize(ScoreSlot1)
      ScoreSlot1 = Execute_QK_OMMA_N64(Q, K[NextTile, 64:128], delta_s[NextTile, 64:128],)
      Output += Execute_PV_OMMA_N64(Probability1, V[CurrentTile, 64:128],)

      CurrentTile = NextTile


  Update_Online_Softmax_State(ScoreSlot0, ScoreSlot1, OnlineMax, OnlineSum,)
  Rescale_Output_Accumulator(Output, OnlineMax)
  Probability0 = Exponentiate_And_NVFP4_Quantize(ScoreSlot0)
  Output += Execute_PV_OMMA_N64(Probability0, V[CurrentTile, 0:64],)
  Probability1 = Exponentiate_And_NVFP4_Quantize(ScoreSlot1)
  Output += Execute_PV_OMMA_N64(Probability1, V[CurrentTile, 64:128],)

  Output = Output / OnlineSum
  AsyncStore_BF16(Output)

NVFP4 attention kernel integration latency results #

Reactor evaluated the optimized kernel on an NVIDIA RTX PRO 6000 Blackwell Server Edition GPU with 96 GB of memory (SM120), measuring its impact across four world-model workloads.

Attention kernel speedup

To isolate the scheduling optimization, the original and optimized NVFP4 kernels were compared using identical $Q/K/V$ inputs, packed tensors, and log-sum-exp settings.

Workload / mask Original (ms) Optimized (ms) Speedup
LongLive 7,040 / noncausal 0.75052 0.63548 1.18x
LongLive 7,040 / causal 0.44992 0.37927 1.19x
Synthetic 4,096 / noncausal 0.28962 0.23190 1.25x
Synthetic 4,096 / causal 0.21199 0.16087 1.32x
Synthetic 8,192 / noncausal 1.00177 0.85648 1.17x
Synthetic 8,192 / causal 0.76466 0.46659 1.64x
Synthetic 16,384 / noncausal 3.80862 3.25377 1.17x
Synthetic 16,384 / causal 2.20630 1.78152 1.24x

Table 1. Core NVFP4 latency before and after optimization on NVIDIA RTX PRO 6000 Blackwell All cases use batch size 1, 24 heads, head dimension 128, and equal query/key lengths. The 7,040-token input was captured from LongLive; the other inputs are synthetic. Core timing excludes Q/K/V quantization and output-stride restoration

Measurements used three fresh processes per implementation, alternating run order, active prewarming, and repeated CUDA-event timing blocks.

End-to-end model inference performance

Reactor integrated this NVFP4 attention kernel into its production serving infrastructure and used it to serve real customer traffic across several models. Table 2 shows the impact on end-to-end model inference latency on NVIDIA RTX PRO 6000 Blackwell.

Latency was measured for the complete model path per video chunk, full generation, or action prediction. The table specifies which attention operations use NVFP4; other attention operations and model weights remain BF16. The terms idle and moving refer to camera scenarios with the same NVFP4 coverage.

For the video-chunk and action-prediction benchmarks, the BF16 baseline uses native cuDNN attention. Timings include quantization, layout conversion, and decoded CPU-frame or action output, but exclude model , warmup, networking, queueing, and client pacing.

Model / scenario Measured output Attention using NVFP4 BF16E2E latency(s) NVFP4E2E latency(s) Latency reduction
LongLive 32 frames 704 × 1280 Self-attention + cached history 5.13 4.79 6.70%
Helios 33 frames 384 × 640 11,280-token self-attention only 5.94 5.84 1.70%
Helios 33 frames 384 × 640 All self-attention calls 5.94 5.87 1.11%
OmniDreams – idle 8 frames 704 × 1280 Self-attention + cached history 0.60 0.51 14.77%
OmniDreams – moving 8 frames 704 × 1280 Self-attention + cached history 0.60 0.51 14.95%
Cosmos 3 Nano Policy Droid (pilot) 32 × 8 action prediction Dense generator attention only 1.72 1.69 1.70%
LongLive (long run) 1,021 frames 32 chunks Self-attention + cached history 162.52 151.89 6.54%
Helios (long run) 1,056 frames 32 chunks Largest self-attention calls only 190.88 187.48 1.78%
Helios (long run) 1,056 frames 32 chunks All supported self-attention 190.88 188.36 1.32%
OmniDreams – idle (long run) 1,021 frames 128 chunks Self-attention + cached history 77.34 65.79 14.94%
OmniDreams – moving (long run) 1,021 frames 128 chunks Self-attention + cached history 77.77 65.95 15.20%
OmniDreams – idle (long run) 2,045 frames 256 chunks Self-attention + cached history 155.44 131.84 15.18%
OmniDreams – moving (long run) 2,045 frames 256 chunks Self-attention + cached history 155.92 132.00 15.34%

Table 2. End-to-end inference latency on NVIDIA RTX PRO 6000 Blackwell with BF16 and NVFP4 attention, measured for the output listed in each row Long-run rows measure complete warmed generations through decoded CPU frames, excluding model and transport. LongLive and Helios report medians of three independent process runs per arm using eager execution; OmniDreams reports one process per arm/scenario. Latency reductions are calculated from unrounded measurements.

Get started accelerating NVFP4 attention #

The scheduling and score-register reuse techniques described in this post improve NVFP4 attention performance on NVIDIA RTX Blackwell. This approach helps accelerate world model inference. The core optimization has been merged into the FlashInfer main branch.

To learn how Reactor integrated this kernel into production to serve real customer traffic, refer to Integrating NVFP4 Attention into Real-Time Models on Reactor.

Ready to get started accelerating NVFP4 attention?

Acknowledgments

We thank the Reactor team for sharing their measurements and supporting our evaluation of NVFP4 attention across world models.

── more in #ai-infrastructure 4 stories · sorted by recency
── more on @nvidia 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-optimize-nvfp…] indexed:0 read:12min 2026-11-25 · —