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.
Figures & tables
Figure 2: Overview of DeCo-Attention. (a) For every head, Q and K are rotated by a Hadamard matrix H and quantized to NVFP4, leaving the residuals δQ and δK . An eigendecomposition (EVD) of the Gram matrices of 1/256 of the tokens gives the 32 principal directions B . The projections of the residuals and of the quantized operands onto B are appended as NVFP4 compensation channels, so Q′ and K′ have 192 channels. V is smoothed by subtracting its block means Vˉ and quantized to V^ . (b) Per tile, one NVFP4 MMA over Q′ and K′ computes the compensated scores S , I-ExpCast forms P , and the PV MMA returns the output with the row sums ℓ of P through columns of ones appended to V^ . The block means are added back, the softmax rescales lazily, and O is finally divided by ℓ .
Figure 4: Principal residual compensation of QK. Extra channels for the Q -side and the K -side term let one NVFP4 MMA add both terms to the quantized score.
P
Codes from
Instr.
T=0
T=4
T=8
Hard
All
Hard
All
Hard
All
E4M3
exp2 and rounding
8
0.28
0.40
0.43
0.88
1.07
2.72
ExpCast
7
0.44
1.02
1.41
3.26
4.37
8.88
I-ExpCast
6
0.50
0.68
0.54
0.93
1.11
2.72
E2M1
exp2 and rounding
8
1.56
2.01
1.59
2.09
1.69
2.64
Direct-P
4
4.11
5.06
4.11
5.06
4.11
5.06
Table 1: Rounding error of P under the lazy rescale. Relative L2 error (%) on Wan2.2 with only P rounded, per threshold T of the lazy rescale. Instr. counts the instructions per four scores.
Method
QK/PV
Wan2.2
LongCat-Video
HunyuanVideo-1.5
MiniMax-H3
PSNR ↑
SSIM ↑
LPIPS ↓
PSNR ↑
SSIM ↑
LPIPS ↓
PSNR ↑
SSIM ↑
LPIPS ↓
PSNR ↑
SSIM ↑
LPIPS ↓
BF16
16/16
24.54
0.850
0.112
30.09
0.929
0.038
18.98
0.709
0.241
21.40
0.752
0.186
QK16PV8
16/8
20.66
0.748
0.197
23.50
0.817
0.107
16.04
0.601
0.352
20.19
0.717
0.217
Per-tensor FP8
8/8
17.95
0.658
0.283
20.52
0.728
0.164
14.89
0.548
0.410
17.13
0.601
0.356
MXFP8
18.01
0.662
0.278
20.50
0.732
0.163
14.06
0.521
0.451
16.85
0.590
0.365
SageAttention2 †
20.3
0.730
0.206
23.1
0.793
0.122
15.6
0.581
0.382
19.9
0.723
0.252
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 QK . SageAttention2 and VC-Attention use their default INT8 QK on B200, and their rows w/ FP8 QK run on GB300. † Means reported by VC-Attention. With FP8 PV , DeCo-Attention reaches the generation quality of FP8- QK methods.
Method
QK/PV
Wan2.2
MiniMax-H3
Hard
All
Hard
All
BF16
16/16
0.15
0.17
0.17
0.17
SageAttention2, FP8 QK
8/8
13.03
4.10
21.23
4.55
VC-Attention, FP8 QK
3.67
2.64
6.65
2.85
NVFP4 QK, FP8 PV
4/8
30.56
10.57
28.92
10.69
Attn-QAT
30.19
10.60
28.25
11.10
Table 3: Kernel-level accuracy. Relative L2 error (%) of the attention output. Blue marks the lowest error per 4-bit- QK group.
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.
Q-side term
K-side term
Wan2.2
MiniMax-H3
Hard
All
Hard
All
✓
✓
2.80
3.73
6.31
4.40
✓
3.97
4.96
7.30
5.71
✓
18.35
7.27
29.11
9.22
18.70
8.10
29.40
10.00
Table 4: Accuracy ablation. Relative L2 error (%) of DeCo-Attention with FP8 PV without the Q -side term, the K -side term, or both, in emulation.
Kernel
Time (ms)
Speedup
SM clock (MHz)
Error (%)
BF16 attention
124.3
1.00 ×
1537
0.15
NVFP4 QK, FP8 PV
83.8
1.48 ×
2070
30.56
Our kernel, compensation only
79.0
1.57 ×
2017
2.92
+ I-ExpCast
62.2
2.00 ×
1777
2.94
+ Row sum in the PV MMA
57.3
2.17 ×
1612
2.94
+ Lazy rescale, T=4
55.8
2.23 ×
1537
2.95
Table 5: Performance ablation. The optimizations of Sec. 3.3 added one at a time to the DeCo-Attention FP8- PV 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 QK with one scale per tensor.
Appendix figures & tables30 assets
Supplementary material from the paper’s appendix.
Appendix
Compensation
Wan2.2
MiniMax-H3
Hard
All
Hard
All
Keys with ∣ej−eˉ∣>1.0 (%)
×
7.4
1.3
17
4.8
✓
2.1
0.19
5.0
0.32
Attention weight of these keys (%)
×
0.67
0.095
7.1
1.4
✓
0.017
0.0012
0.23
0.015
Error of Eq. 17 , median head (%)
×
5.9
10.5
28.5
18.8
Appendix
Table 6: Error of the first-order approximation. Rotated NVFP4 QK without ( × ) and with (✓) the compensation of DeCo-Attention, P and V exact, on the hard and on all layers of Wan2.2 and MiniMax-H3. The compensation lowers all three quantities.
Rotation
Wan2.2
MiniMax-H3
Hard
All
Hard
All
Direction factor γ
×
1.63
1.20
1.62
1.33
✓
1.02
1.01
1.13
1.03
First-order error energy
×
1.00
1.00
1.00
1.00
✓
0.64
0.85
0.80
0.83
Appendix
Table 7: Residual without and with the rotation. Direction factor γ of Eq. 21 and first-order error energy relative to its value without the rotation, without ( × ) and with (✓) the Hadamard rotation, as medians over the heads and means of the Q and the K side. The rotation brings γ close to 1 and lowers the first-order error energy on every set.
Basis
Tokens
Q -side term, r=
K -side term, r=
16
32
64
16
32
64
separate
all
42.1
25.6
10.7
43.0
26.4
11.3
shared
all
44.6
27.8
11.9
45.7
28.7
12.6
shared (Ours)
1/256
46.9
30.8
14.3
47.8
31.3
14.9
random
none
87.4
74.8
49.6
87.4
74.8
49.6
Appendix
Table 8: First-order terms outside the compensation. Remainder η(r) (%) of Eq. 19 of the Q -side and the K -side term of the rotated NVFP4 QK at r=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 Q and K , 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=32 , a random basis three quarters.
Rotation
Wan2.2
MiniMax-H3
Hard
All
Hard
All
Uncompensated QK
×
30.12
10.29
28.14
10.82
✓
18.57
8.00
30.14
9.98
Compensated QK
×
3.56
3.57
5.45
4.19
✓
2.10
3.45
5.90
4.19
Whole kernel
×
3.94
3.83
5.82
4.40
Appendix
Table 9: Error without and with the rotation. Mean relative L2 error (%) without ( × ) and with (✓) the Hadamard rotation, for QK alone with P and V exact, uncompensated and compensated at r=32 , and for the whole kernel with FP8 PV . The rotation lowers the errors on Wan2.2 and raises those on the hard layers of MiniMax-H3.
Rotation
Wan2.2
MiniMax-H3
Hard
All
Hard
All
First order, compensated
×
30.03
9.75
27.77
10.06
✓
18.47
7.27
29.74
9.13
First order, dropped
×
1.62
3.20
4.35
3.91
✓
1.69
3.29
4.64
3.97
Second-order term
×
1.60
0.74
1.36
0.78
Appendix
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 QK of Tab. 9 , and the last three the compensated QK . The first-order terms are split into those along the r=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.
r
Channels
MMAs
Wan2.2
MiniMax-H3
GB300
VR200
Hard
All
Hard
All
0
128
2
1
18.70
8.10
29.40
10.00
16
160
2
2
3.97
4.77
10.08
5.89
32 (Ours)
192
2
2
2.80
3.73
6.31
4.40
64
256
3
2
2.42
2.81
4.92
3.18
Appendix
Table 11: Rank of the compensation. QK channels, NVFP4 MMAs of the QK per tile on GB300 and VR200, and relative L2 error (%) of DeCo-Attention with FP8 PV , per rank r . r=32 is the largest rank with two MMAs on GB300.
Basis
Tokens
Wan2.2
MiniMax-H3
Hard
All
Hard
All
separate
all
Q
86.0
73.7
93.8
83.2
K
87.4
74.3
96.3
85.1
shared
all
Q
83.8
71.1
92.5
80.8
K
85.4
71.9
95.1
82.7
shared (Ours)
1/256
Q
82.6
68.5
88.9
75.8
Appendix
Table 12: Energy in the basis. Share (%) of the energy of Q and K in the 32 directions of separate bases per operand, of one basis shared by Q and K from all tokens, and of the shared basis from the token sample of the kernels, and the overlap of the leading subspaces of Q and K , as medians over the heads. Sharing and sampling each cost a few points of energy.
Basis
Rotation
Wan2.2
MiniMax-H3
Hard
All
Hard
All
shared (Ours)
✓
2.80
3.73
6.31
4.40
separate
✓
2.91
3.77
5.97
4.35
channels
✓
15.16
6.78
24.99
8.22
channels
×
4.48
4.56
7.75
5.84
random
✓
14.56
6.80
25.74
8.49
Appendix
Table 13: Basis of the compensation. Relative L2 error (%) of DeCo-Attention with FP8 PV with the shared basis, with separate bases BK and BQ 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.
Tokens
Wan2.2
MiniMax-H3
Hard
All
Hard
All
1/256 (Ours)
2.80
3.73
6.31
4.40
1/64
2.77
3.65
6.07
4.26
all
2.77
3.62
5.78
3.99
Appendix
Table 14: Token sample of the basis. Relative L2 error (%) of DeCo-Attention with FP8 PV 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.
PV
Block
Wan2.2
MiniMax-H3
Hard
All
Hard
All
FP8
none
2.95
3.75
6.37
4.44
16
2.66
3.70
6.29
4.38
32
2.73
3.71
6.31
4.39
128 (Ours)
2.80
3.73
6.31
4.40
NVFP4
none
7.50
5.81
9.16
6.55
Appendix
Table 15: Block of the smoothing. Relative L2 error (%) of DeCo-Attention with V as it is (none) and smoothed per block of 16, 32 or 128 keys, per PV format. The smoothing does not lower the error by much with FP8 PV and lowers it most with NVFP4 PV and small blocks.
x = ffma2(s, a, c) h = cvt.f16x2(x) p = ex2.approx.f16x2(h) q = cvt.e4m3x2.f16x2(p)
b = ffma2(s, 8a, c) h = cvt.relu.f16x2(b) y = fma.f16x2(h, 1, 1024) q = prmt(y01, y23)
t = ffma2(s, a, c) w = cvt.pack.sat.u16(t) q = cvt.e4m3x2.f16x2(w)
u = ffma2(s, a, c) q = cvt.relu.e2m1x2.f32(u)
8 instructions
7 instructions
6 instructions
4 instructions
(a) exp2 on the SFU
(b) ExpCast
(c) I-ExpCast
(d) Direct-P
Appendix
Figure 10: Cost of forming P. Instructions that form the codes of P from a pair of scores s 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 a and c fold in the score scale, the row base, and the P 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.
PV
Exponential
Time (ms)
Wan2.2
MiniMax-H3
Hard
All
Hard
All
FP8
I-ExpCast (Ours)
57.83
2.80
3.73
6.32
4.40
ExpCast
60.05 (+3.6%)
3.13
4.82
6.87
5.08
SFU
70.24 (+21.5%)
2.78
3.69
6.27
4.37
SFU and polynomial
72.67 (+25.7%)
2.78
3.69
6.27
4.37
NVFP4
I-ExpCast (Ours)
54.17
5.68
5.09
8.24
5.67
Appendix
Table 16: Forming P in the kernels. Attention time of a Wan2.2 call and relative L2 error (%) of the FP8- PV and NVFP4- PV kernels of DeCo-Attention on GB300 with each way of forming P , 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- PV 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.
Row sum of P
Time (ms)
Wan2.2
MiniMax-H3
Hard
All
Hard
All
PV MMA (Ours)
54.93
2.95
3.75
6.37
4.44
ALU, E4M3 values
58.89 (+7.2%)
2.95
3.75
6.37
4.44
ALU, FP16 values
57.91 (+5.4%)
3.02
3.79
6.44
4.48
Appendix
Table 17: Row sum of P. Attention time of a Wan2.2 call and relative L2 error (%) of the FP8- PV kernel of DeCo-Attention on GB300 with each way of summing P , without the smoothing of V , as the mean over the hard layers and over all layers. The sum in the PV MMA is the fastest and does not cost accuracy.
PV
T
Time (ms)
Wan2.2
MiniMax-H3
Hard
All
Hard
All
FP8
0
59.09 (+2.5%)
2.79
3.70
6.27
4.36
4 (Ours)
57.63
2.80
3.73
6.32
4.40
8
57.36 (-0.5%)
2.99
4.50
6.85
5.05
NVFP4
0
56.63 (+4.5%)
5.67
5.07
8.24
5.65
4 (Ours)
54.19
5.68
5.09
8.24
5.67
Appendix
Table 18: Threshold of the lazy rescale. Attention time of a Wan2.2 call and relative L2 error (%) of the FP8- PV and NVFP4- PV kernels of DeCo-Attention on GB300 at three thresholds T , as the mean over the hard layers and over all layers. T=4 keeps the error of T=0 at nearly the time of T=8 .
Wan2.2
MiniMax-H3
Resolution
720p
1344×768
Frames
81
243, with audio
Tokens per call
75,600
73,512
Heads
40
56
Hard layers
33, 34, 38
49, 45, 1
Hard calls
18
9
Appendix
Table 19: Models and captures of the kernel-level evaluation. Output of each model, size of a self-attention call, and the captured calls.
Method
QK/PV
Source
BF16, FlashAttention-4
16/16
public release
BF16, cuDNN
16/16
TensorRT-LLM
QK16PV8
16/8
TensorRT-LLM
Per-tensor FP8
8/8
TensorRT-LLM
MXFP8
8/8
TensorRT-LLM
SageAttention2, INT8 or FP8 QK
8/8
TensorRT-LLM
Appendix
Table 20: Sources of the implementations. Where the implementation of each method comes from.
Method
QK/PV
Wan2.2
LongCat-Video
HunyuanVideo-1.5
MiniMax-H3
S.C. ↑
I.Q. ↑
A.Q. ↑
S.C. ↑
I.Q. ↑
A.Q. ↑
S.C. ↑
I.Q. ↑
A.Q. ↑
S.C. ↑
I.Q. ↑
A.Q. ↑
BF16, FlashAttention-4
16/16
0.930
0.700
0.669
0.938
0.683
0.678
0.922
0.672
0.659
0.905
0.686
0.647
BF16 †
16/16
0.932
0.703
–
0.941
0.694
–
0.933
0.680
–
0.899
0.668
–
BF16, cuDNN
16/16
0.931
0.700
0.668
0.938
0.684
0.679
0.924
0.670
0.658
0.904
0.686
0.647
QK16PV8
16/8
0.931
0.700
0.672
0.937
0.682
0.680
0.923
0.668
0.656
0.906
0.686
0.647
Per-tensor FP8
8/8
0.927
0.695
0.671
0.938
0.681
0.677
0.915
0.671
0.653
0.902
0.677
0.644
Appendix
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 Tab. 2 . Blue cells mark the best score within each group with a 4-bit QK . 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 Tab. 2 . † Means reported by VC-Attention, which does not report A.Q., read against its own BF16 row.
Method
QK/PV
Wan2.2
LongCat-Video
HunyuanVideo-1.5
MiniMax-H3
M.S. ↑
D.D.
O.C. ↑
M.S. ↑
D.D.
O.C. ↑
M.S. ↑
D.D.
O.C. ↑
M.S. ↑
D.D.
O.C. ↑
BF16, FlashAttention-4
16/16
0.9766
0.61
0.268
0.9834
0.80
0.262
0.9893
0.74
0.266
0.9887
0.80
0.272
BF16, cuDNN
16/16
0.9765
0.62
0.268
0.9834
0.80
0.263
0.9894
0.75
0.265
0.9887
0.81
0.272
QK16PV8
16/8
0.9765
0.62
0.266
0.9832
0.81
0.263
0.9889
0.75
0.263
0.9888
0.78
0.273
Per-tensor FP8
8/8
0.9763
0.61
0.268
0.9831
0.80
0.262
0.9866
0.73
0.267
0.9884
0.76
0.270
MXFP8
0.9764
0.60
0.269
0.9830
0.81
0.262
0.9872
0.75
0.267
0.9881
0.77
0.269
Appendix
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 QK , and the D.D. closest to that of BF16 FlashAttention-4.
Model
SageAttention2
VC-Attention
reported
ours
reported
ours
Wan2.2
20.30
20.08
20.50
19.78
LongCat-Video
23.10
22.93
23.80
25.21
HunyuanVideo-1.5
15.60
15.88
17.50
17.41
MiniMax-H3
19.90
19.36
20.20
19.39
Appendix
Table 23: Reported and reproduced INT8 rows. PSNR (dB) of SageAttention2 and VC-Attention with INT8 QK as VC-Attention reports it and as our runs on B200 measure it over the 100 prompts. Our runs reproduce the reported values to within about 1.4 dB.
Method
QK/PV
Wan2.2
LongCat-Video
HunyuanVideo-1.5
MiniMax-H3
Δ PSNR
Δ LPIPS
Δ PSNR
Δ LPIPS
Δ PSNR
Δ LPIPS
Δ PSNR
Δ LPIPS
QK16PV8
16/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
8/8
-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 QK
-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
Appendix
Table 24: Paired end-to-end differences with FP8 PV. PSNR (dB) and LPIPS of each method minus those of DeCo-Attention with FP8 PV 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.
Method
QK/PV
Wan2.2
LongCat-Video
HunyuanVideo-1.5
MiniMax-H3
Δ PSNR
Δ LPIPS
Δ PSNR
Δ LPIPS
Δ PSNR
Δ LPIPS
Δ PSNR
Δ LPIPS
SageAttention2, FP8 QK
8/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
NVFP4
4/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
Appendix
Table 25: Paired end-to-end differences with NVFP4 PV. PSNR (dB) and LPIPS of each method minus those of DeCo-Attention with NVFP4 PV , as in Tab. 24 . SageAttention3 and 4-bit VC-Attention are paired on prompts 0 to 7. Table 2 holds the absolute values.
Method
QK/PV
Wan2.2
MiniMax-H3
Hard
All
Hard
All
BF16
16/16
0.15 / 0.17
0.17 / 0.19
0.17 / 0.20
0.17 / 0.19
QK16PV8
16/8
1.90 / 2.28
1.20 / 2.27
1.76 / 2.17
1.27 / 2.03
Per-tensor FP8
8/8
20.29 / 35.18
5.29 / 29.69
21.42 / 56.52
5.14 / 46.44
MXFP8
18.21 / 33.28
4.81 / 33.16
21.87 / 57.12
4.95 / 48.17
SageAttention2
2.18 / 2.79
1.37 / 2.43
3.32 / 5.42
1.52 / 4.68
Appendix
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 QK on B200, and their rows w/ FP8 QK run on GB300. Blue marks the lowest error of each 4-bit- QK group.
Method
QK/PV
Backend
GB300
VR200
Wan2.2
MiniMax-H3
Wan2.2
MiniMax-H3
attention
prep.
attention
prep.
attention
prep.
attention
prep.
BF16
16/16
FA4, cuDNN / FA4
122.5 (1.00 × )
0.00
83.5 (1.00 × )
0.00
72.6 (1.00 × )
0.00
50.5 (1.00 × )
0.00
QK16PV8
16/8
TRT-LLM / FlashInfer
102.8 (1.19 × )
0.65
69.8 (1.20 × )
0.46
59.8 (1.22 × )
0.59
41.9 (1.21 × )
0.43
Per-tensor FP8
8/8
FlashInfer / cuDNN
79.2 (1.55 × )
1.95
52.7 (1.58 × )
1.40
43.7 (1.66 × )
1.78
29.0 (1.74 × )
1.30
MXFP8
cuDNN
82.7 (1.50 × )
3.37
54.5 (1.53 × )
2.32
44.2 (1.64 × )
3.51
29.5 (1.72 × )
2.41
Appendix
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- QK group.
Kernel
Time (ms)
Speedup of the optimizations
Our kernel, compensation only
101.1
–
+ All four optimizations
60.5
1.67 ×
FP8-QK reference
98.9
–
+ All four optimizations
69.4
1.43 ×
Appendix
Table 28: Softmax optimizations at a fixed clock. Time of the FP8- PV kernel of DeCo-Attention and of the FP8- QK reference on a Wan2.2 call on GB300 with the SM clock fixed at 1500 MHz, without the four optimizations of Tab. 5 and with all of them. At a fixed clock the four optimizations speed our kernel up 1.67 × .
Method
QK/PV
Wan2.2
MiniMax-H3
BF16
16/16
660.3 (1.00 × )
444.0 (1.00 × )
SageAttention3
4/4
253.0 (2.61 × )
165.3 (2.69 × )
VC-Attention, 4-bit
262.1 (2.52 × )
170.1 (2.61 × )
DeCo-Attention (Ours)
234.0 (2.82 × )
155.1 (2.86 × )
Appendix
Table 29: Kernel speed on RTX PRO 6000. Attention time (ms) with the speedup over BF16 attention. Blue marks the shortest time.
Method
Wan2.2
MiniMax-H3
GB300
BF16
302.7 (1.00 × )
51.9 (1.00 × )
VC-Attention, FP8 QK
237.8 (1.27 × )
41.3 (1.26 × )
SageAttention2, FP8 QK
270.4 (1.12 × )
46.2 (1.12 × )
DeCo-Attention, FP8 PV (Ours)
194.7 (1.55 × )
33.6 (1.54 × )
VR200
Appendix
Table 30: End-to-end speed. Time (s) of a whole generation in TensorRT-LLM VisualGen with the speedup over BF16 attention on the same GPU. Blue marks the shortest time on each GPU.
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.
Figure 12: 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.
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.
Figure 14: 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.
Diffusion Transformers deliver state-of-the-art video generation, but their long spatiotemporal sequences make attention the dominant deployment cost, and a deployable low-bit kernel must be accurate and fast. Accuracy is limited by outliers: a block's quantization scale is set by its largest entries, leaving typical entries confined to a narrow range of representable values. Prior work smooths queries and keys, but value outliers follow no fixed channel or spatiotemporal structure and remain the dominant source of output error. Speed is limited by softmax: low-bit Tensor Cores accelerate only the two matrix multiplications, so the high-precision exponential between them becomes the longest pipeline stage on datacenter GPUs. We propose VC-Attention, a training-free low-bit attention framework that addresses both by pairing Value smoothing with a fused probability Cast. V-Smooth reorders value tokens by lightweight online clustering, so the tokens in a hardware block quantize well together. It quantizes only the residual after subtracting the block mean, and restores that mean from the row sum the online softmax already maintains. ExpCast-FP8 maps log-domain scores directly to E4M3 probability codes with one fused multiply-add, eliminating the FP32 exponential and the format conversion. We implement VC-Attention for B200, B300, H200, RTX PRO 6000, and RTX 5090. Across Wan2.2, LongCat-Video, HunyuanVideo-1.5, and MiniMax-H3, VC-Attention improves fidelity over low-bit baselines, speeds up the attention kernel over BF16 FlashAttention-4 by 1.46-1.59x on datacenter Blackwell and Hopper and by 2.3-3.6x on workstation cards, and generates a clip 1.13-1.19x and 1.36-1.70x faster end to end.
Video generation has broad applications in content creation and entertainment. Diffusion transformers have advanced the quality of generated videos, but attention over spatiotemporal tokens becomes increasingly expensive as video resolution and duration increase. We present DraftAttention2, a training-free framework that uses the low-resolution draft attention map to jointly select attention blocks and assign their numerical precision. Specifically, spatial 2D average- and max-pooled queries and keys capture complementary regional statistics to estimate block importance, and a shared ranking assigns higher precision to important blocks, lower precision to less important retained blocks, and skips the rest under configurable budgets. Our analysis separates sparsification error from attention-weighted quantization error, establishing when recovering skipped interactions with low-bit computation tightens the output-error bound. This analysis motivates retaining more interactions at low precision while reserving higher precision for blocks with larger attention mass. To translate these fine-grained assignments into practical speedups, we further develop fused operand preparation and a single attention kernel with precision-specific phases, sharing data movement, softmax statistics, and output accumulation across precisions. Experiments demonstrate that our method achieves a superior quality-efficiency trade-off over existing efficient video generation methods. Notably, its advantage is particularly pronounced for few-step video diffusion, where jointly combining sparsity with 4- and 8-bit mixed-precision computation substantially improves generation quality while retaining significant acceleration. Code is available at https://github.com/anemoi-project/anemoi
Rui Ding, Haopeng Li, Weize Ma +10
Nanjing University · HKUST(GZ) · Duke University +3
Video diffusion transformers rely on 3D full attention over tens of thousands of spatiotemporal tokens, and its quadratic cost dominates inference latency. Sparse attention reduces this cost, but existing methods face a dilemma: static methods apply predefined masks and cannot capture input-dependent attention, whereas dynamic methods reconstruct the sparse mask repeatedly, paying online to rediscover positional structure that is largely stable across inputs. To this end, we propose PoCoAttn, a training-free sparse attention framework that separates input-stable from input-dependent attention and resolves the former offline and the latter online. PoCoAttn features: (1) A relative-offset analysis of 3D query-key pairs, which shows that video attention decomposes into an input-stable positional prior that carries most of the attention mass and a small content-dependent residual. (2) A position-content collaborative sparse attention mechanism, which retrieves positional keys from offline-calibrated tables, selects content keys online with a head-adaptive ratio between the two sources, and compensates for the discarded keys to approximate full attention. (3) A step-adaptive budget allocation algorithm, which models how early-step sparse attention errors are amplified along the denoising trajectory and derives the optimal sparsity budget per step. Extensive experiments across four video diffusion models and three tasks show that PoCoAttn consistently achieves a better speed-fidelity Pareto frontier than state-of-the-art (SOTA) methods, improving PSNR by 1.9 to 5.0 dB over baselines and delivering up to 4.1× attention and 2.0× denoising speedups over dense FlashAttention-3 attention.