betaFeedback

WorksComputer Science

DeCo-Attention: Decompose to Compensate for Low-Precision Attention

Abstract

Self-attention over tens of thousands of tokens dominates the generation time of video diffusion transformers, because its cost grows quadratically with sequence length. The FP4 matrix products of modern GPUs can speed up attention, but the 4-bit rounding of the queries Q and the keys K introduces large errors. We show that the exponential in softmax amplifies the error of their product QK, which therefore dominates the attention error. We propose DeCo-Attention, a co-design of algorithm and system for low-precision attention. DeCo-Attention is training-free and compensates the rounding error of Q and K along a few principal directions found by a per-head eigendecomposition. The lightweight compensation terms are appended to Q and K as extra channels, so the FP4 matrix product corrects its own rounding error while it computes the attention scores. Once the products run in FP4, the softmax bounds the kernel, and we optimize the softmax so that the gain of FP4 computation translates into realized speedup. With QK in FP4, we implement DeCo-Attention with the rest of attention in FP8 on GB300 and VR200 and in FP4 on RTX PRO 6000. On Wan2.2, these kernels run 2.13x, 2.49x, and 2.82x faster than BF16 attention, and the whole generation runs 1.55x, 1.68x, and 1.80x faster. On four video generation models, the FP8 configuration achieves LPIPS comparable to prior 8-bit QK methods, and the fully FP4 configuration lower LPIPS than prior fully 4-bit kernels.

Introduction

Video diffusion transformers (DiTs) ((Peebles & Xie, 2023)) have become the mainstream approach to video generation, as in Wan ((Team Wan et al., 2025)), HunyuanVideo ((Kong et al., 2024; Wu et al., 2025)), CogVideoX ((Yang et al., 2025)), LongCat-Video ((Meituan LongCat Team et al., 2025)), and Movie Gen ((Polyak et al., 2024)). These models generate a video by denoising the latent of the whole clip over tens of steps, and in every step each self-attention layer attends over all spatiotemporal tokens of the clip. Because of its quadratic cost and the large number of tokens, attention dominates the generation time. For example, an 81-frame 720p clip of Wan2.2 has 75,600 tokens. Generating it with TensorRT-LLM ((NVIDIA, 2023)) takes 302.7 s on GB300, and attention takes 67.6% of each step.

Modern GPUs support increasingly low-precision data formats on their tensor cores. Hopper introduced FP8 matrix multiply-accumulates (MMAs) ((Micikevicius et al., 2022)), and Blackwell and Rubin added MMAs in block-scaled FP4 formats such as NVFP4 ((Rouhani et al., 2023; NVIDIA et al., 2025)). On GB300 and VR200, the FP4 MMA run at two to three times the FP8 rate and six to nearly nine times the BF16 rate ((NVIDIA et al., 2025; NVIDIA, 2026)). Quantizing attention to these formats is thus a direct way to accelerate it, but the lower precision can compromise the accuracy.

Many recent methods study low-precision attention and achieve promising results ((Shah et al., 2024; Zhang et al., 2025d,b; Li et al., 2026; Zhang et al., 2026, 2025c)). However, existing kernels with a 4-bit QKQK have large errors in the attention output (Figure 1), which cause a non-negligible quality loss in the generated videos. This accuracy loss is the main

Figure 1. Accuracy and speed. Mean relative L2 error over all layers of Wan2.2 against the attention time of a Wan2.2 call on GB300. With a 4-bit QKQK, DeCo-Attention advances the Pareto frontier of accuracy and speed.

challenge of accelerating attention with the FP4 tensor cores. Our analysis shows that the loss comes from the exponential in softmax. The exponential turns the error that the rounding of QQ and KK causes in each score into a relative error of the attention weight, so this rounding error dominates the error of attention and of the generated video.

To address this challenge, we propose DeCo-Attention (Decompose to Compensate), a co-design of algorithm and system that decomposes the quantization error of QKQK and compensates its main part inside the FP4 QKQK product. Specifically, it decomposes this error with a per-head eigendecomposition of QQ and KK and keeps its components along the top rr eigenvectors. We show that most of this error comes from these few top directions. These compensation terms are appended to QQ and KK as extra channels, so the same FP4 MMA computes the scores together with their correction. To keep this lightweight, DeCo-Attention computes the eigenvectors from a random sample of 1/256 of the tokens and shares them between QQ and KK, so one eigendecomposition per head suffices and adds only a few percent to the attention time. The 4-bit QKQK is now accurate, but the softmax between the two MMAs becomes the kernel bottleneck. To turn the speed of FP4 into a kernel speedup, we propose I-ExpCast and adopt the row sum in the PVPV MMA (Dong et al., 2026) and the lazy rescale (Zadouri et al., 2026) to shorten the softmax.

We implement DeCo-Attention for GB300, VR200, and RTX PRO 6000, with PVPV in FP8 on the first two GPUs and in FP4 on the third, and evaluate it on four video generation models. With FP8 PVPV, DeCo-Attention is on par with FP8-QKQK methods in generation quality and narrows the gap to INT8-QKQK attention. With FP4 PVPV on RTX PRO 6000, it is more accurate than prior fully 4-bit kernels. On Wan2.2, the kernels of DeCo-Attention run 2.13×2.13\times, 2.49×2.49\times, and 2.82×2.82\times faster than the fastest BF16 kernel, and the end-to-end generation runs 1.55×1.55\times, 1.68×1.68\times, and 1.80×1.80\times faster. DeCo-Attention is the fastest of the compared attention kernels and gives the largest end-to-end speedup on every GPU.

In summary, this paper makes three contributions.

  • Accuracy. We analyze the quantization error of a 4-bit QKQK and propose DeCo-Attention, a training-free and calibration-free method that compensates this error directly inside attention. DeCo-Attention makes a 4-bit QKQK competitive with 8-bit QKQK methods.

  • Performance. We implement high-performance kernels for DeCo-Attention in CuTe DSL. The FP4 QKQK product exposes the softmax as the bottleneck of low-precision attention. Our kernels relieve this bottleneck and turn the speed of the FP4 QKQK into realized speedup.

  • Evaluation. A systematic evaluation on three GPU platforms, at the kernel level and end to end, validates the accuracy and the speedups of DeCo-Attention. We show that DeCo-Attention advances the Pareto frontier of accuracy and speed (Figure 1).

Related Work

Low-precision attention

Low-precision attention speeds up attention by computing its two matrix products with the 8-bit and 4-bit MMAs of the tensor cores. At 8 bits, FlashAttention-3 runs attention in FP8 with block scales and a Hadamard rotation (Shah et al., 2024), and SageAttention, SageAttention2, and VC-Attention smooth or center QQ and KK to keep the accuracy of an 8-bit or 4-bit QKQK (Zhang et al., 2025d,b; Li et al., 2026). With a 4-bit QKQK and an 8-bit PVPV, the NVFP4 kernels of TensorRT-LLM, cuDNN, and FlashInfer quantize QQ and KK with one scale per 16 elements (NVIDIA, 2023; Chetiur et al., 2014; Ye et al., 2025; NVIDIA et al., 2025), and Attn-QAT retrains the model for such a kernel (Zhang et al., 2026). Fully 4-bit kernels such as SageAttention3, PAROAttention, and HiFA4 also quantize PP and VV (Zhang et al., 2025c; Zhao et al., 2025; Dong et al., 2026), and ThriftAttention, DraftAttention2, and DMA mix two precisions across the score matrix (Sharratt, 2026; Ding et al., 2026a,b). These methods reduce the quantization error by smoothing, by Hadamard rotations (Shah et al., 2024; Yu et al., 2026), or by finer scales. However, a floating-point element keeps its relative rounding error at any scale, so the rounding error of QQ and KK stays in the scores and grows from FP8 to FP4. DeCo-Attention compensates this error inside the QKQK product.

Residual and low-rank compensation

Compensation recovers the accuracy lost in rounding by adding the main part of the residual back. Residual products refine FP16 matrix products on tensor cores (Markidis et al., 2018; Ootomo & Yokota, 2022). LoRC, LQER, QERA, and SVDQuant compensate the rounding error or the outliers of static weights offline with low-rank factors (Yao et al., 2024; Zhang et al., 2024, 2025a; Li et al., 2025). ResQ keeps the activations along principal directions of calibration data in 8 bits and the others in 4 bits (Saxena et al., 2025). AR-CQuant appends the residuals of outlier activation channels as extra channels of the same GEMM (Meng et al., 2026). MpFA restores the mean term of the centered QQ and KK of an NVFP4 QKQK in an additional BF16 MMA (Deng et al., 2026). These methods rely on calibration data, a static operand, or a second product, which normally costs more than an FP8 QKQK. DeCo-Attention compensates the rounding error of both QQ and KK along directions estimated at runtime for every head, in the same FP4 MMA as the scores.

Efficient attention

With low-precision matrix products, the softmax and the output rescale bound the attention kernel. FlashAttention-4 computes part of the exponentials on the fused multiply-add (FMA) units in parallel with the special-function unit (SFU), which still occupies the SFU and takes many instructions (Zadouri et al., 2026). Its lazy rescale moves the row base, which the online softmax keeps at the running maximum of a row (Dao et al., 2022; Milakov & Gimelshein, 2018), only when a tile exceeds it by more than a threshold. ExpCast of VC-Attention forms the FP8 code of a probability from its score with one FMA, because the bit pattern of a floating-point number read as an integer grows linearly with the logarithm of its value (Li et al., 2026; Schröndlp, 1999). Direct-P forms the E2M1 codes of an MXFP4 PP from a linear function of the score and a hardware conversion (Hu, 2026). HiFA4 appends a column of ones to VV, so that the PVPV product returns the row sum of PP (Dong et al., 2026). DeCo-Attention improves ExpCast and adopts the lazy rescale and the row sum in the PVPV MMA to build high-performance kernels.

DeCo-Attention

This section presents DeCo-Attention (Figure 2). We first show that the exponential in softmax amplifies the quantization error of QKQK. We then introduce principal residual compensation, which corrects the main part of this error in extra channels of QQ and KK. Finally, we describe the kernel optimizations that turn the speed of FP4 into realized speedup. The appendix gives the derivations and details.

Overview of DeCo-Attention

Figure 2. Overview of DeCo-Attention. (a) For every head, QQ and KK are rotated by a Hadamard matrix HH and quantized to NVFP4, leaving the residuals δQ\delta Q and δK\delta K. An eigendecomposition (EVD) of the Gram matrices of 1/256 of the tokens gives the 32 principal directions BB. The projections of the residuals and of the quantized operands onto BB are appended as NVFP4 compensation channels, so Q′Q' and K′K' have 192 channels. VV is smoothed by subtracting its block means Vˉ\bar{V} and quantized to V^\hat{V}. (b) Per tile, one NVFP4 MMA over Q′Q' and K′K' computes the compensated scores SS, I-ExpCast forms PP, and the PVPV MMA returns the output with the row sums ℓ\ell of PP through columns of ones appended to V^\hat{V}. The block means are added back, the softmax rescales lazily, and OO is finally divided by ℓ\ell.

Error of QK quantization

FP4 MMAs offer the highest throughput of the tensor cores on modern GPUs, but the existing kernels with a 4-bit QKQK lose accuracy. To locate the source of this loss, we quantize one product of attention at a time and report the relative L2 error (Higham, 2002) of the attention output against FP32 attention. On the hard layers1 of Wan2.2, quantizing only QQ and KK gives a larger mean error than quantizing only PP and VV in the same format, 20.14% against 1.90% in FP8 and 30.12% against 7.14% in NVFP4, and the order is the same over all layers (Figure 3a). We therefore focus on the error of QKQK quantization.

Figure 3. Quantization error and energy of K. (a) Relative L2 error on Wan2.2 with only QQ and KK or only PP and VV quantized (*, per-block scales of SageAttention). (b) Share of the energy of KK along rr directions over the heads of Wan2.2.

Low-precision attention methods usually quantize a high-precision tensor xx to a low-precision tensor x^=Q(x)\hat{x} = \mathcal{Q}(x) with a quantization function Q\mathcal{Q}, which leaves the residual δx=x−x^\delta x = x - \hat{x}. A query qq and a key kk, both row vectors, thus split into q=q^+δqq = \hat{q} + \delta q and k=k^+δkk = \hat{k} + \delta k, and their exact product decomposes as

q⋅k=q^⋅k^+δq⋅k^+q^⋅δk+δq⋅δk.(1)q \cdot k = \hat{q} \cdot\hat{k} + \delta q \cdot\hat{k} + \hat{q} \cdot\delta k + \delta q \cdot\delta k. \tag*{(1)}

Attention computes the score of qq and the key kjk_j of token jj as sj=q⋅kj/ds_j = q \cdot k_j/\sqrt{d}, where dd is the head dimension. A quantized kernel computes the score s^j\hat{s}_j from the first term of Eq. (1) alone, so the other three terms form the score error ej=s^j−sje_j = \hat{s}_j - s_j.

Softmax turns the scores into the attention weights p=softmax⁡(s)p = \operatorname{softmax}(s), and its exponential can amplify the score errors. The quantized kernel computes the weights p~\tilde{p} from the quantized scores s^j=sj+ej\hat{s}_j = s_j + e_j, so each weight is the exact weight pjp_j multiplied by exp⁡(ej)\exp(e_j) and renormalized,

p~j=exp⁡(s^j)∑lexp⁡(s^l)=pjexp⁡(ej)∑lplexp⁡(el)≈pj(1+ej−eˉ),(2)\tilde{p}_j = \frac{\exp(\hat{s}_j)}{\sum_l \exp(\hat{s}_l)} = \frac{p_j\exp(e_j)}{\sum_l p_l\exp(e_l)} \approx p_j(1 + e_j - \bar{e}), \tag*{(2)}

where eˉ=∑lplel\bar{e} = \sum_l p_l e_l is the PP-weighted mean of the score errors. For small errors, the relative change of each weight is close to its centered error ej−eˉe_j - \bar{e}, so the errors pass through softmax without amplification. With an NVFP4 QKQK, however, the centered errors can exceed 1.0, and the linear form of Eq. (2) no longer holds. The exponential then amplifies the errors instead of passing them on linearly, and most of the attention weight can move to a different key. This amplification explains why the attention output is more sensitive to the quantization of QKQK than to that of PVPV.

An NVFP4 QKQK produces such large score errors mainly because of the floating-point format itself. A floating-point format with tt mantissa bits rounds every element in its normal range with a relative error of up to 2−(t+1)2^{-(t+1)} regardless of its scale. This bound is 1/16 for FP8 and 1/4 for NVFP4. Common ways to reduce quantization error, such as finer scales, cannot avoid this error. In addition, QQ and KK often contain outliers with large values Jin et al. (2025), which, together with the exponential in softmax, further amplify these rounding errors. Figure 3a confirms the effect of the format. With the same per-block scales of SageAttention, the floating-point FP8 has a much larger error than the integer INT8 Chen et al. [3], 12.63% against about 1%. NVFP4 has the largest error although it has the finest scales. An accurate 4-bit QKQK therefore has to mitigate this error by other means.

Principal residual compensation

DeCo-Attention addresses the QKQK error numerically. Since the residuals δq\delta q and δk\delta k are known, the first-order terms δq⋅k^\delta q \cdot\hat{k} and q^⋅δk\hat{q} \cdot\delta k of Eq. (1) can be added back to the scores. We neglect the second-order term. Adding them exactly takes two more full-width products, more than an FP8 QKQK costs. We therefore propose principal residual compensation, which approximates each term over a few channels along the principal directions that hold most of its error, so that the QKQK MMA computes them with the scores.

Error along the principal directions. For one query, the QQ-side term of key jj is δq⋅k^j\delta q \cdot\hat{k}_j. Its sum of squares over all keys is a quadratic form with the Gram matrix GKG_K of the quantized keys K^\hat{K}. For every head, we decompose GKG_K into eigenvalues λ1≥⋯≥λd\lambda_1 \ge\cdots\ge\lambda_d and orthonormal column eigenvectors umu_m, which splits the sum of squares along the eigenvectors,

∑j(δq⋅k^j)2=δqGKδq⊤=∑m=1dλm(δqum)2,\sum_j(\delta q \cdot\hat{k}_j)^2 = \delta q G_K \delta q^\top= \sum_{m=1}^{d}\lambda_m(\delta q u_m)^2,
GK=K^⊤K^=∑m=1dλmumum⊤.(3)G_K = \hat{K}^{\top}\hat{K} = \sum_{m=1}^{d}\lambda_m u_m u_m^\top. \tag*{(3)}

We call λm=∑j(k^jum)2\lambda_m=\sum_j(\hat{k}_j u_m)^2 the energy of the keys along umu_m. DeCo-Attention rotates QQ and KK by a Hadamard matrix before the quantization, a rotation widely used for low-precision quantization [2] (Shah et al. 2024; Yu et al. 2026). In most cases the rotation lowers the rounding error of QQ and KK and the second-order term. It also spreads the outliers and their residual over all channels, so that δq\delta q has no preferred direction and (δqum)2(\delta q u_m)^2 is about the same along every umu_m. The rotation leaves the scores and the eigenvalues unchanged, so each term λm(δqum)2\lambda_m(\delta q u_m)^2 of Eq. (3) is then proportional to its eigenvalue λm\lambda_m. Without the rotation, the outliers hold most of the residual, and the eigenvalues no longer predict how much error the compensation along their eigenvectors removes.

Compensating the error along an eigenvector umu_m cancels the term λm(δqum)2\lambda_m(\delta q u_m)^2 of Eq. (3). Since these terms are proportional to the eigenvalues, compensating along the eigenvectors with the largest eigenvalues removes the most error. A few eigenvectors hold most of the energy of KK. On Wan2.2, the 32 leading eigenvectors of GKG_K hold a median of 74.3% of this energy over the heads, against 46.9% for the 32 channels of largest energy (Fig. 3b). Compensating along a small number rr of leading eigenvectors therefore recovers most of the error.

Decomposing the first-order terms. Let BK=[u1,…,ur]B_K = [u_1,\ldots,u_r] hold the rr leading eigenvectors of GKG_K. In the eigenbasis of GKG_K, the QQ-side term of key jj is a sum over dd directions, of which DeCo-Attention keeps the first rr,

δq⋅k^j=∑m=1d(δqum)(k^jum)≈(δqBK)⋅(k^jBK).(4)\delta q \cdot\hat{k}_j = \sum_{m=1}^{d}(\delta q u_m)(\hat{k}_j u_m) \approx(\delta q B_K)\cdot(\hat{k}_j B_K). \tag*{(4)}

The KK-side term q^⋅δkj\hat{q}\cdot\delta k_j splits in the same way along the rr leading eigenvectors BQB_Q of GQ=Q^⊤Q^G_Q=\hat{Q}^{\top}\hat{Q}.

Extended operands. Adding the kept parts of both first-order terms to q^⋅k^\hat{q}\cdot\hat{k} gives one dot product q⋅k≈q′⋅k′q\cdot k\approx q'\cdot k' of the extended operands

q′=[q^∣δqBK∣q^BQ],k′=[k^∣k^BK∣δkBQ].(5)q'=[\hat{q}\mid\delta q B_K\mid\hat{q} B_Q],\quad k'=[\hat{k}\mid\hat{k}B_K\mid\delta k B_Q]. \tag*{(5)}

The compensation channels are quantized to NVFP4 as well. As Figure 4 shows, one block-scaled NVFP4 MMA over the extended operands then computes the scores together with the first-order correction of both operands. On the hard layers of Wan2.2, the compensation lowers the error of the kernel from 18.70% to 2.80% (Tab. 4). It brings the centered score errors from 1.0 or more down to the range where softmax is approximately linear.

Principal residual compensation of QK

Figure 4. Principal residual compensation of QK. Extra channels for the QQ-side and the KK-side term let one NVFP4 MMA add both terms to the quantized score.

Efficient estimation. DeCo-Attention estimates the principal directions at runtime for every head, in a preparation step that we keep lightweight in three ways. First, the directions are estimated from a random sample SS of N/256N/256 of the NN tokens. Second, QQ and KK share one basis. Both are linear projections of the same activations, and we find that their leading eigenvectors span largely the same subspace. On Wan2.2, the two subspaces overlap by 0.75 (against 0.25 for two unrelated subspaces). We add the two Gram matrices of the sample, each divided by its trace so that QQ and KK weigh equally,

G=KS⊤KStr⁡(KS⊤KS)+QS⊤QStr⁡(QS⊤QS),B∈Rd×r,(6)G = \frac{K_{\mathcal{S}}^{\top}K_{\mathcal{S}}}{\operatorname{tr}(K_{\mathcal{S}}^{\top}K_{\mathcal{S}})} + \frac{Q_{\mathcal{S}}^{\top}Q_{\mathcal{S}}}{\operatorname{tr}(Q_{\mathcal{S}}^{\top}Q_{\mathcal{S}})}, \qquad B \in\mathbb{R}^{d \times r}, \tag*{(6)}

and take the rr leading eigenvectors of GG as the basis BB in place of both BKB_K and BQB_Q in Eq. (5). The shared basis holds 69.0% of the energy of KK, against 74.3% for BKB_K (Figure 3b), and takes only one eigendecomposition per head. Third, the preparation runs as a fast chain of fused kernels. A GPU eigensolver finds the bases of all heads, and one fused pass over QQ and KK rotates, quantizes, and projects every token. These passes are linear in the sequence length, whereas attention is quadratic, and the whole preparation adds only 2.7 to 3.6% to the attention time.

Kernel implementation and optimizations

We implement the kernels of DeCo-Attention in CuTe DSL for GB300, VR200, and RTX PRO 6000. On the datacenter GPUs, the softmax between the two low-precision MMAs bounds the kernel and hides their speed advantage (Li et al., 2026; Zadouri et al., 2026). We propose I-ExpCast, which forms PP with fewer instructions and without the SFU. We also adapt the lazy rescale and the row sum in the PVPV MMA to our kernels.

Within the softmax, the exponential is the bottleneck, since it runs on the SFU and handles far fewer scores per cycle than the MMAs (Zadouri et al., 2026). FlashAttention-4 emulates part of the exponentials on the FMA units, which takes many more instructions than the SFU and lengthens the kernel on GB300 and VR200. ExpCast (Li et al., 2026) and Direct-P (Hu, 2026) bypass the SFU and form the codes of PP from a linear function of the score, ExpCast in E4M3 and Direct-P in E2M1. However, neither method rounds to the nearest code, and neither covers the subnormal codes.

I-ExpCast, our improved ExpCast, forms the probability in FP16 and leaves the rounding to a hardware conversion. FP16 has ten mantissa bits and represents every value of E4M3 and E2M1 exactly, so the conversion rounds to the nearest code of either format, subnormal codes included. Let xx be the base-2 logarithm of a scaled probability, a linear function of its score sjs_j. Read as an integer, the FP16 bit pattern of 2x2^x is close to xx plus the exponent bias 15, scaled by 2102^{10} for the ten mantissa bits,

bits⁡FP16(2x)≈1024(x+15).(7)\operatorname{bits}_{\mathrm{FP16}}(2^x) \approx1024(x+15). \tag*{(7)}

I-ExpCast evaluates this linear function in the subnormal range of FP32, whose values are evenly spaced multiples of 2−1492^{-149} with the multiple as their bit pattern. One FMA therefore maps the score to this pattern and rounds the result to an integer. Three instructions per pair of scores form the codes,

p^j=Q(sat⁡16(bits⁡FP32(asj+c))),(8)\hat{p}_j = Q\left(\operatorname{sat}_{16}\left(\operatorname{bits}_{\mathrm{FP32}}(a s_j+c)\right)\right), \tag*{(8)}

where asj+c=2−149⋅1024(x+15)a s_j+c=2^{-149}\cdot1024(x+15), the saturating pack sat⁡16\operatorname{sat}_{16} shows the pattern on the 16 bits of FP16, and QQ converts it to E4M3 or E2M1. I-ExpCast thus stays close to the exponential followed by rounding, whereas ExpCast and Direct-P do not (Figure 5).

Figure 5. Accuracy of I-ExpCast. Decoded value of PP over its exact value, per way of forming the E4M3 codes (a) and the E2M1 codes (b).

We further adapt two existing techniques to these kernels. The lazy rescale moves the row base only when a tile exceeds it by more than a factor of 2T2^T. At T=8T=8, as in FlashAttention-4, probabilities below 2−92^{-9} of the row base round to zero, whereas T=4T=4 keeps the row down to 2−132^{-13} and still skips most rescales. At this threshold, more of the small probabilities fall into the subnormal range of E4M3, which I-ExpCast still rounds to the nearest code. With I-ExpCast, the two optimizations can therefore be combined. With only PP rounded at T=4T=4, the mean error over all layers of Wan2.2 is 0.93% with I-ExpCast, against 3.26% with ExpCast, and at T=8T=8 it rises to 2.72% (Table 1). An NVFP4 PP is much less sensitive to TT, since each block of 16 keys carries its own scale. DeCo-Attention uses T=4T=4 with both formats. A column of ones appended to VV lets the PVPV MMA also return the row sum of PP (Dong et al., 2026).

PPCodes fromInstr.T=0T=0 HardT=0T=0 AllT=4T=4 HardT=4T=4 AllT=8T=8 HardT=8T=8 All
E4M3exp2 and rounding80.280.400.430.881.072.72
E4M3ExpCast70.441.021.413.264.378.88
E4M3I-ExpCast60.500.680.540.931.112.72
E2M1exp2 and rounding81.562.011.592.091.692.64
E2M1Direct-P44.115.064.115.064.115.06
E2M1I-ExpCast61.511.821.541.901.632.45

Table 1. Rounding error of P under the lazy rescale. Relative L2 error (%) on Wan2.2 with only PP rounded, per threshold TT of the lazy rescale. Instr. counts the instructions per four scores.

We also implement V smoothing (Li et al., 2026). An extra high-precision MMA adds the block means of VV back and keeps the output unbiased. More analysis is in the appendix.

Evaluation

Evaluation

Setup

Models. We evaluate DeCo-Attention on four video models, Wan2.2-T2V-A14B (Team Wan et al. (2025)) at 720p, LongCat-Video (Meituan LongCat Team et al. (2025)) at 480p, HunyuanVideo-1.5 (Wu et al. (2025)) at 720p, and MiniMax-H3 (MiniMax (2026)) at 1344 × 768 with audio. For a fair comparison with the other methods, MiniMax-H3 runs with the 8-step LoRA of MiniMax-H3-Acc-LoRAs (Alibaba PAI [1]).

Baselines and metrics. We compare DeCo-Attention with three groups of methods, each in its fastest kernel. The baseline is BF16 attention. The state-of-the-art methods are VC-Attention (Li et al. (2026)) and SageAttention2 (Zhang et al. (2025b)) at 8 bits, VC-Attention and SageAttention3 (Zhang et al. (2025a)) at 4 bits, and the kernel of Attn-QAT (Zhang et al. (2026)) with a 4-bit QKQK and an 8-bit PVPV (without retraining the model). The third group holds the uncompensated formats: QK16PV8 with a 16-bit QKQK and an 8-bit PVPV, per-tensor FP8, MXFP8, NVFP4 QKQK with FP8 PVPV, and NVFP4. End to end, we measure the PSNR (Huynh-Thu & Ghanbari (2008)) SSIM (Wang et al. (2004)), and LPIPS (Zhang et al. (2018)) of each video against the BF16 video of the same prompt and seed on 100 prompts of MovieGen Bench (Polyak et al. (2024)), and the speedup in TensorRT-LLM VisualGen on seven of these prompts. At the kernel level, we measure the relative L2 error (Higham (2002)) of the attention output against FP32 attention and the attention time.

Implementations. DeCo-Attention uses r=32r = 32 directions per side as a trade-off between accuracy and performance. By default, it runs FP8 PVPV on GB300 and VR200 and NVFP4 PVPV on RTX PRO 6000. Following VC-Attention (Li et al. (2026)), we smooth VV in both configurations by subtracting its mean over each block of keys before quantizing it. The appendix gives further details and results.

Accuracy

End-to-end quality. DeCo-Attention reaches the generation quality of FP8-QKQK methods and narrows the gap of a 4-bit QKQK to INT8-QKQK attention (Table 2). On every model, it is more accurate than per-tensor FP8, MXFP8, and SageAttention2 with FP8 QKQK. Compared with VC-Attention with FP8 QKQK, the most accurate FP8-QKQK method, DeCo-Attention is more accurate on Wan2.2 and LongCat-Video and less on the other two models. The INT8-QKQK methods, which VC-Attention reports on B200, remain more accurate. The uncompensated 4-bit QKQK is 5 to 6 dB in PSNR behind VC-Attention with INT8 QKQK, while DeCo-Attention is 1 to 3 dB behind. Its frames are also closer to those of BF16 attention than those of the uncompensated kernel (Figure 6).

MethodQK/PVWan2.2 PSNR↑Wan2.2 SSIM↑Wan2.2 LPIPS↓LongCat-Video PSNR↑LongCat-Video SSIM↑LongCat-Video LPIPS↓HunyuanVideo-1.5 PSNR↑HunyuanVideo-1.5 SSIM↑HunyuanVideo-1.5 LPIPS↓MiniMax-H3 PSNR↑MiniMax-H3 SSIM↑MiniMax-H3 LPIPS↓
BF1616/1624.540.8500.11230.090.9290.03818.980.7090.24121.400.7520.186
QK16PV816/820.660.7480.19723.500.8170.10716.040.6010.35220.190.7170.217
Per-tensor FP817.950.6580.28320.520.7280.16414.890.5480.41017.130.6010.356
MXFP818.010.6620.27820.500.7320.16314.060.5210.45116.850.5900.365
SageAttention2†8/820.30.7300.20623.10.7930.12215.60.5810.38219.90.7230.252
w/ FP8 QK17.450.6460.29320.810.7420.15814.740.5510.41116.980.6000.355
VC-Attention†20.50.7440.19123.80.8070.10917.50.6480.30120.20.7260.248
w/ FP8 QK18.530.6900.25022.230.7850.12816.110.6080.34217.700.6330.310
NVFP4 QK, FP8 PV15.340.5530.41717.850.6300.25811.890.4300.58114.470.5100.484
Attn-QAT4/815.330.5560.42016.850.5490.37310.150.3600.67215.160.5370.452
DeCo-Attention (Ours)19.420.7230.21622.530.8000.11515.970.5950.35617.220.6180.329
NVFP412.400.4530.54513.120.4500.4468.060.2600.77713.840.5060.501
SageAttention3†4/413.90.5100.46615.10.5260.38210.90.3910.65216.10.5870.408
VC-Attention, 4-bit†16.80.6140.31818.70.6630.22613.80.4860.48116.60.6050.380
DeCo-Attention (Ours)17.360.6440.29221.160.7560.14514.950.5550.39916.730.5980.352

Table 2. End-to-end quality on four video models against BF16 attention. Blue cells mark the best PSNR, SSIM, and LPIPS within each group with a 4-bit QKQK. SageAttention2 and VC-Attention use their default INT8 QKQK on B200, and their rows w/ FP8 QKQK run on GB300. †Means reported by VC-Attention. With FP8 PVPV, DeCo-Attention reaches the generation quality of FP8-QKQK methods.

Wan2.2 videos with an NVFP4 QK

Figure 6. Wan2.2 videos with an NVFP4 QK. Frame 40 of 81 for the two prompts whose LPIPS under both kernels is closest to the median over 100 prompts. With DeCo-Attention, the frames follow those of BF16 attention and retain visual fidelity.

With NVFP4 PVPV, DeCo-Attention has better PSNR and LPIPS than SageAttention3 and 4-bit VC-Attention on every model, and better SSIM except against 4-bit VC-Attention on MiniMax-H3. On Wan2.2, its PSNR is 17.36 dB, against 13.9 dB for SageAttention3 and 16.8 dB for 4-bit VC-Attention. The fully 4-bit DeCo-Attention matches SageAttention2 with FP8 QKQK on every model and is within about 1 dB of VC-Attention with FP8 QKQK.

The fidelity metrics also capture the drift of the sampling trajectory, which exists even between BF16 kernels. The BF16 row is the BF16 attention of cuDNN, which reaches 24.54 dB on Wan2.2. DeCo-Attention is 3 to 8 dB below this row and within 3 dB of QK16PV8.

Kernel-level accuracy. We evaluate the kernels on attention calls captured from Wan2.2 and MiniMax-H3 in the hard layers and in every layer. Table 3 shows that DeCo-Attention reaches the accuracy of FP8-QKQK kernels. On the hard layers of both models, it has the lowest error of all kernels with an FP8 or 4-bit QKQK. On Wan2.2, it reaches 2.80%, against 3.67% for VC-Attention with FP8 QKQK and 30.56% for the uncompensated kernel. Over all layers, its error lies between those of VC-Attention and SageAttention2 with FP8 QKQK on both models, 3.73% on Wan2.2 against 2.64% and 4.10%. With NVFP4 PVPV, DeCo-Attention has the lowest error of the fully 4-bit kernels. On the hard layers of Wan2.2, its 5.68% is about a quarter of the 21.86% of SageAttention3 and the 21.06% of 4-bit VC-Attention. It is also below the 13.03% of SageAttention2 with FP8 QKQK. Over all layers, its 5.09% is above the 4.10% of SageAttention2 and the 2.64% of VC-Attention with FP8 QKQK.

MethodQK/PVWan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
BF1616/160.150.170.170.17
SageAttention2, FP8 QK8/813.034.1021.234.55
VC-Attention, FP8 QK3.672.646.652.85
NVFP4 QK, FP8 PV30.5610.5728.9210.69
Attn-QAT30.1910.6028.2511.10
DeCo-Attention (Ours)4/82.803.736.324.40
SageAttention321.869.1924.078.96
VC-Attention, 4-bit4/421.068.5223.468.05
DeCo-Attention (Ours)5.685.098.245.67

Table 3. Kernel-level accuracy. Relative L2 error (%) of the attention output. Blue marks the lowest error per 4-bit-QKQK group.

Performance

Figure 7 shows that DeCo-Attention is the fastest of the compared attention kernels and gives the largest end-to-end speedup on every GPU. On Wan2.2, its kernel runs 2.13×, 2.49×, and 2.82× faster than BF16 attention on GB300, VR200, and RTX PRO 6000, excluding the preparation step of § 3.2, and the whole generation runs 1.55×, 1.68×, and 1.80× faster. On GB300 and VR200, DeCo-Attention is 1.44× and 1.65× faster than VC-Attention, the fastest prior method, at the kernel level and 1.22× and 1.32× faster end to end. On RTX PRO 6000, where SageAttention3 is the fastest prior method, DeCo-Attention is 1.08× faster at the kernel level and 1.09× faster end to end. On MiniMax-H3, the speedups are similar, 2.25× to 2.86× at the kernel level and 1.54× to 1.78× end to end.

Figure 7. Kernel-level and end-to-end speedup. (a) Speedup of the attention kernel over the fastest BF16 kernel. (b) Speedup of the whole generation in TensorRT-LLM VisualGen over BF16 attention. The SageAttention and VC-Attention bars show their FP8-QKQK kernels on GB300 and VR200 and their 4-bit kernels on RTX PRO 6000.

Ablations

Accuracy. Table 4 ablates the two terms of the compensation in an emulation of the GB300 kernel. The baseline without both terms keeps the Hadamard rotation and the smoothing of VV. The two terms together reduce the mean error on the hard layers from 18.70% to 2.80% on Wan2.2 and from 29.40% to 6.31% on MiniMax-H3. Most of this reduction comes from the KK-side term, without which the error on Wan2.2 rises to 18.35%. The QQ-side term has a smaller effect and still reduces the error from 3.97% to 2.80% on Wan2.2 and from 7.30% to 6.31% on MiniMax-H3.

Q-side termK-side termWan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
✓✓2.803.736.314.40
✓3.974.967.305.71
✓18.357.2729.119.22
18.708.1029.4010.00

Table 4. Accuracy ablation. Relative L2 error (%) of DeCo-Attention with FP8 PVPV without the QQ-side term, the KK-side term, or both, in emulation.

Performance. Table 5 adds the optimizations of § 3.3 one at a time to our GB300 kernel and compares it with an

KernelTime (ms)SpeedupSM clock (MHz)Error (%)
BF16 attention124.31.00×15370.15
NVFP4 QK, FP8 PV83.81.48×207030.56
Our kernel, compensation only79.01.57×20172.92
+ I-ExpCast62.22.00×17772.94
+ Row sum in the PV MMA57.32.17×16122.94
+ Lazy rescale, T=4T = 455.82.23×15372.95
+ Smoothing of V58.02.14×15822.80
FP8-QK reference82.11.51×19123.70
+ All four above68.21.82×15373.60

Table 5. Performance ablation. The optimizations of § 3.3 added one at a time to the DeCo-Attention FP8-PVPV kernel on GB300, with the time of a Wan2.2 call, the SM clock under the power limit, and the error on the hard layers. The reference rows use an uncompensated FP8 QKQK with one scale per tensor.

FP8-QKQK reference, the same kernel with an uncompensated FP8 QKQK. Without the optimizations, the softmax bounds the kernel and hides the gain of the 4-bit QKQK. Our kernel takes 79.0 ms, only slightly below the 83.8 ms of the NVFP4 QKQK with FP8 PVPV kernel of TensorRT-LLM and the 82.1 ms of the reference. I-ExpCast shortens the kernel to 62.2 ms. The row sum in the PVPV MMA and the lazy rescale shorten it to 55.8 ms, where the MMAs nearly bound the kernel. With the smoothing of VV, the complete kernel takes 58.0 ms, 1.36× faster than without the optimizations and 2.14× faster than BF16 attention. It does more work per cycle and draws more power, which lowers the SM clock under the power limit from 2017 to 1582 MHz and offsets part of the gain. At a fixed clock, the same changes give 1.67× instead of 1.36×. The same optimizations speed up the FP8-QKQK reference by only 1.20×, since its slower FP8 MMAs then bound the kernel. As a result, DeCo-Attention is 1.17× faster than the FP8-QKQK reference, and achieves better accuracy on the hard layers, 2.80% against 3.60%. The speedup of DeCo-Attention thus comes from the 4-bit QKQK MMA and the softmax optimizations together.

Conclusion

We presented DeCo-Attention, a co-design of algorithm and system for low-precision attention. We showed that the rounding error of a 4-bit QKQK lies mostly along a few principal directions, which DeCo-Attention compensates inside the matrix product that computes the scores. Softmax optimizations then turn the speed of the FP4 products into kernel speedup. On four video models, DeCo-Attention with FP8 PVPV competes with the generation quality of FP8-QKQK methods, its fully 4-bit kernel is more accurate than prior 4-bit kernels, and it is the fastest of the compared kernels on GB300, VR200, and RTX PRO 6000. DeCo-Attention thereby advances the Pareto frontier of accuracy and speed.

DeCo-Attention has limitations that we plan to address. Our kernels target video diffusion models, and LLM inference with KV cache cannot yet use them directly. The runtime estimation of the principal directions adds a small overhead to each call, which matters in low-latency scenarios. Over all layers, the error of DeCo-Attention is not yet below that of the most accurate FP8-QKQK kernel. The kernel code will be released publicly.

Error of QK Quantization

This appendix supplements § 3.1 with the bound on the score error of a floating-point QKQK (Sec. A.1) and the propagation of the score errors through softmax to the output (Sec. A.2).

Notation. A query qq and the keys kjk_j are row vectors of dd channels, the inputs of the attention. A quantized kernel rounds them to the low-precision format, q^=Q(q)\hat{q} = Q(q) and k^j=Q(kj)\hat{k}_j = Q(k_j), which leaves the residuals δq=q−q^\delta q = q - \hat{q} and δkj=kj−k^j\delta k_j = k_j - \hat{k}_j, and computes the score s^j=q^Tk^j/d\hat{s}_j = \hat{q}^{\mathsf{T}}\hat{k}_j / \sqrt{d} in place of the exact score sj=qTkj/ds_j = q^{\mathsf{T}}k_j / \sqrt{d}. The exact attention weights are pj=exp⁡(sj)/∑lexp⁡(sl)p_j = \exp(s_j) / \sum_l \exp(s_l), and p^j\hat{p}_j are the weights of the quantized scores. The captures, the hard layers, and the error metric are those described in Sec. E.1.

Score error of a floating-point QK

A floating-point format rounds with a relative error that a scale does not lower, and the score errors of an NVFP4 QKQK can exceed 1.0, beyond which the exponential of softmax amplifies them (§ 3.1). We derive the rounding bound behind the first statement and the bound on the score error behind the second.

Rounding of one element. An integer format and a floating-point format space their codes differently. INT8 gives a group of elements one scale, which maps the largest magnitude aa of the group to the largest code 127. The codes are then a/127a/127 apart for every element of the group, with a rounding error of at most half of this spacing. A floating-point format with tt mantissa bits places 2t2^t codes in every binade [2ℓ,2ℓ+1)[2^\ell,2^{\ell+1}). The codes of this binade are 2ℓ−t2^{\ell-t} apart. Since an element xx of the binade has ∣x∣≥2ℓ|x| \ge2^\ell, this spacing is at most 2−t∣x∣2^{-t}|x|, with a rounding error of at most half of it. The rounding errors of the two formats are thus bounded by

∣δx∣≤a254(INT8),|\delta x| \le\frac{a}{254} \quad\text{(INT8)},
∣δx∣≤2−(t+1)∣x∣(floating point).(9)|\delta x| \le2^{-(t+1)}|x| \quad\text{(floating point)}. \tag*{(9)}

The INT8 bound is absolute and follows the largest element of the group. The floating-point bound is relative to the element itself, 1/16 for E4M3 and 1/4 for E2M1. A scale multiplies an element before the rounding and divides it afterwards. For INT8, a scale fitted to a smaller group lowers aa and thus the error of every element of the group. For a floating-point format, a scale does not lower the error. The scaled element is rounded with the same relative error, and dividing by the scale afterwards leaves this relative error unchanged. The relative bound therefore holds for any scale that keeps the element in its normal range. With the same per-block scales, E4M3 errs by up to ∣x∣/16|x|/16 against a/254a/254 for INT8, which is larger for every element above about a/16a/16. FP8 therefore has a much larger error than INT8 in Figure 3a.

Score error. The score error consists of the three terms of the decomposition of the exact product that a quantized kernel leaves out (§ 3.1, Eq. (1)),

ej=s^j−sj=−δq⋅k^j+q^⋅δkj+δq⋅δkjd(10)e_j = \hat{s}_j - s_j = -\frac{\delta q \cdot\hat{k}_j + \hat{q} \cdot\delta k_j + \delta q \cdot\delta k_j}{\sqrt{d}} \tag*{(10)}

Each first-order term sums a residual times an element of the other operand over the dd channels. The triangle inequality and the floating-point bound on every residual, ∣δqc∣≤2−(t+1)∣qc∣|\delta q_c| \le2^{-(t+1)}|q_c|, bound the QQ-side term by

∣δq⋅k^j∣=∣∑c=1dδqck^jc∣≤∑c=1d∣δqc∣∣k^jc∣\left|\delta q \cdot\hat{k}_j\right| = \left|\sum_{c=1}^{d} \delta q_c \hat{k}_{jc}\right| \le\sum_{c=1}^{d} |\delta q_c| |\hat{k}_{jc}|
≤2−(t+1)∑c=1d∣qc∣∣k^jc∣≈2−(t+1)∑c=1d∣qckjc∣.(11)\le2^{-(t+1)} \sum_{c=1}^{d} |q_c| |\hat{k}_{jc}| \approx2^{-(t+1)} \sum_{c=1}^{d} |q_c k_{jc}|. \tag*{(11)}

where the last step replaces the quantized element k^jc\hat{k}_{jc} by the exact one, which holds to first order. The KK-side term has the same bound with the roles of qq and kjk_j exchanged. Adding the two bounds and dividing by d\sqrt{d} as in Eq. (10) bounds the score error by

∣ej∣≲2⋅2−(t+1)d∑c=1d∣qckjc∣.(12)|e_j| \lesssim\frac{2 \cdot2^{-(t+1)}}{\sqrt{d}} \sum_{c=1}^{d} |q_c k_{jc}|. \tag*{(12)}

The prefactor 2⋅2−(t+1)=2−t2 \cdot2^{-(t+1)} = 2^{-t} is 1/8 in E4M3 and 1/2 in E2M1. It multiplies the summed magnitudes of the channel products over d\sqrt{d}, which is the scaling of the score itself. The bound follows the magnitudes of the channel products and not the score, since large products of opposite signs cancel in the score while their residuals remain. Some heads hold large values in a few channels of QQ and KK, the outliers of § 3.1. There the summed magnitudes of the channel products are large, and the score error can exceed 1.0 in magnitude (Table 6).

CompensationWan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
Keys with ∣ej−eˉ∣>1.0|e_j-\bar{e}|>1.0 (%)×\times7.41.3174.8
✓\checkmark2.10.195.00.32
Attention weight of these keys (%)×\times0.670.0957.11.4
✓\checkmark0.0170.00120.230.015
Error of Eq. (17), median head (%)×\times5.910.528.518.8
✓\checkmark3.05.710.99.4
Error of Eq. (17), pooled (%)×\times93.568.497.983.9
✓\checkmark17.18.756.728.7

Table 6. Error of the first-order approximation. Rotated NVFP4 QKQK without (×\times) and with (✓\checkmark) the compensation of DeCo-Attention, PP and VV exact, on the hard and on all layers of Wan2.2 and MiniMax-H3. The compensation lowers all three quantities.

Propagation through softmax

We derive how the score errors change the attention weights and the output (Eq. (2)). A quantized kernel applies softmax to the scores sj+ejs_j + e_j in place of sjs_j. With pj=exp⁡(sj)/∑lexp⁡(sl)p_j = \exp(s_j)/\sum_l \exp(s_l), its weights are

p~j=exp⁡(sj+ej)∑lexp⁡(sl+el)=pjexp⁡(ej)∑lplexp⁡(el).(13)\tilde{p}_j = \frac{\exp(s_j+e_j)}{\sum_l \exp(s_l+e_l)} = \frac{p_j \exp(e_j)}{\sum_l p_l \exp(e_l)}. \tag*{(13)}

Softmax is invariant to a shift common to all scores. An error common to all keys of a query therefore does not change the weights, and only the differences between the errors of the keys matter, which the ratio of two weights shows directly,

p~jp~j′=pjpj′exp⁡(ej−ej′).(14)\frac{\tilde{p}_j}{\tilde{p}_{j'}} = \frac{p_j}{p_{j'}} \exp(e_j-e_{j'}). \tag*{(14)}

We subtract the PP-weighted mean error of the query, eˉ=∑lplel\bar{e} = \sum_l p_l e_l, and call ej−eˉe_j - \bar{e} the centered error of key jj. The weights depend on the centered errors alone, p~j=pjexp⁡(ej−eˉ)/∑lplexp⁡(el−eˉ)\tilde{p}_j = p_j \exp(e_j-\bar{e})/\sum_l p_l \exp(e_l-\bar{e}).

We next linearize the weights in the centered errors. This first-order form relates the output error linearly to the score errors, which is what lets § 3 measure the score error by its energy and compensate it term by term. For centered errors well below 1.0, exp⁡(ej−eˉ)≈1+ej−eˉ\exp(e_j-\bar{e}) \approx1+e_j-\bar{e}. The denominator is then ∑lpl(1+el−eˉ)=∑lpl+∑lplel−eˉ∑lpl=1+eˉ−eˉ=1\sum_l p_l(1+e_l-\bar{e}) = \sum_l p_l + \sum_l p_l e_l - \bar{e}\sum_l p_l = 1+\bar{e}-\bar{e}=1, using ∑lpl=1\sum_l p_l=1 and the definition of eˉ\bar{e}. The weights become

p~j≈pj(1+ej−eˉ),(15)\tilde{p}_j \approx p_j(1+e_j-\bar{e}), \tag*{(15)}

which is Eq. (2). Each weight changes by its centered error as a relative amount, and the changes δpj=p~j−pj≈pj(ej−eˉ)\delta p_j = \tilde{p}_j-p_j \approx p_j(e_j-\bar{e}) sum to zero, as the normalization of softmax requires. The first-order approximation of Eq. (15) holds while the centered errors stay below 1.0. Beyond that, the exponential of Eq. (14) grows faster than the linear term, and the weights move by more than the first-order approximation predicts.

Let vjv_j be the value of token jj and o=∑jpjvjo=\sum_j p_jv_j the attention output. With PP and VV exact, the quantized scores change the output by δoQK=∑jδpjvj\delta o_{QK}=\sum_j\delta p_jv_j. Inserting δpj≈pj(ej−eˉ)\delta p_j\approx p_j(e_j-\bar e) gives its first-order approximation,

δoQK(1)=∑jpj(ej−eˉ)vj.(16)\delta o_{QK}^{(1)}=\sum_j p_j(e_j-\bar e)v_j. \tag*{(16)}

To first order, the output error is thus linear in the centered score errors. The next paragraph measures the error of this approximation on the captures.

Error of the first-order approximation. The error of the approximation is the norm of the difference between δoQK\delta o_{QK} and its first-order approximation, relative to the norm of δoQK\delta o_{QK},

∥δoQK−δoQK(1)∥∥δoQK∥,(17)\frac{\lVert\delta o_{QK}-\delta o_{QK}^{(1)}\rVert}{\lVert\delta o_{QK}\rVert}, \tag*{(17)}

with the norms taken over the queries of a head, or over those of all heads for the pooled value. Table 6 has four rows. The first two give the share of the keys outside the linear range, which are the keys with ∣ej−eˉ∣>1.0|e_j-\bar e|>1.0, and the attention weight that these keys hold. The last two give the error of the approximation for the median head and pooled over the heads. Over the four columns of Table 6, the NVFP4 QKQK without compensation puts at most 7.1% of the attention weight on these keys, yet the error of the approximation is 5.9 to 28.5% of the output error of the median head and 68.4 to 97.9% of the pooled output error. The output error thus comes from a minority of heads that leave the linear range. With the compensation, these keys carry at most 0.23% of the weight, and the error of the approximation is 3.0 to 10.9% of the output error of the median head and 8.7 to 56.7% of the pooled output error. The compensation thus brings the output error back toward the linear range, as stated in § 3.2.

Weight changes of one query. Figure 8 shows how the weights of the 16 leading keys of one query change with their centered score errors, for a hard layer of Wan2.2 under the NVFP4 QKQK without compensation and with the compensated QKQK of DeCo-Attention (Sec. E.1). The dashed line is the first-order approximation of Eq. (15), on which a centered error of 0.5 raises the weight of its key by 50%. With the compensated QKQK, the centered errors stay within about a third, which keeps every key on the line, and the two leading keys change their weights by about 11% and 6%. Without compensation, the centered errors reach beyond 1.0, where the exponential of Eq. (14) grows much faster than the line. The two leading keys swap their order. The top-1 key has a centered error of about −3/4-3/4, which lowers its weight by about 60%, and the top-2 key has a centered error of about +3/4+3/4, which raises its weight by about 70%. The largest weight now lies on a different key, whose value dominates the output. A score error below one unit thus produces a large output error, which is the amplification described in § 3.1.

Figure 8. Weight changes of one query. Relative weight change of the 16 leading keys of one query of a hard layer of Wan2.2 against their centered score errors, without and with the compensation of DeCo-Attention. Marker area is the exact weight. The dashed line is the first-order approximation of Eq. (15). The compensated keys lie on the line, and without compensation the two leading keys swap their order.

Principal Residual Compensation

This appendix supplements § 3.2. We analyze the energy of the first-order terms and the share that the compensation leaves, with the Hadamard rotation as the step that lets the eigenvalues measure this energy (Sec. B.1), split the error of the compensated QKQK into its sources and show how the rotation and the compensation add up (Sec. B.2), vary the rank (Sec. B.3), and give the preparation step by step with its shared basis and its token sample (Sec. B.4).

Energy of the first-order terms

DeCo-Attention reduces the error of a low-precision QKQK numerically. It compensates the first-order terms of Eq. (1) along the rr leading eigenvectors of GK=K^TK^G_K=\hat K^{\mathsf T}\hat K for the QQ-side term and of GQ=Q^TQ^G_Q=\hat Q^{\mathsf T}\hat Q for the KK-side term (§ 3.2). Equation (3) measures the QQ-side term by its energy, its sum of squares over all keys, and splits this energy into one term per eigenvector of GKG_K. We show which part of each term the compensation leaves, and that the eigenvalues predict it once the rotation has spread the residual evenly.

The KK-side term q^⋅δkj\hat{q}\cdot\delta k_j has the same form with the operands exchanged. For one key, its energy over all queries is

∑i(q^i⋅δkj)2=δkjGQδkjT=∑m=1dμm(δkjwm)2,(18)\sum_i (\hat{q}_i\cdot\delta k_j)^2=\delta k_j G_Q\delta k_j^{\mathsf{T}}=\sum_{m=1}^{d}\mu_m(\delta k_j w_m)^2, \tag*{(18)}
GQ=Q^TQ^=∑mμmwmwmT,G_Q=\hat{Q}^{\mathsf{T}}\hat{Q}=\sum_m\mu_m w_m w_m^{\mathsf{T}},

where μm\mu_m and wmw_m are the eigenvalues and eigenvectors of GQG_Q.

The compensation covers the rr leading eigenvectors, so the terms beyond the rr-th remain. Summed over the queries ii of a head, the share of the energy of the QQ-side term that remains is

η(r)=∑i∑m>rλm(δqium)2∑i∑mλm(δqium)2,(19)\eta(r)=\frac{\sum_i\sum_{m>r}\lambda_m(\delta q_i u_m)^2}{\sum_i\sum_m\lambda_m(\delta q_i u_m)^2}, \tag*{(19)}

and that of the KK-side term has μm\mu_m, wmw_m and the sum over the keys. For a basis other than these eigenvectors, η(r)\eta(r) is the energy of the part of the term outside the rr directions of the basis over the energy of the term.

Direction of the residual. By Eq. (3), the error energy along an eigenvector umu_m is λm(δq um)2\lambda_m(\delta q\,u_m)^2. The eigenvalues alone predict this energy only if the residual is spread evenly over the eigenvectors. The eigenvectors u1,…,udu_1,\ldots,u_d are orthonormal and span all dd channels, so ∑mumumT=I\sum_m u_m u_m^{\mathsf{T}}=I, and the squared components of the residual along them add up to its energy,

∑m(δq um)2=∑mδq umumTδqT=δq(∑mumumT)δqT=∥δq∥2.(20)\begin{aligned} \sum_m(\delta q\,u_m)^2=\sum_m\delta q\,u_m u_m^{\mathsf{T}}\delta q^{\mathsf{T}} \\ &=\delta q\left(\sum_m u_m u_m^{\mathsf{T}}\right)\delta q^{\mathsf{T}}=\lVert\delta q\rVert^2. \tag*{(20)} \end{aligned}

If the residual is spread evenly over the eigenvectors, every component holds the same share, (δq um)2=∥δq∥2/d(\delta q\,u_m)^2=\lVert\delta q\rVert^2/d. The error energy of Eq. (3) then reduces to (∥δq∥2/d)∑mλm(\lVert\delta q\rVert^2/d)\sum_m\lambda_m, which follows from the eigenvalues alone. We measure how far the residual is from this case by the direction factor γ\gamma, the measured error energy divided by this value,

γ=∑i∑mλm(δqium)21d∑i∥δqi∥2∑mλm.(21)\gamma=\frac{\sum_i\sum_m\lambda_m(\delta q_i u_m)^2}{\frac{1}{d}\sum_i\lVert\delta q_i\rVert^2\sum_m\lambda_m}. \tag*{(21)}

with ii over the queries of the head. An evenly spread residual has γ=1\gamma=1. The KK-side term has the same factor with δkj\delta k_j, μm\mu_m and wmw_m and the sum over the keys jj.

Hadamard rotation. The Hadamard rotation is meant to spread the residual evenly over the eigenvectors (§ 3.2), so that the eigenvalues measure the error energy. Table 7 tests this with the direction factor γ\gamma and with the first-order error energy of Eq. (3), each without and with the rotation. Without the rotation, γ\gamma is 1.20 to 1.63 over the four sets, because the leading eigenvectors lie along the outlier channels, which also carry the largest rounding errors. The rotation brings γ\gamma to 1.01 to 1.13. Each term of Eq. (3) is then nearly proportional to its eigenvalue, and the first-order error energy falls to 0.64 of its value without the rotation on the hard layers of Wan2.2 and to 0.80 to 0.85 on the other three sets, before any compensation.

RotationWan2.2MiniMax-H3
HardAllHardAll
Direction factor γ\gamma×\times1.631.201.621.33
✓\checkmark1.021.011.131.03
First-order error energy×\times1.001.001.001.00
✓\checkmark0.640.850.800.83

Table 7. Residual without and with the rotation. Direction factor γ\gamma of Eq. (21) and first-order error energy relative to its value without the rotation, without (×\times) and with (✓\checkmark) the Hadamard rotation, as medians over the heads and means of the QQ and the KK side. The rotation brings γ\gamma close to 1 and lowers the first-order error energy on every set.

With the rotation, (δq um)2(\delta q\,u_m)^2 is thus nearly the same along every umu_m. The remainder η(r)\eta(r) of Eq. (19) is then close to the share of the energy of KK outside the rr leading eigenvectors, which is one minus the share that the basis holds in Figure 3b.

Measured remainder. Table 8 gives the measured η(r)\eta(r) of both terms over all layers of Wan2.2, with the rotation. With the eigenvectors of GKG_K and GQG_Q from all tokens as the bases, 25.6% of the QQ-side term and 26.4% of the KK-side term remain at r=32r=32. These values are close to the complements of the 74.3% of the energy of KK and the 73.7% of the energy of QQ that the 32 leading eigenvectors hold (Table 12), as the proportionality of § 3.2 predicts. A random basis leaves 74.8%, close to 1−r/d1-r/d, because rr random directions hold on average a share r/dr/d of the energy. A few principal directions thus hold most of the error of both terms. Section B.4 discusses the two remaining rows of the table.

BasisTokensQQ-side term, r=r= 16KK-side term, r=r= 16
163264163264
separateall42.125.610.743.026.411.3
sharedall44.627.811.945.728.712.6
shared (Ours)1/25646.930.814.347.831.314.9
randomnone87.474.849.687.474.849.6

Table 8. First-order terms outside the compensation. Remainder η(r)\eta(r) (%) of Eq. (19) of the QQ-side and the KK-side term of the rotated NVFP4 QKQK at r=16r=16, 32 and 64, median over the heads of all layers of Wan2.2, for separate bases of the leading eigenvectors of each operand, one basis shared by QQ and KK, the shared basis from the 1/256 token sample of the kernels, and a random basis. The eigenvectors of each operand leave about a quarter of each term at r=32r=32, a random basis three quarters.

BasisTokensWan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
separateallQQ 86.0<br>KK 87.473.7<br>74.393.8<br>96.383.2<br>85.1
sharedallQQ 83.8<br>KK 85.471.1<br>71.992.5<br>95.180.8<br>82.7
shared (Ours)1/256QQ 82.6<br>KK 83.868.5<br>69.088.9<br>92.475.8<br>77.5
Overlap of QQ and KK0.760.750.730.67

Table 12. Energy in the basis. Share (%) of the energy of QQ and KK in the 32 directions of separate bases per operand, of one basis shared by QQ and KK from all tokens, and of the shared basis from the token sample of the kernels, and the overlap of the leading subspaces of QQ and KK, as medians over the heads. Sharing and sampling each cost a few points of energy.

Effect of the two terms. Of the two terms, the KK-side term has by far the larger effect on the output on the hard layers. There, the kernel error on Wan2.2 is 18.35% without the compensation of the KK-side term and 3.97% without that of the QQ-side term (Table 4). The reason is that softmax passes on only the differences of the score errors between the keys of a query (Eq. (14)). For two keys jj and j′j' of one query, the errors of the two terms differ by

δq⋅(k^j−k^j′)=δq⋅(kj−kj′)−δq⋅(δkj−δkj′),q^⋅(δkj−δkj′).(22)\begin{aligned} \delta q \cdot(\hat{k}_j-\hat{k}_{j'}) &= \delta q \cdot(k_j-k_{j'})-\delta q \cdot(\delta k_j-\delta k_{j'}),\\ &\hat{q}\cdot(\delta k_j-\delta k_{j'}). \tag*{(22)} \end{aligned}

Two similar keys can round in opposite directions, so the difference δkj−δkj′\delta k_j-\delta k_{j'} of their residuals is not small. In the KK-side term, the whole query q^\hat{q} multiplies it. In the QQ-side term, only the residual δq\delta q multiplies it, which makes it a second-order term, next to δq\delta q times the difference of the keys themselves, which is small for similar keys. The KK-side term therefore dominates wherever the weight of a query lies on similar keys. On the hard layers it does, as the ablation of Table 4 shows.

Error of the compensated QK

We show that the truncation drops the energy that η(r)\eta(r) counts, how much of the error the compensation removes, and how the Hadamard rotation and the compensation add up.

Truncation. Equation (4) expands the QQ-side term of a query in the eigenvectors umu_m of GKG_K and keeps the first rr terms. The dropped part is the sum over m>rm > r. Its energy over all keys is

∑j(∑m>r(δq um)(k^jum))2=∑m>r∑m′>r(δq um)(δq um′)∑j(k^jum)(k^jum′).(23)\begin{aligned} \sum_j\left(\sum_{m>r}(\delta q\,u_m)(\hat{k}_j u_m)\right)^2 \\ &= \sum_{m>r}\sum_{m'>r}(\delta q\,u_m)(\delta q\,u_{m'})\sum_j(\hat{k}_j u_m)(\hat{k}_j u_{m'}). \tag*{(23)} \end{aligned}

The inner sum over the keys is umTGKum′u_m^\mathsf{T}G_Ku_{m'}. It equals λm\lambda_m for m′=mm'=m and zero otherwise, because the umu_m are orthonormal eigenvectors of GKG_K. The cross terms therefore vanish, and the dropped part has the energy

∑j(∑m>r(δq um)(k^jum))2=∑m>rλm(δq um)2,(24)\sum_j\left(\sum_{m>r}(\delta q\,u_m)(\hat{k}_j u_m)\right)^2=\sum_{m>r}\lambda_m(\delta q\,u_m)^2, \tag*{(24)}

which are the terms of Eq. (3) beyond the rr-th, the numerator of Eq. (19). DeCo-Attention thus compensates the first rr terms of Eq. (3) and drops the other d−rd-r. The eigenvalues are in descending order, λ1≥⋯≥λd\lambda_1 \ge\cdots\ge\lambda_d, so the dropped directions are those along which the keys have the least energy. The same holds for the KK-side term.

Parts of the error. The compensated QKQK of § 3.2 departs from the exact scores in three places. The second-order term δq⋅δk\delta q\cdot\delta k is neglected in Eq. (1), each first-order term is truncated to rr directions in Eq. (4), and the projections onto BB are rounded to NVFP4 in Eq. (5). Two more runs separate the three parts. One leaves the projections in FP32, which removes their rounding. The other also compensates all 128 directions, which leaves only the second-order term. The differences between the squared mean errors of the runs give each part (Table 10).

RotationWan2.2MiniMax-H3
HardAllHardAll
First order, compensated×\times30.039.7527.7710.06
✓\checkmark18.477.2729.749.13
First order, dropped×\times1.623.204.353.91
✓\checkmark1.693.294.643.97
Second-order term×\times1.600.741.360.78
✓\checkmark0.750.551.560.73
Rounding of the projections×\times2.731.392.991.28
✓\checkmark1.010.873.301.14

Table 10. Parts of the QK error without and with the rotation. Each part as the error (%) that it would give alone. The parts add in energy, that is, in their squares. The first three make up the uncompensated QKQK of Table 9, and the last three the compensated QKQK. The first-order terms are split into those along the r=32r = 32 compensated directions and those along the dropped directions. On Wan2.2, the rotation lowers the first-order terms along the compensated directions, the second-order term, and the rounding. The terms along the dropped directions rise marginally.

Table 9 gives the error of QKQK alone, with PP and VV exact. With the rotation, the compensation lowers the mean error on the hard layers of Wan2.2 from 18.57% to 2.10% and over all layers from 8.00% to 3.45%, and on MiniMax-H3 from 30.14% to 5.90% and from 9.98% to 4.19%. Table 10 gives the parts of these errors. On Wan2.2 with the rotation, the first-order terms in the 32 compensated directions amount to 18.47% on the hard layers and to 7.27% over all layers, most of the error of the uncompensated QKQK. Of the parts that remain, the first-order terms in the dropped directions are the largest on every set, 1.69% and 3.29% on Wan2.2.

RotationWan2.2MiniMax-H3
HardAllHardAll
Uncompensated QKQK×\times30.1210.2928.1410.82
✓\checkmark18.578.0030.149.98
Compensated QKQK×\times3.563.575.454.19
✓\checkmark2.103.455.904.19
Whole kernel×\times3.943.835.824.40
✓\checkmark2.803.736.314.40

Table 9. Error without and with the rotation. Mean relative L2 error (%) without (×\times) and with (✓\checkmark) the Hadamard rotation, for QKQK alone with PP and VV exact, uncompensated and compensated at r=32r = 32, and for the whole kernel with FP8 PVPV. The rotation lowers the errors on Wan2.2 and raises those on the hard layers of MiniMax-H3.

Rotation and compensation. The rotation helps in three ways, and its gain adds to that of the compensation. First, it lowers the score error before any compensation, on the hard layers of Wan2.2 from 30.12% to 18.57% (Table 9). It spreads the residuals of QQ and KK over all directions, which takes them off the directions in which the other operand is largest (Sec. B.1). Second, the evenly spread residual lets the eigenvalues measure the error, on which choice of the compensated directions rests. Third, it evens out the values within a block of 16 channels, which lowers the two smaller parts of the compensated error (Tab. 10). The rounding of the projections falls from 2.73% to 1.01% and the second-order term from 1.60% to 0.75%. Most of this gain comes from the heads in which two large values share a block, where NVFP4 rounds the smaller one coarsely.

The cost is a weaker compensation of the first-order terms. Without the rotation, the residual lies along the leading eigenvectors, which the compensation covers. The rotation moves a small part of it into the dropped directions, whose error rises from 1.62% to 1.69%. With the compensation, the rotation lowers the error of the QKQK from 3.56% to 2.10% and the error of the kernel from 3.94% to 2.80%.

Blocks with one dominant value do not gain from the rotation. The block scale stores the largest value of a block almost exactly, so such a block is quantized well as it is. The rotation spreads this value over the channels, where every part of it is rounded to 4 bits. Some heads of the hard layers of MiniMax-H3 are of this kind. There the unrotated operands have the smaller parts of the QKQK error and the smaller error of the kernel, 5.82% against 6.31% (Table 9 and Table 10). Over all layers of MiniMax-H3, the error of the kernel is 4.40% with and without the rotation, and on Wan2.2 the rotation lowers it. The kernels therefore keep it for every model.

Compensation rank

We show that the error falls with the rank rr and that r=32r = 32 is the largest rank that does not add an MMA to the QKQK on GB300. Table 11 varies the rank. On the hard layers of Wan2.2, r=16r = 16 raises the error from 2.80% to 3.97% and r=64r = 64 lowers it to 2.42%, and over all layers r=64r = 64 lowers it from 3.73% to 2.81%.

rrChannelsMMAs GB300MMAs VR200Wan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
01282118.708.1029.4010.00
16160223.974.7710.085.89
32 (Ours)192222.803.736.314.40
64256322.422.814.923.18

Table 11. Rank of the compensation. QKQK channels, NVFP4 MMAs of the QKQK per tile on GB300 and VR200, and relative L2 error (%) of DeCo-Attention with FP8 PVPV, per rank rr. r=32r = 32 is the largest rank with two MMAs on GB300.

A higher rank costs time in the preparation and in the kernel. The preparation projects every token of QQ and KK onto rr directions twice, and at r=32r = 32 it takes 2.7 to 3.6% of the attention time (Sec. B.4). In the kernel, the operands Q′Q' and K′K' have 128+2r128 + 2r channels, 192 at r=32r = 32, which is 50% more than the 128 of QQ and KK, so every tile loads 50% more bytes of them. The QKQK also takes more NVFP4 MMAs per tile once its channels exceed the reduction depth of an MMA, which is up to 96 on GB300, 128 on VR200, and 64 on RTX PRO 6000. On GB300, r=16r = 16 and r=32r = 32 take two MMAs per tile, as many as the uncompensated QKQK, and r=64r = 64 takes a third. On VR200, every rank above zero takes two MMAs, one more than the uncompensated QKQK. On RTX PRO 6000, r=16r = 16 and r=32r = 32 take three MMAs per tile and r=64r = 64 four.

We therefore use r=32r = 32 on every GPU. It is the largest rank that does not add an MMA on GB300, and it takes as many MMAs as r=16r = 16 on VR200 and RTX PRO 6000. On VR200, r=64r = 64 would take the same two MMAs, but the kernels keep one rank for all GPUs.

Preparation

We give the preparation of § 3.2 step by step. Algorithm 1 lists it for one head. It runs as a chain of fused kernels, an eigensolver for the bases of all heads and one pass each over QQ and KK and over VV.

Algorithm 1 Preparation of one head

Require: Q,K,V∈RN×dQ, K, V \in\mathbb{R}^{N \times d}, rank rr, rotation HH, block size of VV

Ensure: Q′,K′Q', K' with d+2rd + 2r channels, v~\tilde{v}, block means vˉ\bar{v}

  1. S←S \leftarrow sample of max⁡(N/256,2r)\max(N/256, 2r) tokens

  2. G←G \leftarrow Eq. (6) on QSHQ_S H and KSHK_S H

  3. B←B \leftarrow rr leading eigenvectors of GG

  4. for each token ii do

  5. q←qiHq \leftarrow q_i H, q^←Q(q)\hat{q} \leftarrow Q(q), δq←q−q^\delta q \leftarrow q - \hat{q}

  6. qi′←[q^∣Q(δqB)∣Q(q^B)]q'_i \leftarrow[\hat{q} \mid Q(\delta q B) \mid Q(\hat{q} B)]

  7. k←kiHk \leftarrow k_i H, k^←Q(k)\hat{k} \leftarrow Q(k), δk←k−k^\delta k \leftarrow k - \hat{k}

  8. ki′←[k^∣Q(δkB)∣Q(k^B)]k'_i \leftarrow[\hat{k} \mid Q(\delta k B) \mid Q(\hat{k} B)]

  9. end for

  10. for each block bb of keys do

  11. vˉb←\bar{v}_b \leftarrow mean of vjv_j over j∈bj \in b

  12. v^j←Q(vj−vˉb)\hat{v}_j \leftarrow Q(v_j - \bar{v}_b) for j∈bj \in b

  13. end for

• Rotation. HH is a normalized Hadamard matrix of order 128 with random signs on its rows. Since HHT=IH H^{\mathsf{T}} = I, the rotation leaves the scores and the eigenvalues of GQG_Q and GKG_K unchanged.

• Sampling. The sample holds 1/256 of the tokens, at least 2r=642r = 64, and is drawn before the pass over QQ and KK, which needs BB. On a sequence of text, audio and video tokens, half of the sample comes from the text and audio tokens, or all of them when they are fewer, and the rest from the video tokens, so that both groups weigh equally in the basis.

• Q′Q' and K′K'. Each operand holds three groups of channels, for q′q' the 128 channels of q^\hat{q}, the 32 of δqB\delta q B and the 32 of q^B\hat{q} B. QQ rounds every group to NVFP4, E2M1 elements with an unsigned E4M3 scale per block bb of 16 channels,

sg=2⌊log⁡2(ag/(6⋅448))⌋,σb=QE4M3(max⁡c∈b∣xc∣6sg),s_g = 2^{\left\lfloor\log_2(a_g/(6\cdot448)) \right\rfloor}, \qquad \sigma_b = Q_{\mathrm{E4M3}}\left(\frac{\max_{c\in b}|x_c|}{6s_g}\right),
x^c=sgσbQE2M1(xcsgσb).(25)\hat{x}_c = s_g \sigma_b Q_{\mathrm{E2M1}}\left(\frac{x_c}{s_g\sigma_b}\right). \tag*{(25)}

where aga_g is the largest magnitude of the group in the head and 6 and 448 are the largest values of E2M1 and E4M3. The block scale σb\sigma_b maps the largest element of its block to 6, and sgs_g keeps every block scale at or below 448. Each group has its own sgs_g, because the projections of the residual are much smaller than the other two groups.

  • VV. With FP8 PVPV, the blocks hold 128 keys and QQ rounds to E4M3 with one power-of-two scale per tensor. With NVFP4 PVPV, the blocks hold 16 keys (Sec. C).

Shared basis. We show that the leading subspaces of QQ and KK overlap enough for one shared basis to hold nearly as much of the energy of each operand as separate bases, and that a basis of channels or a random basis leaves most of the error. DeCo-Attention shares one basis between QQ and KK (§ 3.2). Table 12 measures the overlap of the two leading subspaces as the mean share of a leading eigenvector of GQG_Q that lies in the span of the leading eigenvectors of GKG_K, which is 1 for identical subspaces and r/dr/d for unrelated ones. At r=32r = 32 the overlap is 0.67 to 0.76 over the four sets, with 0.75 over all layers of Wan2.2 as quoted in § 3.2. Over all layers of Wan2.2, the shared basis holds 71.9% of the energy of KK, against 74.3% for separate bases. Separate bases give nearly the same error (Table 13), 2.91% against 2.80% on the hard layers of Wan2.2 and 5.97% against 6.31% on those of MiniMax-H3.

BasisRotationWan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
shared (Ours)✓2.803.736.314.40
separate✓2.913.775.974.35
channels✓15.166.7824.998.22
channels×4.484.567.755.84
random✓14.566.8025.748.49

Table 13. Basis of the compensation. Relative L2 error (%) of DeCo-Attention with FP8 PVPV with the shared basis, with separate bases BKB_K and BQB_Q per term, with the 32 channels of largest energy as the basis, and with a random orthonormal basis, with (✓) or without (×) the Hadamard rotation. Separate bases change the error by less than half a point. With the rotation, a channel basis or a random basis leaves most of the error.

Table 13 also replaces the principal directions. The channel basis takes the 32 channels with the largest diagonal entries of GG, so that the extra channels hold the residuals and the quantized values of these channels, as ARQuant does for outlier channels (Meng et al., 2026). With the rotation, this basis leaves about as much error as a random basis, because the rotation spreads the energy over all channels. Without the rotation, the channel basis reaches 4.48% on the hard layers of Wan2.2 and 7.75% on those of MiniMax-H3, against 3.94% and 5.82% for the unrotated shared basis (Table 9). With the same number of extra channels, the principal directions thus remove the most error on every set, which shows the benefit of compensating along them.

Token sample. We show that a basis estimated from a small sample of the tokens holds nearly as much energy and gives nearly the same error as a basis from all tokens. DeCo-Attention estimates the basis from a random sample of 1/256 of the tokens (§ 3.2). Over all layers, the sampled basis holds 69.0% of the energy of KK on Wan2.2 and 77.5% on MiniMax-H3, against 71.9% and 82.7% for the shared basis from all tokens (Table 12). On Wan2.2, it leaves 30.8% and 31.3% of the two first-order terms, against 27.8% and 28.7% (Table 8). Sharing and sampling together thus lower the energy of KK in the basis over all layers of Wan2.2 from 74.3% to 69.0%, the two values of § 3.2. A basis from 1/64 or from all of the tokens lowers the error on the hard layers of Wan2.2 from 2.80% to 2.77% and on those of MiniMax-H3 from 6.31% to 6.07% and 5.78% (Table 14). The larger gain on MiniMax-H3 comes from the token types. Half of the sample is drawn from the text and audio tokens, whereas a basis from all tokens follows the video tokens.

TokensWan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
1/256 (Ours)2.803.736.314.40
1/642.773.656.074.26
all2.773.625.783.99

Table 14. Token sample of the basis. Relative L2 error (%) of DeCo-Attention with FP8 PVPV with the basis estimated from 1/256, 1/64, or all of the tokens. The sample costs 0.03 points on the hard layers of Wan2.2 and about half a point on those of MiniMax-H3.

Common scale of the three channel groups. The MMA over the 192 channels of Q′Q' and K′K' sums the three groups into one score, which can carry only one scale SS. The kernel takes as SS the largest of the three products of a Q′Q' group scale and its K′K' group scale. I-ExpCast can raise SS further, because it folds SS into the multiplier aa of its FMA, an FP32 subnormal, which keeps SS at or above 2−102^{-10} with FP8 PVPV and 2−62^{-6} with NVFP4 PVPV (Eq. (8)). A group whose product lies below SS shrinks its block scales by the ratio, which leaves the scores unchanged. A block scale below 2−62^{-6}, the end of the normal range of E4M3, loses accuracy. The kernel therefore spreads the shrink over the block scales of Q′Q' and K′K'. The group scales and SS are powers of two, so the shrink shifts the exponent of a block scale without a second rounding.

Cost. Per head, the attention takes N2(d+2r)N^2(d+2r) multiply-adds for the QKQK and N2dN^2d for the PVPV, and the preparation 2Nd22Nd^2 for the rotation of QQ and KK and 4Ndr4Ndr for the four projections. The Gram matrices of the sample and the block means of VV add little, and the eigendecomposition of a d×dd \times d matrix does not grow with NN. The preparation is thus linear in NN and the attention quadratic, with the ratio

N(2d2+4dr)N2(2d+2r)=d(d+2r)N(d+r),(26)\frac{N(2d^2+4dr)}{N^2(2d+2r)}=\frac{d(d+2r)}{N(d+r)}, \tag*{(26)}

about 154/N154/N for d=128d=128 and r=32r=32, or 0.2% for the 75,600 tokens of a Wan2.2 call. In time, the preparation adds 2.7 to 3.6% to the attention (Table 27), as stated in § 3.2. This exceeds its share of the operations, partly because the rotation and the projections run as BF16 and TF32 MMAs, which are slower than the NVFP4 and FP8 MMAs of the attention, and because every operand is read and written once.

MethodQK/PVBackendGB300 Wan2.2 attentionGB300 Wan2.2 prep.GB300 MiniMax-H3 attentionGB300 MiniMax-H3 prep.VR200 Wan2.2 attentionVR200 Wan2.2 prep.VR200 MiniMax-H3 attentionVR200 MiniMax-H3 prep.
BF1616/16FA4, cuDNN / FA4122.5 (1.00×)0.0083.5 (1.00×)0.0072.6 (1.00×)0.0050.5 (1.00×)0.00
QK16PV816/8TRT-LLM / FlashInfer102.8 (1.19×)0.6569.8 (1.20×)0.4659.8 (1.22×)0.5941.9 (1.21×)0.43
Per-tensor FP8FlashInfer / cuDNN79.2 (1.55×)1.9552.7 (1.58×)1.4043.7 (1.66×)1.7829.0 (1.74×)1.30
MXFP88/8cuDNN82.7 (1.50×)3.3754.5 (1.53×)2.3244.2 (1.64×)3.5129.5 (1.72×)2.41
SageAttention2, FP8 QKTRT-LLM103.1 (1.21×)1.7167.9 (1.23×)1.1552.6 (1.38×)1.9934.8 (1.45×)1.36
VC-Attention, FP8 QKFlashInfer83.0 (1.48×)3.6351.0 (1.53×)2.4448.1 (1.51×)2.2130.7 (1.65×)1.46
NVFP4 QK, FP8 PVTRT-LLM83.7 (1.49×)11.5356.3 (1.48×)7.9044.9 (1.62×)12.5931.3 (1.61×)8.67
Attn-QAT4/8Attn-QAT77.5 (1.60×)0.9651.1 (1.62×)0.66————
DeCo-Attention (Ours)ours57.5 (2.13×)1.5537.2 (2.25×)1.0929.2 (2.49×)1.0519.6 (2.58×)0.70
NVFP4FlashInfer74.8 (1.66×)0.9949.9 (1.67×)0.64————
DeCo-Attention (Ours)4/4ours54.7 (2.28×)1.4136.1 (2.32×)1.0032.0 (2.27×)1.0221.3 (2.38×)0.74

Table 27. Kernel speed on GB300 and VR200. Attention time (ms) of a Wan2.2 and a MiniMax-H3 call, with the speedup over BF16 attention, the method’s preparation outside the kernel, and the backend of each kernel, written GB300 / VR200 where the two GPUs differ and Wan2.2, MiniMax-H3 where the two models differ. Each speedup is over the BF16 attention of the kernel’s own timing session, whose time is within 2% of the BF16 row. A dash marks a method without a kernel for the GPU. Blue marks the shortest attention time of each 4-bit-QKQK group.

Smoothing of V

DeCo-Attention smooths VV before it quantizes VV, following the V-Smooth of VC-Attention (§ 5.1) ((Li et al., 2026)). We give the method, show what the smoothing removes from the error of each operand of the PVPV product, and show why the FP8-PVPV kernels smooth per 128 keys and the NVFP4-PVPV kernels per 16 keys.

Method. Every key jj has a value vector vjv_j, and the keys of a block bb of consecutive keys share their mean vˉb\bar{v}_b. The smoothing takes this shared part out of the low-precision PVPV. It subtracts vˉb\bar{v}_b from the values of its block, the kernel multiplies PP with the centered VV in low precision, and a small product in high precision adds the block means back. Let ϕij\phi_{ij} be the exponential of the score of key jj relative to the row base of row ii and b(j)b(j) the block that holds key jj. The numerator of the attention output splits exactly into the centered values and the block means,

∑jϕijvj=∑jϕij(vj−vˉb(j))+∑bLibvˉb,Lib=∑j∈bϕij,vˉb=1∣b∣∑j∈bvj.(27)\sum_j \phi_{ij}v_j=\sum_j\phi_{ij}\left(v_j-\bar{v}_{b(j)}\right)+\sum_bL_{ib}\bar{v}_b, \qquad L_{ib}=\sum_{j\in b}\phi_{ij},\quad \bar{v}_b=\frac{1}{|b|}\sum_{j\in b}v_j. \tag*{(27)}

The kernel rounds only the first term and adds the second with its block sums L^ib\hat{L}_{ib} of PP,

oi=∑jϕ^ij(vj−vˉ^b(j))+∑bL^ibvˉb∑bL^ib,(28)o_i=\frac{\sum_j\hat{\phi}_{ij}\left(v_j-\widehat{\bar{v}}_{b(j)}\right)+\sum_b\hat{L}_{ib}\bar{v}_b}{\sum_b\hat{L}_{ib}}, \tag*{(28)}

where ϕ^ij\hat{\phi}_{ij} is the quantized ϕij\phi_{ij} of the PVPV MMA and L^ib\hat{L}_{ib} is the block sum of PP that the kernel forms (Sec. D.2). VC-Attention reorders the tokens by k-means and subtracts the mean of each tile of 128 tokens. DeCo-Attention keeps the token order, in which neighboring video tokens are similar, and smooths per block of 16 keys with NVFP4 PVPV. The small blocks follow VV more closely than tiles of 128 tokens and do not need a grouping in token order (Table 15).

PVPVBlockWan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
FP8none2.953.756.374.44
FP8162.663.706.294.38
FP8322.733.716.314.39
FP8128 (Ours)2.803.736.314.40
NVFP4none7.505.819.166.55
NVFP416 (Ours)5.685.098.245.66
NVFP4326.155.268.375.78
NVFP41286.585.438.445.85

Table 15. Block of the smoothing. Relative L2 error (%) of DeCo-Attention with VV as it is (none) and smoothed per block of 16, 32 or 128 keys, per PVPV format. The smoothing does not lower the error by much with FP8 PVPV and lowers it most with NVFP4 PVPV and small blocks.

Effect on P and V. The smoothing lowers the error of both operands of the PVPV. For PP, it returns the shared part of every contribution that a 4-bit PP drops. An NVFP4 PP rounds every probability below 1/24 of its block maximum to zero, so without the smoothing the output loses the whole contribution ϕijvj\phi_{ij}v_j of such a key. With the smoothing, the part ϕijvˉb(j)\phi_{ij}\bar{v}_{b(j)} of this contribution returns to the output through the block sum L^ib\hat{L}_{ib}, which the NVFP4-PVPV kernels form from most probabilities before the rounding (Sec. D.2). Only the part ϕij(vj−vˉb(j))\phi_{ij}\left(v_j-\bar{v}_{b(j)}\right) is lost. For VV, the centered values have zero mean in every block, so these losses have both signs and largely cancel, where the losses of the uncentered values all point along the block mean. The centered values are also smaller than VV, so a floating-point format rounds them with a smaller error, and the block means stay in high precision. Figure 9 shows the result. Without the smoothing, the errors of the rows lean to one side, and with it they center near zero. The cost is one more MMA, which multiplies the block sums of PP with the block means in high precision and which smaller blocks need more often.

Figure 9. Bias of a 4-bit P. Error of each query row of a typical head of Wan2.2 along the mean error of the head, with PP rounded to NVFP4 and VV exact, without and with smoothing per 16 keys. Without the smoothing the row errors lean to one side, with it they center near zero.

Block size. The block size follows from the accuracy and from what bounds each kernel. Table 15 gives the error per block size. An FP8 PP and VV round finely already, so the smoothing does not lower the error by much. On the hard layers of Wan2.2, blocks of 128 keys lower the error from 2.95% to 2.80% and blocks of 16 keys to 2.66%, but the smaller blocks need the extra MMA four times as often, once per two key tiles instead of eight. The FP8-PVPV kernel already runs close to the time of its MMAs (Sec. D.3), so every extra MMA lengthens it. It therefore smooths per 128 keys, which lengthens the kernel on GB300 from 55.8 to 58.0 ms on a Wan2.2 call (Table 5). An NVFP4 PVPV gains much more, and most from small blocks. Blocks of 16 keys lower the error from 7.50% to 5.68% on the hard layers of Wan2.2 and from 5.81% to 5.09% over all layers, against 6.58% and 5.43% with 128 keys. On GB300 and VR200, the softmax warps bound the NVFP4-PVPV kernel (Sec. D.2), so its tensor cores have room for the extra MMAs. The NVFP4-PVPV kernels therefore smooth per 16 keys.

Kernels

This appendix supplements § 3.3. On GB300 and VR200, the softmax between the two MMAs bounds the kernel, so the faster 4-bit QKQK MMA shortens the kernel only when the softmax is shortened as well. The three optimizations of § 3.3 do this. We derive the bit pattern of I-ExpCast, bound the error of its approximation and measure its accuracy and speed in the kernels (Sec. D.1), measure the row sum and the block sums of PP in the PVPV MMA (Sec. D.2), and measure the threshold of the lazy rescale (Sec. D.3).

I-ExpCast

We show that I-ExpCast overestimates a probability by at most 6%, which moves the attention weights by less than a centered score error of 0.06, and that it forms PP faster than every other way in the kernels at the error of the exponential on the SFU.

Bit pattern. An FP16 number holds a sign bit, an exponent field EE of five bits, and a mantissa field MM of ten bits. For 1≤E≤301 \le E \le30, its value is (1+M/1024)⋅2E−15(1 + M/1024) \cdot2^{E-15}, where 15 is the exponent bias of the format, and the 16 bits of a positive number read as the integer 1024E+M1024E + M. Let x=n+fx = n + f with the integer n=⌊x⌋n = \lfloor x \rfloor and 0≤f<10 \le f < 1. Then 2x=2f⋅2n2^x = 2^f \cdot2^n with 1≤2f<21 \le2^f < 2, so its fields are E=n+15E = n + 15 and M=1024(2f−1)M = 1024(2^f - 1), and its bit pattern is

bits⁡FP16(2x)=1024(n+15)+1024(2f−1)≈1024(n+15)+1024f=1024(x+15),(29)\operatorname{bits}_{\mathrm{FP16}}(2^x) = 1024(n + 15) + 1024(2^f - 1) \approx1024(n + 15) + 1024f = 1024(x + 15), \tag*{(29)}

where the approximation replaces 2f−12^f - 1 by ff. This is Eq. (7). It holds for −14≤n≤15-14 \le n \le15, which covers every value of E4M3 and E2M1.

Approximation error. The pattern 1024(x+15)1024(x + 15) has the exponent field n+15n + 15 and the mantissa field 1024f1024f, so it is the FP16 number 2n(1+f)2^n(1 + f), whereas 2x=2n2f2^x = 2^n 2^f. I-ExpCast thus forms the probability times

c(f)=1+f2f,1≤c(f)≤2eln⁡2,(30)c(f) = \frac{1 + f}{2^f}, \qquad1 \le c(f) \le\frac{2}{e \ln2}, \tag*{(30)}

which is exact at integer xx and largest at f=1/ln⁡2−1f = 1/\ln2 - 1, an overestimate of up to 6%. The kernel divides the output by the row sum of the same PP, so the weight of key jj is pjcj/∑lplclp_j c_j / \sum_l p_l c_l. A factor that all keys share cancels in this ratio. Since every cjc_j lies between 1 and 1.06, each weight changes by about 6% at most. By Eq. (2), this is the effect of a centered score error of about 0.06, far below the 1.0 at which the softmax leaves its linear range (Sec. A.2). The codes of I-ExpCast therefore follow those of the exponential and rounding over the whole range, subnormal codes included (Figure 5).

Accuracy. With only PP rounded, I-ExpCast stays close to the exponential followed by rounding in both formats (Table 1). The kernel scales PP down by 2T2^T to leave room for the lazy rescale (Sec. D.3). A larger threshold therefore moves more of the small probabilities into the subnormal range of the format, where the ways of forming the codes differ most. For an E4M3 PP, ExpCast makes the subnormal codes too small. Over all layers of Wan2.2, its error grows from 1.02% at T=0T = 0 to 3.26% at T=4T = 4 and 8.88% at T=8T = 8, whereas I-ExpCast has 0.68%, 0.93% and 2.72%, against 0.40%, 0.88% and 2.72% for the exponential and rounding. For an E2M1 PP, Direct-P (Hu, 2026) forms the codes from a linear function of the score and has 5.06% at every threshold, whereas I-ExpCast has 1.90% at T=4T = 4, below the 2.09% of the exponential and rounding. In the kernels (Table 16), I-ExpCast has 2.80% on the hard layers of Wan2.2 with FP8 PVPV, against 2.78% for the exponentials on the SFU, whereas ExpCast raises this error to 3.13%.

PVExponentialTime (ms)Wan2.2Wan2.2MiniMax-H3MiniMax-H3
HardAllHardAll
FP8I-ExpCast (Ours)57.832.803.736.324.40
FP8ExpCast60.05 (+3.6%)3.134.826.875.08
FP8SFU70.24 (+21.5%)2.783.696.274.37
FP8SFU and polynomial72.67 (+25.7%)2.783.696.274.37
NVFP4I-ExpCast (Ours)54.175.685.098.245.67
NVFP4SFU72.77 (+34.3%)5.675.078.235.65
NVFP4Direct-P†75.44 (+40.2%)nannannannan

Table 16. Forming PP in the kernels. Attention time of a Wan2.2 call and relative L2L_2 error (%) of the FP8-PVPV and NVFP4-PVPV kernels of DeCo-Attention on GB300 with each way of forming PP, as the mean over the hard layers and over all layers. ExpCast is that of VC-Attention, SFU computes every exponential on the special-function unit, and the polynomial of FlashAttention-4 replaces it for one eighth of the score pairs. †Direct-P is timed in its released kernel against the NVFP4-PVPV kernel of the same session. In every set of calls, some of its outputs are not finite, so its errors are nan. I-ExpCast is the fastest way in both formats at the error of the exponentials on the SFU.

Performance. I-ExpCast takes 6 instructions per four scores and does not use the SFU (Figure 10). The times of Table 16 show two things. First, I-ExpCast saves a large part of the kernel time. With every exponential on the SFU, the

Cost of forming P

Figure 10. Cost of forming P. Instructions that form the codes of PP from a pair of scores ss in the softmax warps, in PTX names, with their count per four scores on GB300 and VR200, for exp2 on the SFU, ExpCast of VC-Attention, I-ExpCast, and Direct-P. Only (a) uses the SFU, for 2 of its 8 instructions. The constants aa and cc fold in the score scale, the row base, and the PP scale, and in Direct-P its linear map. (a) to (c) form E4M3 codes and (d) E2M1 codes, which I-ExpCast forms with an E2M1 conversion as its last instruction.

FP8-PVPV kernel takes 21.5% longer. Second, it saves more with NVFP4 PVPV, where the SFU costs 34.3%, because the faster 4-bit PVPV MMA leaves the softmax a larger share of the kernel. The polynomial of FlashAttention-4 (Zadouri et al., 2026) does not close this gap. A score pair takes 13 instructions on the polynomial against 4 on the SFU. With the polynomial on one eighth of the score pairs and the SFU on the others, the FP8-PVPV kernel takes 25.7% longer than with I-ExpCast on GB300 and 36.1% longer on VR200, more than with the SFU alone. This is the slowdown that § 3.3 refers to. ExpCast also keeps the exponentials off the SFU, but its 7 instructions take 3.6% longer. Direct-P needs only 4 instructions, but its released kernel takes 40.2% longer than the NVFP4-PVPV kernel of DeCo-Attention. In every set of calls, some of its outputs are not finite, which leaves its error unmeasured (Table 16).

Row sum and block sums

We show that the row sum of PP in the PVPV MMA does not cost accuracy against a sum on the ALU and saves 7.2% of the kernel time, and we give how the kernels form the block sums that the smoothing of VV needs. The ones column appended to VV sums the PP that the PVPV multiplies, in the format of the PVPV, so the denominator matches the rounded numerator (§ 3.3). Table 17 compares it with a sum on the ALU of the softmax warps. The ALU sum of the same E4M3 values gives the same error in every column, and takes 7.2% longer. The row sum through the E4M3 PVPV MMA does not lose accuracy and moves the sum from the softmax warps, which bound the kernel, to the tensor cores. Table 5 measures the same step before the lazy rescale, with 62.2 against 57.3 ms.

Row sum of PTime (ms)Wan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
PVPV MMA (Ours)54.932.953.756.374.44
ALU, E4M3 values58.89 (+7.2%)2.953.756.374.44
ALU, FP16 values57.91 (+5.4%)3.023.796.444.48

Table 17. Row sum of P. Attention time of a Wan2.2 call and relative L2 error (%) of the FP8-PVPV kernel of DeCo-Attention on GB300 with each way of summing PP, without the smoothing of VV, as the mean over the hard layers and over all layers. The sum in the PVPV MMA is the fastest and does not cost accuracy.

Summing the FP16 values before the rounding takes 5.4% longer than the MMA and raises the error, from 2.95% to 3.02% on the hard layers of Wan2.2, because this sum does not match the rounded PP of the numerator.

The smoothing of VV needs the sums of PP per block of keys (Sec. C). With FP8 PVPV, each of eight consecutive key tiles has its ones in a column of its own, and one BF16 MMA per eight key tiles adds the block means to the output. With a 4-bit PP, sums formed by the PVPV MMA would omit the probabilities that round to zero. The NVFP4-PVPV kernels therefore sum the unquantized PP on the ALU of the softmax warps where their time allows. On RTX PRO 6000, the MMAs bound the kernel, and it accumulates the row sum and all block sums in registers. On GB300 and VR200, the softmax warps bound the kernel. These kernels sum three of the four pairs of 16-key blocks of a tile on the ALU and leave the fourth pair to the PVPV MMA. Summing it on the ALU as well would take about 6% longer and lower the error of the kernel by about 1%.

Threshold of the lazy rescale

We show that the threshold T=4T = 4 keeps the error of a rescale of every tile and nearly the speed of T=8T = 8. The lazy rescale of § 3.3 moves the row base only when a tile exceeds it by more than a factor of 2T2^T, so a probability reaches up to 2T2^T of the row base. FP8 kernels scale PP by 28−T2^{8-T} before the conversion, which keeps it below the largest E4M3 value of 448. The smallest E4M3 subnormal 2−92^{-9} then stands for

2−9/28−T=2T−17(31)2^{-9} / 2^{8-T} = 2^{T-17} \tag*{(31)}

of the row base, 2−132^{-13} at T=4T = 4 and 2−92^{-9} at T=8T = 8, the two values of § 3.3. Table 18 measures both kernels on GB300 at T=0T = 0, 4 and 8. With an FP8 PP, T=8T = 8 raises the mean error over all layers from 3.73% to 4.50% on Wan2.2 and from 4.40% to 5.05% on MiniMax-H3. T=0T = 0 changes the errors only in the second decimal but lengthens the attention by 2.5%. The block scales of an NVFP4 PP follow the block maxima, so its errors differ only in the second decimal between the thresholds, and T=0T = 0 lengthens its attention by 4.5%. Both kernels therefore keep T=4T = 4, which is within 0.5% of the time of T=8T = 8.

PVTTTime (ms)Wan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
FP8059.09 (+2.5%)2.793.706.274.36
FP84 (Ours)57.632.803.736.324.40
FP8857.36 (-0.5%)2.994.506.855.05
NVFP4056.63 (+4.5%)5.675.078.245.65
NVFP44 (Ours)54.195.685.098.245.67
NVFP4854.01 (-0.3%)5.705.138.285.70

Table 18. Threshold of the lazy rescale. Attention time of a Wan2.2 call and relative L2 error (%) of the FP8-PVPV and NVFP4-PVPV kernels of DeCo-Attention on GB300 at three thresholds TT, as the mean over the hard layers and over all layers. T=4T = 4 keeps the error of T=0T = 0 at nearly the time of T=8T = 8.

With the three optimizations of this appendix, the MMAs of a tile of the FP8-PVPV kernel on GB300 take, at their full rate, about nine tenths of the measured time of the tile, so the kernel runs close to the time of its MMAs (§ 5.4).

Evaluation Details

This appendix supplements § 5. We give the setup (Sec. E.1), further accuracy results (Sec. E.2), and the times behind the speedups (Sec. E.3).

Setup

We give the models and captures, the software, the settings of every method, and the protocols of the four measurements, the end-to-end quality, the kernel error, the kernel time and the end-to-end time.

Models and captures. Table 19 lists the models of the kernel-level evaluation. We capture the BF16 inputs QQ, KK, and VV of their self-attention calls, on Wan2.2 those of the conditional guidance branch. The hard layers are the three layers with the largest error of per-tensor FP8 attention. On Wan2.2, each hard layer is captured at three steps per expert, and the all-layer calls take every layer at the middle step of each expert, steps 6 and 26. MiniMax-H32 runs with its PDD LoRA as in VC-Attention, which reduces the sampling to eight forward passes. The base model is guidance-distilled and runs without classifier-free guidance. Its calls hold text, video, and audio tokens in one joint attention. The hard layers are captured at passes 0, 4, and 7, and the all-layer calls take all 50 layers at pass 4.

Wan2.2MiniMax-H3
Resolution720p1344 × 768
Frames81243, with audio
Tokens per call75,60073,512
Heads4056
Hard layers33, 34, 3849, 45, 1
Hard calls189
All-layer calls8050

Table 19. Models and captures of the kernel-level evaluation. Output of each model, size of a self-attention call, and the captured calls.

Software. Every kernel that we run uses PyTorch 2.14 and CUDA 13.4. Our kernels and FlashAttention-4 4.0.0b37 are built with CuTe DSL 4.8.1, and the other baselines with the versions of their releases. cuDNN is 9.25 on GB300 and 9.26 on VR200 and RTX PRO 6000. On RTX PRO 6000, the kernels run in the TensorRT-LLM 1.4.0rc2 container.

Method settings. Every baseline keeps the quantization scheme of its method, and where a method has several kernels we time the fastest. Table 20 lists where each implementation comes from.

MethodQK/PVSource
BF16, FlashAttention-416/16public release
BF16, cuDNN16/16TensorRT-LLM
QK16PV816/8TensorRT-LLM
Per-tensor FP88/8TensorRT-LLM
MXFP88/8TensorRT-LLM
SageAttention2, INT8 or FP8 QK8/8TensorRT-LLM
VC-Attention, INT8 or FP8 QK8/8TensorRT-LLM
NVFP4 QK, FP8 PV4/8TensorRT-LLM
Attn-QAT4/8public release
NVFP44/4TensorRT-LLM
SageAttention34/4public release
VC-Attention, 4-bit4/4our reproduction
Direct-P4/4public release

Table 20. Sources of the implementations. Where the implementation of each method comes from.

  • BF16 attention. The reference videos of the end-to-end quality come from FlashAttention-4. The BF16 row of Table 2 is the BF16 attention of cuDNN, scored against them, and the VBench tables hold both.

  • QK16PV8, per-tensor FP8, MXFP8, NVFP4 QK with FP8 PV, and NVFP4 are the configurations of TensorRT-LLM VisualGen with these formats. NVFP4 QKQK with FP8 PVPV subtracts the mean of KK and applies SmoothQuant scales (Xiao et al., 2023) before the quantization.

  • SageAttention has three configurations. SageAttention2 scales QQ per token and KK per 16 tokens, with INT8 or FP8 QKQK, and SageAttention3 is fully 4-bit.

  • VC-Attention groups the video tokens of a call by k-means and smooths VV per tile of 128 tokens. As for SageAttention, we run its configurations with INT8 QKQK, with FP8 QKQK, and fully 4-bit.

  • Attn-QAT runs without the retraining and casts VV to E4M3 without a scale. A prompt whose output is not finite is generated again.

  • Reported rows. The rows of Table 2 and 21 marked with a dagger are means that VC-Attention reports, quoted unchanged. They are SageAttention2 and VC-Attention with INT8 QKQK on B200, since their INT8 QKQK needs the INT8 tensor cores of B200, and SageAttention3 and 4-bit VC-Attention on RTX PRO 6000. Our own runs of the two INT8 configurations on B200 reproduce the reported PSNR to within about 1.4 dB (Tab. 23). That of SageAttention2

Table 21 | End-to-end quality without a reference. VBench subject consistency (S.C.), imaging quality (I.Q.), and aesthetic quality (A.Q.) of the videos of Table 2. Blue cells mark the best score within each group with a 4-bit QKQK. The row of FlashAttention-4 holds the reference videos, and the row of cuDNN those of the BF16 attention of cuDNN, the BF16 row of Table 2. †^{\dagger}Means reported by VC-Attention, which does not report A.Q., read against its own BF16 row.

MethodQK/PVWan2.2 S.C.↑Wan2.2 I.Q.↑Wan2.2 A.Q.↑LongCat-Video S.C.↑LongCat-Video I.Q.↑LongCat-Video A.Q.↑HunyuanVideo-1.5 S.C.↑HunyuanVideo-1.5 I.Q.↑HunyuanVideo-1.5 A.Q.↑MiniMax-H3 S.C.↑MiniMax-H3 I.Q.↑MiniMax-H3 A.Q.↑
BF16, FlashAttention-416/160.9300.7000.6690.9380.6830.6780.9220.6720.6590.9050.6860.647
BF16†^{\dagger}16/160.9320.703–0.9410.694–0.9330.680–0.8990.668–
BF16, cuDNN16/160.9310.7000.6680.9380.6840.6790.9240.6700.6580.9040.6860.647
QK16PV816/80.9310.7000.6720.9370.6820.6800.9230.6680.6560.9060.6860.647
Per-tensor FP88/80.9270.6950.6710.9380.6810.6770.9150.6710.6530.9020.6770.644
MXFP88/80.9270.6960.6690.9370.6810.6770.9170.6660.6500.9040.6750.647
SageAttention2†^{\dagger}8/80.9310.703–0.9410.697–0.9310.676–0.8970.671–
w/ FP8 QK8/80.9310.6980.6740.9380.6810.6790.9200.6700.6530.9040.6760.645
VC-Attention†^{\dagger}8/80.9320.705–0.9410.696–0.9310.677–0.8970.669–
w/ FP8 QK8/80.9310.7000.6690.9380.6830.6790.9210.6740.6570.9040.6860.646
NVFP4 QK, FP8 PV4/80.9180.6890.6570.9350.6810.6760.8990.6450.5940.8990.6680.636
Attn-QAT4/80.9190.6840.6610.9110.6580.6130.8950.6420.5910.8960.6690.635
DeCo-Attention (Ours)4/80.9310.6990.6690.9370.6830.6760.9210.6750.6590.9020.6870.647
NVFP44/40.9180.6840.6600.9320.6850.6720.8770.6160.5130.9000.6730.637
SageAttention3†^{\dagger}4/40.9250.697–0.9380.692–0.9270.677–0.9070.686–
VC-Attention, 4-bit†^{\dagger}4/40.9310.707–0.9390.695–0.9340.679–0.9090.686–
DeCo-Attention (Ours)4/40.9320.7000.6710.9390.6820.6800.9200.6760.6560.9050.6900.646

Table 21.

Table 22 | End-to-end motion and prompt alignment without a reference. VBench motion smoothness (M.S.), dynamic degree (D.D., the fraction of videos rated dynamic), and overall consistency (O.C., the similarity of video and prompt) of the runs of Tab. 21. Blue cells mark the best M.S. and O.C. within each group with a 4-bit QKQK, and the D.D. closest to that of BF16 FlashAttention-4.

MethodQK/PVWan2.2 M.S.↑Wan2.2 D.D.Wan2.2 O.C.↑LongCat-Video M.S.↑LongCat-Video D.D.LongCat-Video O.C.↑HunyuanVideo-1.5 M.S.↑HunyuanVideo-1.5 D.D.HunyuanVideo-1.5 O.C.↑MiniMax-H3 M.S.↑MiniMax-H3 D.D.MiniMax-H3 O.C.↑
BF16, FlashAttention-416/160.97660.610.2680.98340.800.2620.98930.740.2660.98870.800.272
BF16, cuDNN16/160.97650.620.2680.98340.800.2630.98940.750.2650.98870.810.272
QK16PV816/80.97650.620.2660.98320.810.2630.98890.750.2630.98880.780.273
Per-tensor FP88/80.97630.610.2680.98310.800.2620.98660.730.2670.98840.760.270
MXFP88/80.97640.600.2690.98300.810.2620.98720.750.2670.98810.770.269
SageAttention2, FP8 QK8/80.97700.610.2690.98320.810.2620.98840.750.2630.98820.780.270
SageAttention, FP8 QK8/80.97650.600.2680.98360.800.2630.98900.720.2650.98870.810.271
NVFP4 QK, FP8 PV4/80.97580.600.2680.98230.820.2620.98120.740.2680.98720.690.269
Attn-QAT4/80.97650.620.2680.97370.600.2530.97870.800.2650.98790.760.270
DeCo-Attention (Ours)4/80.97670.600.2660.98340.800.2630.98880.710.2640.98850.800.271
NVFP44/40.97280.600.2710.97420.840.2610.97000.740.2430.98850.760.268
DeCo-Attention (Ours)4/40.97660.630.2680.98330.800.2620.98810.750.2650.98850.820.270

Table 22.

Table 23 | Reported and reproduced INT8 rows. PSNR (dB) of SageAttention2 and VC-Attention with INT8 QKQK as VC-Attention reports it and as ours on B200 measure it over the 100 prompts. Our runs reproduce the reported values to within about 1.4 dB.

ModelSageAttention2 reportedSageAttention2 oursVC-Attention reportedVC-Attention ours
Wan2.220.3020.0820.5019.78
LongCat-Video23.1022.9323.8025.21
HunyuanVideo-1.515.6015.8817.5017.41
MiniMax-H319.9019.3620.2019.39

Table 23.

differs by about 0.5 dB at most. That of VC-Attention is within 0.1 dB on HunyuanVideo-1.5, 0.7 and 0.8 dB lower on Wan2.2 and MiniMax-H3, and 1.4 dB higher on LongCat-Video. The tables quote the reported values.

End-to-end quality. Each model generates 100 videos for the first 100 prompts of the extended prompt file of MovieGen Bench, with the prompt index as seed and the same initial noise for every method. The kernel under test computes every self-attention call of every layer and step. Each model runs with its official default settings, except that LongCat-Video runs only its first stage at 480p and MiniMax-H3 runs the distilled pipeline of the captures, as in VC-Attention. LPIPS uses AlexNet features. VBench {(citep}(Huang et al., 2024)} scores each video without a reference in six dimensions. Differences between two runs are paired per prompt and given with the 95% Student-t confidence interval of their mean.

Kernel error. We measure the relative L2 error of the attention output against the FP32 attention of the BF16 inputs,

ε=(∑h∥O^h−Oh∥F2∑h∥Oh∥F2)1/2,(32)\varepsilon= \left(\frac{\sum_h \lVert\hat{O}_h - O_h \rVert_F^2}{\sum_h \lVert O_h \rVert_F^2}\right)^{1/2}, \tag*{(32)}

@page 22/30 starts_mid=0 ends_mid=1

Table 21 | End-to-end quality without a reference. VBench subject consistency (S.C.), imaging quality (I.Q.), and aesthetic quality (A.Q.) of the videos of Table 2. Blue cells mark the best score within each group with a 4-bit QKQK. The row of FlashAttention-4 holds the reference videos, and the row of cuDNN those of the BF16 attention of cuDNN, the BF16 row of Table 2. †^{\dagger}Means reported by VC-Attention, which does not report A.Q., read against its own BF16 row.

MethodQK/PVWan2.2 S.C.↑Wan2.2 I.Q.↑Wan2.2 A.Q.↑LongCat-Video S.C.↑LongCat-Video I.Q.↑LongCat-Video A.Q.↑HunyuanVideo-1.5 S.C.↑HunyuanVideo-1.5 I.Q.↑HunyuanVideo-1.5 A.Q.↑MiniMax-H3 S.C.↑MiniMax-H3 I.Q.↑MiniMax-H3 A.Q.↑
BF16, FlashAttention-416/160.9300.7000.6690.9380.6830.6780.9220.6720.6590.9050.6860.647
BF16†^{\dagger}16/160.9320.703–0.9410.694–0.9330.680–0.8990.668–
BF16, cuDNN16/160.9310.7000.6680.9380.6840.6790.9240.6700.6580.9040.6860.647
QK16PV816/80.9310.7000.6720.9370.6820.6800.9230.6680.6560.9060.6860.647
Per-tensor FP88/80.9270.6950.6710.9380.6810.6770.9150.6710.6530.9020.6770.644
MXFP88/80.9270.6960.6690.9370.6810.6770.9170.6660.6500.9040.6750.647
SageAttention2†^{\dagger}8/80.9310.703–0.9410.697–0.9310.676–0.8970.671–
w/ FP8 QK8/80.9310.6980.6740.9380.6810.6790.9200.6700.6530.9040.6760.645
VC-Attention†^{\dagger}8/80.9320.705–0.9410.696–0.9310.677–0.8970.669–
w/ FP8 QK8/80.9310.7000.6690.9380.6830.6790.9210.6740.6570.9040.6860.646
NVFP4 QK, FP8 PV4/80.9180.6890.6570.9350.6810.6760.8990.6450.5940.8990.6680.636
Attn-QAT4/80.9190.6840.6610.9110.6580.6130.8950.6420.5910.8960.6690.635
DeCo-Attention (Ours)4/80.9310.6990.6690.9370.6830.6760.9210.6750.6590.9020.6870.647
NVFP44/40.9180.6840.6600.9320.6850.6720.8770.6160.5130.9000.6730.637
SageAttention3†^{\dagger}4/40.9250.697–0.9380.692–0.9270.677–0.9070.686–
VC-Attention, 4-bit†^{\dagger}4/40.9310.707–0.9390.695–0.9340.679–0.9090.686–
DeCo-Attention (Ours)4/40.9320.7000.6710.9390.6820.6800.9200.6760.6560.9050.6900.646

Table 21 (PDF p. 22).

Table 22 | End-to-end motion and prompt alignment without a reference. VBench motion smoothness (M.S.), dynamic degree (D.D., the fraction of videos rated dynamic), and overall consistency (O.C., the similarity of video and prompt) of the runs of Tab. 21. Blue cells mark the best M.S. and O.C. within each group with a 4-bit QKQK, and the D.D. closest to that of BF16 FlashAttention-4.

MethodQK/PVWan2.2 M.S.↑Wan2.2 D.D.Wan2.2 O.C.↑LongCat-Video M.S.↑LongCat-Video D.D.LongCat-Video O.C.↑HunyuanVideo-1.5 M.S.↑HunyuanVideo-1.5 D.D.HunyuanVideo-1.5 O.C.↑MiniMax-H3 M.S.↑MiniMax-H3 D.D.MiniMax-H3 O.C.↑
BF16, FlashAttention-416/160.97660.610.2680.98340.800.2620.98930.740.2660.98870.800.272
BF16, cuDNN16/160.97650.620.2680.98340.800.2630.98940.750.2650.98870.810.272
QK16PV816/80.97650.620.2660.98320.810.2630.98890.750.2630.98880.780.273
Per-tensor FP88/80.97630.610.2680.98310.800.2620.98660.730.2670.98840.760.270
MXFP88/80.97640.600.2690.98300.810.2620.98720.750.2670.98810.770.269
SageAttention2, FP8 QK8/80.97700.610.2690.98320.810.2620.98840.750.2630.98820.780.270
SageAttention, FP8 QK8/80.97650.600.2680.98360.800.2630.98900.720.2650.98870.810.271
NVFP4 QK, FP8 PV4/80.97580.600.2680.98230.820.2620.98120.740.2680.98720.690.269
Attn-QAT4/80.97650.620.2680.97370.600.2530.97870.800.2650.98790.760.270
DeCo-Attention (Ours)4/80.97670.600.2660.98340.800.2630.98880.710.2640.98850.800.271
NVFP44/40.97280.600.2710.97420.840.2610.97000.740.2430.98850.760.268
DeCo-Attention (Ours)4/40.97660.630.2680.98330.800.2620.98810.750.2650.98850.820.270

Table 22 (PDF p. 22).

Table 23 | Reported and reproduced INT8 rows. PSNR (dB) of SageAttention2 and VC-Attention with INT8 QKQK as VC-Attention reports it and as ours on B200 measure it over the 100 prompts. Our runs reproduce the reported values to within about 1.4 dB.

ModelSageAttention2 reportedSageAttention2 oursVC-Attention reportedVC-Attention ours
Wan2.220.3020.0820.5019.78
LongCat-Video23.1022.9323.8025.21
HunyuanVideo-1.515.6015.8817.5017.41
MiniMax-H319.9019.3620.2019.39

Table 23 (PDF p. 22).

differs by about 0.5 dB at most. That of VC-Attention is within 0.1 dB on HunyuanVideo-1.5, 0.7 and 0.8 dB lower on Wan2.2 and MiniMax-H3, and 1.4 dB higher on LongCat-Video. The tables quote the reported values.

End-to-end quality. Each model generates 100 videos for the first 100 prompts of the extended prompt file of MovieGen Bench, with the prompt index as seed and the same initial noise for every method. The kernel under test computes every self-attention call of every layer and step. Each model runs with its official default settings, except that LongCat-Video runs only its first stage at 480p and MiniMax-H3 runs the distilled pipeline of the captures, as in VC-Attention. LPIPS uses AlexNet features. VBench (Huang et al., 2024) scores each video without a reference in six dimensions. Differences between two runs are paired per prompt and given with the 95% Student-t confidence interval of their mean.

Kernel error. We measure the relative L2 error of the attention output against the FP32 attention of the BF16 inputs,

ε=(∑h∥O^h−Oh∥F2∑h∥Oh∥F2)1/2,(33)\varepsilon= \left(\frac{\sum_h \lVert\hat{O}_h - O_h \rVert_F^2}{\sum_h \lVert O_h \rVert_F^2}\right)^{1/2}, \tag*{(33)}

where OhO_h and O^h\hat{O}_h are the reference and the output under test of head hh on the same 1024 query rows, 16 random blocks of 64 rows. We report the mean over the hard layers and over all layers. The errors come from the GB300 kernels, except those of the INT8 kernels, which run on B200, and of SageAttention3 and 4-bit VC-Attention, which run on RTX PRO 6000.

We time it in the same way, and Table 27 gives its median. For VC-Attention, this is the time of a step that reuses its grouping. A step that groups again with kk-means takes about an order of magnitude longer. The 1.67× of § 5.4 comes from a separate measurement with the SM clock fixed at 1500 MHz, in which the kernel takes 101.1 ms without the four steps of Table 5 and 60.5 ms with them (Table 28). Table 5 itself is at the default clock.

KernelTime (ms)Speedup of the optimizations
Our kernel, compensation only101.1—
+ All four optimizations60.51.67×
FP8-QK reference98.9—
+ All four optimizations69.41.43×

Table 28. Softmax optimizations at a fixed clock. Time of the FP8-PVPV kernel of DeCo-Attention and of the FP8-QKQK reference on a Wan2.2 call on GB300 with the SM clock fixed at 1500 MHz, without the four optimizations of Table 5 and with all of them. At a fixed clock the four optimizations speed our kernel up 1.67×.

Emulation. The accuracy ablations emulate the GB300 kernels of DeCo-Attention in PyTorch and Triton. The emulation forms Q′Q', K′K', and the smoothed VV from the same sampled tokens as the preparation, runs the online softmax at T=4T = 4 with I-ExpCast, and takes the sums of PP as the kernels do. It computes the basis in FP64 and the rescale factors of the online softmax and the final division exactly, whereas the kernels use their own eigensolver and approximate instructions. For the settings that also exist as kernel builds, the emulation reproduces the call error of the kernel to within 0.25% of its value.

End-to-end time. The time of a generation is the time that TensorRT-LLM VisualGen reports for a request, from the prompt to the decoded video, as the mean over prompts 1–7 after a warm-up generation. The methods of a model run one after another on the same GPU or host. The BF16 run uses the BF16 attention of cuDNN on GB300 and VR200 and the FA2 prefill of FlashInfer on RTX PRO 6000.

Kernel time. We time the attention kernel alone, at the default clock of the GPU and at the batch of the real call, on four captures per model, two of hard layers and two of other layers. Each kernel runs after a warm-up, in two passes with the methods in opposite order. We report the median over the captures and the passes. The speedup is over the fastest BF16 kernel of the same session. A kernel that runs only together with the quantization of its operands is timed in the profiler. The preparation of a method is its work outside the kernel, the quantization of the operands and, where the method has them, the smoothing, rotation, compensation, and grouping.

Accuracy

We show that DeCo-Attention keeps the VBench scores of BF16 attention, that the paired differences per prompt give the ranking of § 5, and that it has the lowest worst-case kernel error among the kernels with a 4-bit QKQK.

Quality without a reference. DeCo-Attention keeps the VBench scores of BF16 attention (Tabs. 21 and 22). Among the runs with a 4-bit QKQK, it has the best score in 19 of the 24 entries of Tab. 21 and in 13 of the 16 random ranked cells of Tab. 22. Its largest drops in Tab. 21 are from 0.905 to 0.902 (S.C. on MiniMax-H3, FP8 PVPV) and from 0.659 to 0.656 (A.Q. on HunyuanVideo-1.5, NVFP4 PVPV). The three kernels

{#eq:} where $O_h$ and $\hat{O}_h$ are the reference and the output under test of \ldots

with an uncompensated NVFP4 QKQK lose much more. On HunyuanVideo-1.5, their aesthetic quality is 0.594, 0.591, and 0.513, and their motion smoothness is 0.9812, 0.9787, and 0.9700, against 0.9893 for the reference and 0.9888 and 0.9881 for DeCo-Attention. The BF16 attention of cuDNN

shows that the fidelity metrics also measure the drift of the sampling trajectory. Its PSNR against the reference is only 24.54 dB on Wan2.2, yet its VBench scores are 0.931, 0.700, and 0.668 against 0.930, 0.700, and 0.669.

Paired differences. Table 24 and Table 25 compare each method with DeCo-Attention prompt by prompt, with FP8 PVPV and with NVFP4 PVPV. A difference is significant when its 95% confidence interval excludes zero. Grey entries are significantly worse than DeCo-Attention, bold entries significantly better, and black entries are not significant. Every kernel with an uncompensated 4-bit QKQK is significantly worse than DeCo-Attention on every model. With FP8 PVPV, DeCo-Attention has a significantly lower LPIPS than per-tensor FP8, MXFP8, and SageAttention2 with FP8 QKQK on every model. Against VC-Attention with FP8 QKQK, one difference is significant in each direction, in favor of DeCo-Attention on Wan2.2 and of VC-Attention on MiniMax-H3. With NVFP4 PVPV, no difference to SageAttention2 with FP8 QKQK is significant on any model, and the PSNR of DeCo-Attention is 0.97 to 1.17 dB below that of VC-Attention with FP8 QKQK. Its PSNR is 1.95 to 6.15 dB above that of SageAttention3 on every model, all significant, and above that of 4-bit VC-Attention on every model, significant on LongCat-Video and MiniMax-H3 with 3.67 and 1.22 dB.

MethodQK/PVWan2.2 Δ\DeltaPSNRWan2.2 Δ\DeltaLPIPSLongCat-Video Δ\DeltaPSNRLongCat-Video Δ\DeltaLPIPSHunyuanVideo-1.5 Δ\DeltaPSNRHunyuanVideo-1.5 Δ\DeltaLPIPSMiniMax-H3 Δ\DeltaPSNRMiniMax-H3 Δ\DeltaLPIPS
QK16PV816/8+1.24 ± 0.58-0.019 ± 0.017+0.97 ± 0.64-0.008 ± 0.013+0.07 ± 0.40-0.003 ± 0.018+2.97 ± 0.47-0.112 ± 0.017
Per-tensor FP8-1.47 ± 0.47+0.067 ± 0.017-2.02 ± 0.65+0.049 ± 0.015-1.08 ± 0.37+0.054 ± 0.017-0.09 ± 0.37+0.027 ± 0.015
MXFP8-1.41 ± 0.47+0.061 ± 0.017-2.03 ± 0.55+0.047 ± 0.014-1.91 ± 0.38+0.096 ± 0.019-0.37 ± 0.35+0.035 ± 0.015
SageAttention2, FP8 QK8/8-1.97 ± 0.50+0.077 ± 0.019-1.72 ± 0.58+0.043 ± 0.015-1.23 ± 0.35+0.055 ± 0.017-0.24 ± 0.36+0.026 ± 0.015
VC-Attention, FP8 QK-0.90 ± 0.48+0.034 ± 0.017-0.30 ± 0.60+0.013 ± 0.017+0.14 ± 0.40-0.013 ± 0.017+0.48 ± 0.38-0.020 ± 0.017
NVFP4 QK, FP8 PV4/8-4.09 ± 0.56+0.201 ± 0.019-4.68 ± 0.63+0.143 ± 0.017-4.08 ± 0.42+0.226 ± 0.018-2.75 ± 0.41+0.155 ± 0.018
Attn-QAT-4.09 ± 0.54+0.204 ± 0.019-5.68 ± 0.70+0.258 ± 0.017-5.82 ± 0.50+0.316 ± 0.021-2.06 ± 0.35+0.122 ± 0.016

Table 24. Paired end-to-end differences with FP8 PV. PSNR (dB) and LPIPS of each method minus those of DeCo-Attention with FP8 PVPV on the same prompt, as the mean over the 100 prompts with the half width of its 95% confidence interval. Beyond its interval, a bold entry is better than DeCo-Attention and a grey entry worse. A black entry has an interval that contains zero. Table 2 holds the absolute values.

MethodQK/PVWan2.2 Δ\DeltaPSNRWan2.2 Δ\DeltaLPIPSLongCat-Video Δ\DeltaPSNRLongCat-Video Δ\DeltaLPIPSHunyuanVideo-1.5 Δ\DeltaPSNRHunyuanVideo-1.5 Δ\DeltaLPIPSMiniMax-H3 Δ\DeltaPSNRMiniMax-H3 Δ\DeltaLPIPS
SageAttention2, FP8 QK8/8+0.09 ± 0.43+0.001 ± 0.017-0.35 ± 0.40+0.013 ± 0.014-0.21 ± 0.38+0.012 ± 0.018+0.26 ± 0.29+0.003 ± 0.013
VC-Attention, FP8 QK+1.17 ± 0.51-0.042 ± 0.020+1.07 ± 0.60-0.017 ± 0.017+1.16 ± 0.39-0.056 ± 0.018+0.97 ± 0.41-0.042 ± 0.017
NVFP44/4-4.95 ± 0.61+0.253 ± 0.023-8.05 ± 0.61+0.301 ± 0.020-6.90 ± 0.52+0.378 ± 0.022-2.88 ± 0.37+0.148 ± 0.017
SageAttention3-3.77 ± 2.44+0.119 ± 0.037-6.15 ± 2.00+0.180 ± 0.048-5.62 ± 1.71+0.310 ± 0.089-1.95 ± 1.27+0.093 ± 0.060
VC-Attention, 4-bit-1.21 ± 1.78+0.053 ± 0.069-3.67 ± 1.50+0.105 ± 0.046-0.57 ± 1.12+0.029 ± 0.058-1.22 ± 1.14+0.079 ± 0.062

Table 25. Paired end-to-end differences with NVFP4 PV. PSNR (dB) and LPIPS of each method minus those of DeCo-Attention with NVFP4 PVPV, as in Table 24. SageAttention3 and 4-bit VC-Attention are paired on prompts 0 to 7. Table 2 holds the absolute values.

Every kernel. Table 26 extends Table 3 to every kernel and adds the maximum over the calls. DeCo-Attention has the lowest mean and maximum among the kernels with a 4-bit QKQK. With FP8 PVPV, its worst call on the hard layers of Wan2.2 has 3.74%, against 47.44% for NVFP4 QKQK with FP8 PVPV. With NVFP4 PVPV, it has 6.79%, against 36.02% for SageAttention3 and 35.67% for 4-bit VC-Attention. Against the kernels with an FP8 QKQK, the fully 4-bit DeCo-Attention has a lower mean error than SageAttention2 on the hard layers, 5.68% against 13.03% on Wan2.2 and 8.24% against 21.23% on MiniMax-H3, and a higher one over all layers, 5.09% against 4.10% and 5.67% against 4.55%. VC-Attention with FP8 QKQK keeps the lowest mean error over all layers, 2.64% and 2.85%, below both configurations of DeCo-Attention.

MethodQK/PVWan2.2 HardWan2.2 AllMiniMax-H3 HardMiniMax-H3 All
BF1616/160.15 / 0.170.17 / 0.190.17 / 0.200.17 / 0.19
QK16PV816/81.90 / 2.281.20 / 2.271.76 / 2.171.27 / 2.03
Per-tensor FP820.29 / 35.185.29 / 29.6921.42 / 56.525.14 / 46.44
MXFP818.21 / 33.284.81 / 33.1621.87 / 57.124.95 / 48.17
SageAttention22.18 / 2.791.37 / 2.433.32 / 5.421.52 / 4.68
w/ FP8 QK8/813.03 / 26.294.10 / 26.6421.23 / 56.424.55 / 44.85
VC-Attention1.83 / 2.321.57 / 2.821.93 / 2.431.46 / 2.15
w/ FP8 QK3.67 / 5.782.64 / 5.256.65 / 11.882.85 / 9.51
NVFP4 QK, FP8 PV30.56 / 47.4410.57 / 47.1928.92 / 59.9010.69 / 50.58
Attn-QAT4/830.19 / 46.4110.60 / 45.9928.25 / 63.3011.10 / 53.43
DeCo-Attention (Ours)2.80 / 3.743.73 / 5.506.32 / 10.524.40 / 7.79
NVFP431.46 / 47.6312.97 / 47.1830.02 / 64.5313.87 / 54.65
SageAttention321.86 / 36.029.19 / 34.9024.07 / 53.678.96 / 45.02
VC-Attention, 4-bit4/421.06 / 35.678.52 / 34.5423.46 / 53.488.05 / 44.86
DeCo-Attention (Ours)5.68 / 6.795.09 / 7.818.24 / 11.375.67 / 9.36

Table 26. Accuracy of every kernel. Relative L2 error (%) of every method, as mean / maximum over the hard layers and over all layers. The hard layers are captured at three times as many steps as all layers, so the two columns hold different calls. SageAttention2 and VC-Attention use their default INT8 QKQK on B200, and their rows w/ FP8 QKQK run on GB300. Blue marks the lowest error of each 4-bit-QKQK group.

Performance

We show that DeCo-Attention has the shortest attention time and the shortest generation on every GPU and model.

Kernel speed. Table 27 and Table 29 give the times behind Figure 7. With FP8 PVPV, a Wan2.2 call takes 57.5 ms on GB300 and 29.2 ms on VR200. The fastest baseline is the fully 4-bit NVFP4 kernel with 74.8 ms on GB300 and per-tensor FP8 with 43.7 ms on VR200. With NVFP4 PVPV on RTX PRO 6000, the call takes 234.0 ms, against 253.0 ms for SageAttention3 and 262.1 ms for 4-bit VC-Attention.

MethodQK/PVWan2.2MiniMax-H3
BF1616/16660.3 (1.00×)444.0 (1.00×)
SageAttention3253.0 (2.61×)165.3 (2.69×)
VC-Attention, 4-bit4/4262.1 (2.52×)170.1 (2.61×)
DeCo-Attention (Ours)234.0 (2.82×)155.1 (2.86×)

Table 29. Kernel speed on RTX PRO 6000. Attention time (ms) with the speedup over BF16 attention. Blue marks the shortest time.

End-to-end speed. Table 30 gives the generation times. With FP8 PVPV, a Wan2.2 generation takes 194.7 s on GB300 and 108.0 s on VR200, 1.55× and 1.68× faster than with BF16 attention, against 237.8 s and 142.9 s for VC-Attention with FP8 QKQK. On RTX PRO 6000, it takes 900.8 s with NVFP4 PVPV, 1.80× faster, against 983.9 s for SageAttention3. The BF16 run of Wan2.2 on GB300 takes 302.7 s, and its attention takes 67.6% of a traced denoising step, the two numbers of the introduction.

MethodWan2.2MiniMax-H3
GB300
BF16302.7 (1.00×)51.9 (1.00×)
VC-Attention, FP8 QK237.8 (1.27×)41.3 (1.26×)
SageAttention2, FP8 QK270.4 (1.12×)46.2 (1.12×)
DeCo-Attention, FP8 PV (Ours)194.7 (1.55×)33.6 (1.54×)
VR200
BF16181.0 (1.00×)32.2 (1.00×)
VC-Attention, FP8 QK142.9 (1.27×)24.8 (1.30×)
SageAttention2, FP8 QK149.2 (1.21×)25.4 (1.27×)
DeCo-Attention, FP8 PV (Ours)108.0 (1.68×)19.1 (1.69×)
RTX PRO 6000
BF161619.1 (1.00×)269.7 (1.00×)
SageAttention3983.9 (1.65×)168.3 (1.60×)
VC-Attention, 4-bit1111.7 (1.46×)188.8 (1.43×)
DeCo-Attention, NVFP4 PV (Ours)900.8 (1.80×)151.3 (1.78×)

Table 30. End-to-end speed. Time (s) of a whole generation in Wan2.2-T2V-MiniMax-H3 with the speedup over BF16 attention on the same GPU. Blue marks the shortest time on each GPU.

Generated Videos

Figure 11 to Figure 14 show the videos that each model generates from one prompt, five frames per row. The upper block of each figure holds BF16 FlashAttention-4 and the GB300 runs of Table 2. The lower block holds our runs of the fully 4-bit methods on RTX PRO 6000 next to BF16 attention on the same GPU, the FA2 prefill of FlashInfer, with the protocol and seeds of the GB300 runs. In these runs, 4-bit VC-Attention groups the tokens of each call again on every denoising step. The PSNR above a row is that of the whole clip against the BF16 row of its block. The four prompts of MovieGen Bench follow.

Videos of Wan2.2-T2V-A14B

Figure 11. “A cinematic wide-angle portrait of a man with his face illuminated by the warm glow of a TV screen. . . . A wide-angle shot capturing the man’s intense gaze and the warm ambiance of the room.”

Figure 11 | Videos of Wan2.2-T2V-A14B. Prompt 90 of MovieGen Bench, frames 0, 20, 40, 60, and 80 of 81. The upper block runs on GB300 and the lower block on RTX PRO 6000, with the PSNR of each clip against BF16 attention on the same GPU.

GB300, PSNR against BF16 FlashAttention-4 on the same GPU. BF16 FlashAttention-4, PSNR reference. DeCo-Attention, FP8 PV, PSNR 23.77 dB. SageAttention2, FP8 QK, PSNR 17.27 dB. VC-Attention, FP8 QK, PSNR 19.52 dB. RTX PRO 6000, PSNR against BF16 FlashInfer FA2 on the same GPU. BF16 FlashInfer FA2, PSNR reference. DeCo-Attention, NVFP4 PV, PSNR 20.47 dB. SageAttention3, PSNR 16.52 dB. VC-Attention, 4-bit, PSNR 17.82 dB.

Figure 14. “A cinematic film shot in 70mm, capturing an extreme close-up of a 24-year-old woman’s eye as it blinks. . . . A medium shot with a slightly elevated perspective, highlighting the natural movement of her eye.” Videos of MiniMax-H3. Prompt 11 of MovieGen Bench, frames 0, 60, 121, 181, and 242 of 243. The upper block runs on GB300 and the lower block on RTX PRO 6000, with the PSNR of each clip against BF16 attention on the same GPU.

  • Wan2.2-T2V-A14B. Prompt 90: “A cinematic wide-angle portrait of a man with his face illuminated by the warm glow of a TV screen. The man, with a rugged yet determined expression, leans forward slightly against a vintage wooden armchair. His dark hair is slightly disheveled, and he wears a worn leather jacket over a plain white shirt. The background features a cluttered living room with old books, newspapers, and a few framed photos scattered around. The TV shows static, with a faint image of a news broadcast flickering in the corner. The overall scene has a nostalgic and gritty feel, with a rich color palette and a soft, grainy texture. A wide-angle shot capturing the man’s intense gaze and the warm ambiance of the room.”

  • LongCat-Video. Prompt 48: “A dynamic scene captured in the style of a vibrant food photography, showcasing a chef skillfully chopping onions in a bustling kitchen. The chef, a middle-aged man with a weathered face and determined expression, skillfully slices the onions with quick, practiced movements. He wears a white apron tied neatly around his waist and a chef’s hat perched atop his head. The background is a well-equipped kitchen, with stainless steel appliances and countertops cluttered with various cooking tools and ingredients. Steam rises from a pot on the stove, and sunlight filters through the window, casting a warm glow. A medium shot with the chef at the center, capturing the intensity of his work.”

  • HunyuanVideo-1.5. Prompt 44: “An aerial view of Santorini during the blue hour, capturing the stunning architecture of white Cycladic buildings with blue domes against the twilight sky. The caldera views are breathtaking, with the volcanic cliffs and sea below creating a dramatic contrast. The lighting casts a soft, warm

glow, enhancing the serene atmosphere. The image has a dreamy, almost ethereal quality, emphasizing the beauty of the setting. A bird’s-eye view with a wide-angle lens, focusing on the intricate details of the buildings and the vast expanse of the caldera.”

  • MiniMax-H3. Prompt 11: “A cinematic film shot in 70mm, capturing an extreme close-up of a 24-year-old woman’s eye as it blinks. The scene takes place during magic hour in Marrakech, with the vibrant colors of the setting sun casting warm hues over the bustling streets. The depth of field emphasizes the intricate details of her almond-shaped eyes, which reflect the lively atmosphere of the city. Her eyes, framed by long, dark lashes, are set against a backdrop of bustling market stalls, ornate architecture, and the soft shadows of the setting sun. The background features a blend of rich textures and vibrant colors, creating a sense of depth and immersion. A medium shot with a slightly elevated perspective, highlighting the natural movement of her eye.”

Videos of LongCat-Video showing chef chopping onions across frames and attention implementations

Figure 12. GB300, PSNR against BF16 FlashAttention-4 on the same GPU

BF16 FlashAttention-4   PSNR reference

DeCo-Attention, FP8 PV   PSNR 17.63 dB

SageAttention2, FP8 QK   PSNR 13.54 dB

VC-Attention, FP8 QK   PSNR 11.99 dB

RTX PRO 6000, PSNR against BF16 FlashInfer FA2 on the same GPU

BF16 FlashInfer FA2   PSNR reference

DeCo-Attention, NVFP4 PV   PSNR 16.89 dB

SageAttention3   PSNR 12.36 dB

VC-Attention, 4-bit   PSNR 14.32 dB

“A dynamic scene captured in the style of a vibrant food photography, showcasing a chef skillfully chopping onions in a bustling kitchen. . . . A medium shot with the chef at the center, capturing the intensity of his work.”

Videos of LongCat-Video. Prompt 48 of MovieGen Bench, frames 0, 23, 46, 69, and 92 of 93. The upper block runs on GB300 and the lower block on RTX PRO 6000, with the PSNR of each clip against BF16 attention on the same GPU.

Videos of HunyuanVideo-1.5. GB300 and RTX PRO 6000 video frames comparing BF16 FlashAttention-4, DeCo-Attention, SageAttention2, SageAttention3, and VC-Attention

Figure 13. “An aerial view of Santorini during the blue hour, capturing the stunning architecture of white Cycladic buildings with blue domes against the twilight sky. . . . A bird’s-eye view with a wide-angle lens, focusing on the intricate details of the buildings and the vast expanse of the caldera.”

Figure 13 | Videos of HunyuanVideo-1.5. Prompt 44 of MovieGen Bench, frames 0, 30, 60, 90, and 120 of 121. The upper block runs on GB300 and the lower block on RTX PRO 6000, with the PSNR of each clip against BF16 attention on the same GPU.

References

  1. [1]Alibaba PAI. MiniMax-H3-Acc-LoRAs. Hugging Face model, 2026.
  2. [2]Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L. Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Dan Al- izadeh, Torsten Hoefler, and James Hensman. QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs. In Advances in Neural Information Processing Systems, pp. 100213– 100240, 2024.arxiv.org/abs/2404.00456
  3. [3]Mengzhao Chen, Meng Wu, Hui Jin, Zhihang Yuan, Jing Liu, Chaoyi Zhang, Yunshui Li, Jie Huang, Jin Ma, Zeyue Xue, Zhiheng Liu, Xingyan Bin, and Ping Luo. INT vs. FP: A Comprehensive Study of Fine-Grained Low-Precision Quantization Formats. In International Conference on Machine Learning, pp. 17447–17466, 2026.

Paper details

vlnc:W_6pbp65vj
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 7

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents