Manuscript Offprint
arXiv:2611.09225Fused-Softmax for efficient quantized attention
Abstract
Low-precision matrix throughput on modern GPUs is growing far faster than vector-arithmetic throughput. Attention therefore cannot realize the available GEMM performance because softmax has become the pipeline bottleneck. We introduce Fused-Softmax Attention, a training-free algorithm that reformulates and approximates softmax to fold its dominant operations into the attention GEMMs, moving work from vector units to matrix cores. Implemented for the AMD CDNA™ 4 architecture, our MXFP8, MXFP6 and MXFP4 kernels reach approximately 3.0, 4.0 and 4.6 PFLOP/s on an AMD Instinct™ MI355X GPU, yielding speedups of 2.1×, 2.8× and 3.2× over the BF16 attention. Importantly, the additional error introduced by Fused-Softmax remains below the error floor set by quantizing the GEMM operands. On Wan2.2-T2V-A14B, a hybrid MXFP6/4 schedule delivers up to 2.05× end-to-end speedup while preserving the visual quality of the outputs. The kernels ship in AMD's open-source AITER library, and they powered AMD's MLPerf® Inference v6.1 Wan2.2 submission, which ran 1.7× faster than AMD's previous-round result on the same hardware. Our results show that redesigning softmax to utilize the matrix pipeline enables attention to capitalize on continued growth in low-precision matrix throughput.
1 Introduction
Transformer attention (Vaswani et al., 2017) is a cornerstone algorithm of modern AI models, but its quadratic complexity in terms of sequence length makes it a computational bottleneck in long-sequence settings. This is particularly relevant in video generation models (Team Wan et al., 2025; Kong et al., 2024; MiniMaxAI, 2026), where higher resolution and longer videos increase the effective sequence length.
The FlashAttention family (Dao et al., 2022; Dao, 2024; Shah et al., 2024) has become the standard approach to map the attention algorithm efficiently to modern GPU hardware. In its latest version, FlashAttention-4 (Zadouri et al., 2026), software pipelining has evolved to overlap the two kinds of work in attention, the matrix multiplies and the vector work of the softmax, exploiting independent execution units in modern datacenter GPUs. However, the throughput of these execution units has scaled asymmetrically across recent datacenter GPU generations, leaving vector throughput far behind and making the softmax the bottleneck.
Related work addresses this bottleneck by reducing the cost and number of the softmax-related vector operations. FlashAttention-4 uses polynomial approximation for part of the exponentials and skips most output rescales. Its follow-ups (Zhang et al., 2026b; Deng et al., 2026) quantize the matrix operands to FP8 and below but leave the softmax unchanged. Two concurrent works, VC-Attention (Li et al., 2026) and Direct-P from FP4 FlashAttention-4 (Hu, 2026), replace the costly exponential with an affine transformation into the quantized probabilities.
*Equal contribution.
In contrast to these works, our proposed method moves most of the softmax work onto the matrix cores and uses a high-quality, in-kernel conversion path to produce quantized probabilities. Our Fused-Softmax pipeline combines the following key features:
-
Freezing the maximum speculatively, which moves the max subtraction into the score GEMM's accumulator and removes the rescaling-related vector work. A gate on the running tile max detects overflow and triggers a rollback, which raises the frozen max and re-shifts the scores.
-
Exponential approximation using the Schraudolph method (Schraudolph, 1999), with the affine transformation folded into the score GEMM's operands alongside the frozen maximum, off the vector unit.
-
A hardware-efficient two-stage conversion to quantized : Stage-A performs the Schraudolph conversion, and Stage-B scales the result to the target format. The running tile max is used to derive the E8M0 scales in the microscaling (MX) format (Open Compute Project, 2023).
-
The row sum is moved out of the vector path and done as an efficient matrix multiply using the quantized .
This leaves only a maximum reduction and two conversions on the vector unit, effectively unlocking the benefits of quantizing the matrix operands to FP8 and lower formats. We implement our pipeline on CDNA 4 and evaluate it on the AMD Instinct™ MI355X GPU. Section 5.1 ablates the accuracy cost of each feature and the operand quantization it enables. We evaluate a progressive series of kernel variants from MXFP8 through MXFP6 to MXFP4. The MXFP8 configuration reaches 2978 TFLOP/s ( BF16), at a cosine similarity of 0.9984. The MXFP6 attention reaches 3973 TFLOP/s ( BF16), at 0.9979. The frontier MXFP4 attention reaches 4586 TFLOP/s ( BF16), at 0.9787.
The kernels are in production: they ship in AITER behind the mha_v4 entrypoint (AMD, 2025), and powered AMD's MLPerf® Inference v6.1 Wan2.2-T2V-A14B submission (Zhang et al., 2026a; Arunachalam et al., 2026), whose single-stream latency fell from the previous round on the same MI355X system, with quantized attention the largest single contributor.
Throughout, uppercase symbols such as and denote matrices, and lowercase symbols such as and denote per-row quantities, which we treat as column vectors that broadcast across the columns of a matrix wherever the two are combined. A subscript on a matrix selects a tile of rows rather than an entry: is the th block of consecutive rows of , the th block of rows of , and a double subscript the block of formed from and . Row-wise reductions are written rowmax and rowsum, each returning one value per row.
2.1 FlashAttention
Let be the query, key and value matrices of one attention head, with the sequence length and the head dimension. Attention computes
(1) with and the softmax taken row-wise.
FlashAttention (Dao et al., 2022; Dao, 2024; Shah et al., 2024) never materializes or in device memory. A workgroup owns a single query tile of rows and loops over the keys and values in tiles of rows, indexed with . Iteration computes the score tile and folds it into the running state by online softmax (Milakov and Gimelshein, 2018; Rabe and Staats, 2021):
The recurrence starts from and , which makes the first rescaling factor vanish and leaves and equal to the contribution of tile 0 alone. Once the loop ends, the output accumulator is normalized by to complete the softmax.
Equation (2) scales the score by the constant , as FlashAttention implementations commonly do to use the hardware's base-two exponential; in this paper the choice carries more weight. It replaces by everywhere downstream and leaves the probabilities untouched, since exactly. Base two is the base the hardware already works in: it is the base of the exponent field of a floating-point number, of the hardware exponential instruction, and of the Schraudolph construction of Section 4.3. Carrying the softmax in base two is what later allows the exponential to be absorbed into a format conversion rather than evaluated.
Subtracting the row maximum before the exponential keeps the exponent and the output accumulator inside the FP32 range, but it is also what couples the iterations: whenever the maximum grows, the accumulated output and the running row sum computed under the old maximum have to be corrected by .
Each iteration therefore contains two GEMMs, and , separated by a body of vector work: the row maximum, the max subtraction, the exponential, the row sum, and the rescaling of and by .
2.2 Asymmetric scaling of matrix and vector throughput
Matrix and vector throughput have not been scaling the same way. As Zadouri et al. (2026) note, successive accelerator generations have spent their power and silicon-area budget on the matrix-multiply units, the components that dominate performance, while the vector units have stayed close to flat. Attention runs into this directly, because the softmax sitting between its two GEMMs is vector work and does not benefit. We quantify the gap on CDNA, and then show that it is not a quirk of CDNA.
Table 1 gives matrix and vector throughput on the last two CDNA generations, per clock per compute unit (CU), taken from the official CDNA 4 whitepaper (Advanced Micro Devices, Inc., 2025).
The matrix core has gained along two independent axes, one generational and the other from the operand format, so a kernel moving from BF16 on CDNA 3 to MXFP6 on CDNA 4 has the matrix throughput. Peak VALU throughput, meanwhile, has stayed flat at 128 elements per clock per CU. On CDNA 4 this leaves the vector-to-matrix throughput ratios at 1:32, 1:64 and 1:128 for BF16, FP8 and FP6/FP4 respectively, and the exponential-to-matrix ratios further behind still, at 1:128, 1:256 and 1:512. Quantizing the operands therefore widens the gap rather than closing it: the faster the format, the further the softmax falls behind.
NVIDIA hardware shows the same pattern. Derived from the published peak dense rates of the Blackwell Ultra GPU in GB300 NVL72 (NVIDIA Corporation, 2025a;b), its vector-to-matrix throughput ratios are 1:62.5 at BF16, 1:125 at FP8 and FP6 and 1:375 at FP4, and the exponential-to-matrix ratios are about 1:234, 1:467 and 1:1402. For both vendors, we use the peak vector operation rate in the ratios, rather than the peak FLOP rate, because the latter only holds by counting a fused multiply-add as two FLOPs (Advanced Micro
Table 1: Throughput evolution on the last two CDNA generations. Matrix, vector arithmetic logic unit (VALU), and exponential rows are ops/clock/CU; the local data share (LDS) row is bytes/clock/CU.
| Unit | CDNA 3 | CDNA 4 | Gain |
|---|---|---|---|
| Matrix, BF16 | 2048 | 4096 | |
| Matrix, FP8 | 4096 | 8192 | |
| Matrix, MXFP6/FP4 | — | 16384 | — |
| Vector ALU | 128 | 128 | |
| Exponential unit | 16 | 32 | |
| LDS read (bytes) | 128 | 256 |
Devices, Inc., 2025; NVIDIA Corporation, 2025c), and does not generalize to the softmax vector operations of Section 3.2. The two architectures make different trade-offs, but both place the vector work rate, and the exponential rate in particular, well below the matrix rate once the operands are quantized, so the softmax bottleneck described in this paper is not specific to CDNA 4.
2.3 Related work addressing the softmax bottleneck
FlashAttention-4 (Zadouri et al., 2026) attacks the exponential and the output rescaling. Part of the exponentials is emulated on the vector units, which on NVIDIA hardware run alongside a separate exponential unit: the integer part is evaluated exactly with the Schraudolph construction (Schraudolph, 1999), and a third-degree polynomial approximates the fractional part. FlashAttention-4 targets BF16 attention. We use the same Schraudolph construction, but with a linear fractional part: we find its error small next to that of quantizing the attention inputs (Section 5.1), and the transformation being affine, it can be folded into the score GEMM operands (Section 4.3).
For the output rescaling, FlashAttention-4 keeps a stale row maximum and rescales the output only when the running maximum exceeds it by more than a threshold set to ensure numerical stability; otherwise the stale row maximum is used to shift the scores and the output rescaling can be omitted. Our frozen maximum (Section 4.1) achieves the same skipping of the output rescaling, but more importantly, moving the frozen maximum subtraction speculatively before the score GEMM is what enables our affine Schraudolph transformation to be fused to the score GEMM (Section 4.3). The rollback scheme (Section 4.1) is what ensures the numerical stability for us.
Ping-pong pipelining, introduced for attention by FlashAttention-3 (Shah et al., 2024) and kept by FlashAttention-4, phase-shifts two groups of warps so that one runs its GEMMs while the other runs its softmax. The producer/consumer split FlashAttention-3 pairs with it does not carry over to CDNA, where registers are allocated statically and a producer wave would hold a full register budget while doing no arithmetic. HipKittens (Hu et al., 2026) replaces it with an eight-wave ping-pong, which we adopt (Figure 1): a workgroup spans the four single-instruction multiple-data (SIMD) units of a CU, waves 0–3 and 4–7 form two groups that share a SIMD pairwise, and a barrier holds a phase offset so one group's vector instructions issue while the other's matrix fused multiply–add (MFMA) instructions are in flight.
The SageAttention series (Zhang et al., 2025c;a;b) quantizes the attention GEMMs progressively from INT8 to INT4 for QK and FP8 to FP4 for PV. Several follow-ups to FlashAttention-4 quantize its GEMMs to FP8 and below. Attn-QAT (Zhang et al., 2026b) quantizes QK to FP8 or FP4 and PV to FP8, and recovers the accuracy lost at 4 bits by fine-tuning the model with quantization-aware training. These approaches leave softmax unchanged. At sub-FP8 precision, softmax becomes the throughput-limiting stage in the ping-pong

Figure 1: Eight-wave ping-pong schedule on four SIMDs. Waves 0–3 and 4–7 form phase-shifted groups: each wave overlaps its matrix operations with its SIMD partner’s softmax, and barriers preserve the phase offset across tiles.
pipeline on modern datacenter GPUs.
Two concurrent works target the slow part of the softmax by replacing the exponential with an affine transformation. Direct-P (Hu, 2026) maps the scores with a fitted linear function into MXFP4 probabilities, which relies heavily on that format having only a few representable levels. VC-Attention (Li et al., 2026) evaluates the exponential with Schraudolph’s construction (Schraudolph, 1999) and reads the result as an FP8 probability in one conversion. That single conversion to an 8-bit integer covers only a narrow range of the exponential; Sections 4.2 and 5.1 find the same 8-bit proxy too costly in accuracy in our pipeline. In both methods the affine transformation, the row maximum and the row sum stay on the vector units.
MXAttention (Yu et al., 2026) targets accuracy rather than throughput. Accumulating the output with quantized probabilities while normalizing with a higher-precision row sum biases the result; using the quantized probabilities for both removes the bias. Our row sum, computed as a matrix product of those probabilities, does the same (Section 4.4).
3 Motivation: softmax bottlenecks below FP8
Here we estimate the matrix, vector, and memory work cost of FlashAttention on MI355X. We use our implementation’s actual tile sizes , , and , and the Section 2.2 rates to derive the clock cycle costs.
3.1 GEMM roofline
One iteration of the inner loop of FlashAttention performs two matrix multiplications, and . Each matrix multiply requires operations, so using the Section 2.2 rates the two cost
clock cycles for FP8 and FP6/FP4, respectively. Narrowing from FP8 to FP6/FP4 halves the matrix cost. FP6/FP4 GEMMs share a rate on CDNA 4. FP4 earns its place on memory bandwidth and register usage reduction rather than on matrix throughput.
3.2 VALU roofline
The softmax processes the score elements: it computes the row maximum, scales and subtracts that maximum, exponentiates, sums each row, and converts to the format consumed by the . Output rescaling acts on accumulator elements.
Using the ideal throughput of packed instructions of 128 elements per clock per CU for the four passes over the score tile (max, max subtraction, row sum and conversion) and for the output rescale, and 32 for the exponential, we get
clock cycles for the vector work, of which the exponential alone accounts for 1024 — the entire FP6/FP4 matrix time.
3.3 Memory bandwidth roofline
The operands have to reach the matrix cores before they can be multiplied, over two hops: high-bandwidth memory (HBM) into LDS, and LDS into registers. Dividing the bytes each tile moves by the bandwidth available per CU gives, at FP8, FP6 and FP4, about 2517, 1887 and 1258 clock cycles from HBM to LDS () without any cache reuse, and 1024, 768 and 512 clock cycles from LDS into the registers () (Appendix D gives the derivation). Double buffering allows HBM transfers to prefetch the next tile while the current one is computed, and LDS reads are interleaved with matrix execution.
Table 2 summarizes the per-tile HBM, LDS, matrix, and vector clock cycle costs. The vector work exceeds the matrix time at FP8 and costs as much at FP6/FP4. HBM transfers and LDS reads are able to hide under computation.
Table 2: Per-tile roofline, in clock cycles.
| FP8 | FP6 | FP4 | |
|---|---|---|---|
| 2517 | 1887 | 1258 | |
| 1024 | 768 | 512 | |
| 2048 | 1024 | 1024 | |
| 2304 | 2304 | 2304 | |
| 1.125× | 2.25× | 2.25× |
Algorithm 1 Fused-Softmax Attention for one query tile . Matrix-core lines are tinted red and vector-unit lines green.
1: , 2: 3: 4: , 5: for do 6: 7: 8: if any() then 9: 10: where 11: , 12: , 13: 14: end if 15: 16: 17: 18: 19: end for 20:
4 Fused-Softmax Attention
Fused-Softmax Attention removes most of the softmax's vector work from the steady-state loop by folding it into the two GEMMs and a format conversion. The maximum is frozen speculatively and subtracted inside the score GEMM, so the output and the row sum are never rescaled unless a later tile overflows, in which case an exact rollback restores them. The exponential is approximated by Schraudolph's affine map, carried by the score GEMM's MX scale and the subtraction, and so reduces to a conversion; a second conversion quantizes , and the block maxima computed along the way supply both the overflow gate and the MX scales of . The row sum leaves the vector unit as well, evaluated as a matrix multiply over the quantized probabilities. In the steady state the vector unit runs only the block-maximum reduction and the two conversions.
We adopt the eight-wave ping-pong of Section 2.3, the CDNA form of the pipeline FlashAttention-3 introduced and FlashAttention-4 kept, and fuse the softmax into it. Data movement uses the same two-group split: the groups cooperatively prefetch and into free LDS slots while computing on the tiles already resident in the others (Figure 2). Waves 0–3 fetch and waves 4–7 fetch , each one tile ahead into a two-slot ring, so a transfer for the next tile is in flight for the whole of the current one, and a barrier publishes each slot before it is read.
Algorithm 1 states the computation for one query tile , in terms of Eqs. (3)–(6). is preprocessed as before quantization. Hats denote MX elements and their E8M0 scales, e.g. and . and are the fused Schraudolph scales and bias, matching Section 4.3. Lines 1–3 and 6 fold the Schraudolph affine transformation into the score MFMA (Section 4.3); lines 8–13 are the frozen maximum with rollback (Section 4.1); lines 7 and 15–16 are the two-stage conversion of , whose block maxima serve both the gate and the scales (Section 4.2); and lines 6 and 17–18 are the MX matrix multiplies, the row sum included (Section 4.4).

Figure 2: One SIMD pair in the Fused-Softmax schedule. While one wave issues the denominator, and the next matrix operations, its partner evaluates the row maximum, rollback gate and two-stage conversion. Prefetch and drain operations use alternating LDS slots; the rollback path below the timeline runs very rarely, only when the gate fires.
4.1 Frozen max with rollback recovery
Rescaling the output on every tile is a large share of the softmax's vector work, and it is needed only when the running maximum grows. A per-row speculative value is seeded from the first tile (line 2 of Algorithm 1). It is frozen and raised only when a later tile overflows (lines 8–13). This is admissible because the subtracted constant cancels in the softmax ratio, so any value serves. The running maximum is merely the choice that guarantees no overflow. While the speculative maximum holds, the rescaling factor of Eqs. (5)–(6) is one, and the accumulations on lines 17–18 are plain additions. Figure 2 depicts the rollback in detail.
What freezing removes. Two of the softmax's passes over the score tile disappear with it. The rescaling reduces to the plain addition already noted, and the max subtraction leaves the VALU entirely: a constant per row can be folded into the score GEMM's own operands, which Section 4.3 derives together with the Schraudolph bias. Against the roofline of Section 3 that is 512 of the 2304 clk the vector side would otherwise cost.
Only a lagging reference needs detection. Before rollback, the frozen reference can only lag the running maximum, so can only come out too large and the single upper test on line 8 suffices. Recovery may conservatively place the reference above the true maximum; this only scales subsequent probabilities downward. Rescaling the accumulated and by the same power-of-two factor preserves their final ratio. The gate uses block maxima that 's E8M0 scales already require (Section 4.2).
Recovery. Lines 9–13 carry the recovery. When a row's peak passes the gate, they shift the scores by the difference between the true and speculative maxima (rounded up to an integer), rescale and by that same factor, and rebuild the GEMM bias to match the updated maximum. The correction is exact rather than bounded when the gate fires, so no error accumulates across tiles.
Threshold and cost. How far the maximum may lag is set by the representation of and by the range later accumulations need. All three kernels presented here gate at , that is in the affine coordinate of Section 4.3, although the cap is configurable. In every variant carries a power-of-two scale (Table 3): the E8M0 block scales of MXFP6/4 and the per-row scale of MXFP8. The cap is a heuristic chosen for the long sequence lengths of diffusion workloads, leaving room for the subsequent accumulation in and . Accumulation bounds also depend on sequence length and value magnitudes; they cannot be established from the BF16 exponent range alone. Section 5.3.1 reports its measured trigger rates.
Table 3: The three operand configurations. Throughout our kernels FP8 operands are E4M3, FP6 operands are E2M3 and FP4 operands are E2M1. Per-row FP8 carries a power-of-two scale per row and key tile.
| kernel | Q | K | P | V |
|---|---|---|---|---|
| mxfp8 | MXFP8 | MXFP8 | per-row FP8 | per-tensor FP8 |
| mxfp6 | MXFP6 | MXFP6 | MXFP6 | MXFP6 |
| mxfp4 | MXFP4 | MXFP4 | MXFP6 | MXFP4 |
4.2 Schraudolph-fused two-stage conversion to quantized P
The exponential and the narrowing of to its GEMM format are one conversion in two stages, lines 15 and 16 of Algorithm 1. Stage-A, line 15, builds a floating-point by reinterpreting an integer bit pattern; Stage-B, line 16, scales and converts that value to the microscaled format the GEMM consumes.
Schraudolph approximation. Schraudolph's observation (Schraudolph, 1999) is that a float stores a biased exponent and a mantissa in consecutive fields, so a power of two can be built as a bit pattern instead of computed. For a score in natural-log units,
where a target format of M mantissa bits and E exponent bits, of bias , takes and . The exponent field receives the integer part of and the mantissa field the fractional part, interpolated linearly over each doubling interval, while the true function varies exponentially; is a tuned value that minimizes the root-mean-square (RMS) interpolation error. The exponential is therefore one FMA and one cast to an unsigned integer whose bits are read as the target floating-point format; this cast is Stage-A.
Choosing the proxy width. leaves the scores in FP32, and Stage-A can cast them to an unsigned integer of any width, the Schraudolph proxy, whose bits are then read as a float of the same width and narrowed by Stage-B. There are three options:
-
U32, read as FP32 and then scaled to the format. This is the naive route, but the 32-bit conversion has no packed form, so it misses the packed conversion family and is slow.
-
U16, read as BF16 and then scaled to the format. Both stages have packed instructions, so this route is fast. BF16 keeps the eight exponent bits of FP32, so the dynamic range of available to the rollback gate is unchanged, and its seven mantissa bits give up little accuracy.
-
U8, read directly as E4M3, in a single stage. It has no packed form either, so it is no faster than the two-stage U16 route, and its three mantissa bits and four exponent bits cost too much accuracy and range.
The accuracy cost of the U16 proxy is small. The Schraudolph approximation has an intrinsic 1.770% RMS relative error that no width removes, and U16 () raises that only to 1.777%, whereas U8 () raises the RMS error to 3.141%. Section 5.1 measures the effect of each proxy on the attention output, and Appendix B quantifies the accuracy of each proxy width.
We therefore adopt the U16 proxy in all three kernels, and Stage-B scales and converts the BF16 value into the format of Table 3.
We use doubling for a factor-of-two interval, the span from to , which is one step of the binary exponent.
Reusing the maximum. The row maximum of line 7 is computed once and used twice: its per-block intermediate results become the E8M0 scales of the microscaled , and the rollback gate tests the same values, so the gate needs no reduction of its own.
Placing the reduction. Algorithm 1 shows the default ordering: line 7 reduces the FP32 affine coordinates before Stage-A. The reduction can instead follow Stage-A and operate on the packed 16-bit codes, which is more efficient. The two orders differ in how far above the frozen maximum a score can be and still be recovered. The FP32 coordinates represent any score the QK GEMM can produce, whereas the 16-bit code saturates 385 doublings above the frozen maximum, beyond which the gate still fires, but the true overshoot is lost. Our MXFP6 kernel uses the exact unsigned packed reduction throughout. MXFP4 uses the faster maximum3 reduction in the steady state and falls back to the unsigned reduction during rollback. Appendix C scopes its guaranteed range and empirical behavior.
4.3 Affine Schraudolph transformation and speculative max subtraction in the MX MFMA
Lines 1–3 and 6 of Algorithm 1 are the FMA of Eq. (9), moved off the vector unit and into the score GEMM. The cast is irreducible and becomes Stage-A of Section 4.2; both of the multiply-add's constants, and the speculative maximum, are known before that GEMM runs, so its operands carry them.
For the U16 proxy read as BF16, M = 7 and E = 8, so b = 127. With X the base-two score of Eq. (2) and m the speculative score maximum, the softmax scale and the change of logarithm base are folded into the preparation of the QK operands, which is why no survives in the constants below. Stage-A must then construct the BF16 pattern
A doubling corresponds to pattern units.
The conversion does not accept that pattern directly. The only available FP32-to-U16 conversion on CDNA 4 is a packed normalized conversion that multiplies its clamped input by 65535 and rounds to an unsigned 16-bit code, so what the GEMM must deliver is the pattern scaled into [0,1]. Dividing through by gives the affine coordinate
and 65535a then approximates the pattern above, the factor 65535/65536 accounting for the small normalization difference.
The additional factor is a power of two, so it can be folded into the resident MX exponents by subtracting nine. The speculative reference contributes the per-row bias . A BF16 MFMA broadcasts this bias into the accumulator seed, and the microscaled QK MFMA adds the scaled product. Its output is therefore directly. Bias preparation is repeated when the rollback triggers; the steady-state score tile needs no separate VALU affine transformation.
4.4 The GEMMs: operands and instructions
We quantize the QK and PV GEMMs progressively from FP8 through FP6 to FP4 (Table 3). Besides these two GEMMs, the denominator accumulation moves to the matrix cores as well.
The QK and PV GEMMs. The operands of lines 6 and 18 are quantized as in Table 3. MXFP6 and MXFP4 lower through the same block-scaled FP6 path while retaining MXFP6 and MXFP4 , so their PV GEMMs mix FP6×FP6 and FP6×FP4, respectively. MXFP8 lowers to per-row scaled FP8. Before quantization, and are rotated by a normalized Walsh–Hadamard transform over the head dimension. Since , and the scores are unchanged, while every rotated element mixes all elements of its row, spreading outliers across the 32-element blocks that share an E8M0 scale. This processing comes from weight quantization (Chee et al., 2023; Tseng et al., 2024) and was brought to attention by FlashAttention-3 (Shah et al., 2024); we use a fixed (unrandomized) Hadamard transform, fused with the MX quantization of and into a single pass over the tensors before the attention kernel.
The denominator as a GEMM. Line 17 evaluates the softmax denominator , a row reduction that on the VALU would compete for exactly the issue slots the softmax already saturates. It is instead a third matrix multiply, against a column of ones, which moves it onto a unit the softmax phase leaves idle. The format of then decides the throughput of this matrix multiply. For an FP8 we have the sparse FP8 matrix instruction available, which runs at twice the dense FP8 rate, the same rate as the MXFP6 and MXFP4 matrix multiplies, which serve the FP6 of those kernels. Either way the denominator leaves the VALU.
5 Empirical evaluation
We evaluate in two settings. The first uses normal inputs (a standard normal distribution), on which the related methods Attn-QAT (Zhang et al., 2026b) and Direct-P (Hu, 2026) report their accuracy: we ablate the components of the Fused-Softmax pipeline (Section 5.1) and compare accuracy and throughput against these two methods (Section 5.2). The second uses real data captured per attention call from Wan2.2-T2V-A14B (Team Wan et al., 2025) on the MLPerf Inference text-to-video benchmark (Reddi et al., 2020; MLCommons Association, 2026) (Section 5.3): we measure the effect of rollback on accuracy and throughput, then analyze the model output for visual quality, score it with VBench (Huang et al., 2024) and measure the end-to-end speedup. Quality runs keep all non-attention model operations in BF16 to isolate the effect of attention quantization. For latency, we also pair our kernels with an optimized model configuration that uses quantized GEMMs and parallel variational autoencoder (VAE) decoding.
5.1 Component ablation
We enable the components of the Fused-Softmax pipeline one at a time (Table 4), first on BF16 attention, where , , and are BF16 and the components are the only source of error beyond BF16 rounding, and then on the three quantized kernels. Starting from the conventional softmax on each format's operands, we add the row sum as a GEMM over the quantized , the frozen maximum and the Schraudolph exponential, and finally vary the Schraudolph proxy of the complete pipeline. All configurations run on ten seeds of the normal input at , , , ; we report the global relative error and the cosine similarity against BF16 attention with the conventional softmax, averaged over the seeds. The complete pipeline on the quantized formats is measured on our kernels. The other configurations exist only as steps of the ablation, so we evaluate them in a PyTorch emulator of the kernels, whose output for the complete pipeline matches that of the kernels to the precision of Table 4.
Freezing the maximum and computing the row sum as a GEMM over the quantized cost almost no accuracy. On BF16 attention, where nothing else perturbs the output, the two together move it by at most 0.31%. The normal input never triggers the rollback gate, so this tests the frozen maximum alone; Section 5.3.1 evaluates the rollback on real model data.
Table 4: Component ablation on normal inputs (b=1, h=24, s=32768, d=128, ten seeds): global relative error in % and cosine similarity against BF16 attention with the conventional softmax. Each row enables the marked components. The bolded row is our complete Fused-Softmax pipeline; the last two rows vary the Schraudolph proxy of the complete pipeline.
| as GEMM | components | BF16 | MXFP8 | MXFP6 | MXFP4 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| frozen max | Schraudolph | proxy | err | cos | err | cos | err | cos | err | cos | ||
| - | - | - | 5.39 | 0.99855 | 6.17 | 0.99810 | 20.45 | 0.97890 | ||||
| ✓ | - | 0.026 | 1.00000 | 5.39 | 0.99855 | 6.17 | 0.99810 | 20.45 | 0.97890 | |||
| ✓ | ✓ | - | 0.310 | 1.00000 | 5.42 | 0.99853 | 6.17 | 0.99810 | 20.45 | 0.97890 | ||
| ✓ | ✓ | ✓ | U16 | 1.798 | 0.99984 | 5.69 | 0.99838 | 6.46 | 0.99791 | 20.53 | 0.97872 | |
| ✓ | ✓ | ✓ | U32 | 1.798 | 0.99984 | 5.69 | 0.99838 | 6.46 | 0.99791 | 20.53 | 0.97872 | |
| ✓ | ✓ | ✓ | U8 | 3.69 | 0.99934 | 5.99 | 0.99822 | 6.71 | 0.99775 | 20.64 | 0.97854 | |
Table 5: Throughput and BF16-reference cosine on normal input (b=1, h=24, s=32768, d=128): our kernels versus published Attn-QAT (Zhang et al., 2026b) and Direct-P (Hu, 2026) results.
| tier | ours | related work | ||||
|---|---|---|---|---|---|---|
| kernel | TFLOP/s | cosine | method | TFLOP/s | cosine | |
| FP8 | mxfp8 | 2978 | 0.99838 | Attn-QAT MXFP8/FP8 | 2362 | 0.9985 |
| ~FP6 | mxfp6 | 3973 | 0.99791 | Attn-QAT NVFP4/FP8 | 2677 | 0.9899 |
| FP4 | mxfp4 | 4586 | 0.97872 | Direct-P | 2945 | 0.9429 |
The Schraudolph exponential is the one component with a measurable cost. It brings BF16 attention to 1.8% error, matching the approximation's own error per probability.
Once the operands are quantized, the quantization error dominates the Fused-Softmax pipeline's accuracy cost. On every quantized kernel the complete pipeline adds at most 0.3 percentage points to the error that quantizing the operands already causes: about 5% of that error at MXFP8 and MXFP6, and under 1% at MXFP4.
The U16 proxy is as accurate as the full-width U32. U16 matches U32 on every kernel; U8, however, doubles the BF16 error and adds error on every quantized kernel. This further supports choosing U16 over U8 as the proxy (Section 4.2).
5.2 Comparison with related work
Table 5 places our kernels next to the throughput and cosine published for the related methods of Section 2, one per operand tier. We measure our kernels on the normal input at b=1, h=24, s=32768, d=128, non-causal forward, the shape at which Attn-QAT and Direct-P publish their throughput, and the shape also used in the ablation study. Our cosines are those of the complete pipeline of Table 4, on the normal input, averaged over ten seeds. For the related papers we report their published numbers on B300-class hardware (NVIDIA B300/GB300) at this shape; Attn-QAT publishes its throughput on GB300 only, and its per-call cosines on B200.
VC-Attention (Li et al., 2026) publishes no absolute throughput, only a speedup over BF16 FlashAttention-4 on B300. Deriving its throughput from that claim and the BF16 FlashAttention-4 throughput Attn-QAT reports on GB300 at our shape (1533 TFLOP/s) gives about 2254 TFLOP/s, which is in line with the Attn-QAT MXFP8/FP8 throughput (2362 TFLOP/s).
Our kernels are faster than the published related work at matching or better accuracy. From

Figure 3: Forward throughput against sequence length at , , , non-causal: our kernels on MI355X next to the BF16 FlashAttention-4 and Attn-QAT throughput published on GB300 (Zhang et al., 2026b).
Table 5 we can see that our kernels' cosines match or exceed the published cosines of the related work, while being faster. Figure 3 extends the throughput comparison to the sequence lengths for which Attn-QAT publishes its GB300 throughput, 1K to 32K tokens at , , , non-causal, where this trend continues. Our kernels are measured as above; the published bars are read off Attn-QAT's figure.
5.3 Video generation with Wan2.2
We evaluate the kernels in Wan2.2-T2V-A14B (Team Wan et al., 2025) with the settings of the MLPerf® Inference text-to-video benchmark²: its 248 prompts from VBench (Huang et al., 2024), 720p videos of 81 frames generated in 20 denoising steps from a fixed initial latent, and its six-dimension VBench score. The one change is the scheduler's flow shift, set to Wan2.2's own value of 12, because at the reference's default of 3 the videos degrade even with BF16 attention (Appendix A shows this and gives the rest of the setup). All quality runs use the model with BF16 GEMMs and BF16 cross-attention, and only the self-attention kernel changes between them. Besides the three kernels we evaluate a hybrid schedule that runs MXFP6 for the first and last three of the 20 denoising steps and MXFP4 in between.
On two example prompts, “a motorcycle cruising along a coastal highway” and “a cat grooming itself meticulously with its tongue”, we analyze the rollback on every self-attention call and the visual quality of the videos, and on the motorcycle prompt the end-to-end latency. Over all 248 prompts of the benchmark we report the VBench scores.
5.3.1 Per-call analysis of the rollback
The normal input never triggers the rollback gate, so the ablation study above tests only the frozen maximum. To test the rollback we capture every self-attention call of the BF16 generations of the two example prompts (Figure 4; Appendix A). For each call we measure the rollback rate, the fraction of key tiles in which any of the workgroup's eight waves rolls back at the gate. Rollback is rare: over the 3200 calls it occurs on 0.063% of workgroup tiles on average and on at most 0.67% in the worst call.
Rollback costs no measurable throughput or accuracy, and it recovers accurately. We take the five calls with the highest rollback rates and run our kernels on them with the gate enabled and disabled. Even on
²The text-to-video benchmarking methodology is based on the reference implementation for Wan-2.2-T2V-A14B within the MLPerf® Inference Datacenter v6.1 suite (Reddi et al., 2020; MLCommons Association, 2026). MLPerf® is a registered trademark of the MLCommons® Association. Results not verified by MLCommons Association.
Table 6: Wan2.2-T2V-A14B: VBench score and PSNR (dB), SSIM and LPIPS against the BF16 videos over the 248 prompts. The last two columns report end-to-end latency (s) of the motorcycle prompt under the BF16 and optimized model configurations of Section 5.3.3; parentheses give the speedup over BF16 attention in the same configuration.
| VBench | PSNR ↑ | SSIM ↑ | LPIPS ↓ | latency (s) | ||
|---|---|---|---|---|---|---|
| BF16 GEMMs | FP8/4 GEMMs | |||||
| BF16 | 71.83 | reference | 197.5 | 173.3 | ||
| MXFP8 | 71.78 | 17.37 | 0.584 | 0.324 | 129.4 (1.53×) | 105.9 (1.64×) |
| MXFP6 | 71.85 | 16.32 | 0.546 | 0.363 | 115.5 (1.71×) | 88.9 (1.95×) |
| MXFP4 | 71.13 | 14.55 | 0.477 | 0.486 | 106.0 (1.86×) | 82.6 (2.10×) |
| hybrid | 72.01 | 16.31 | 0.540 | 0.382 | 108.0 (1.83×) | 84.4 (2.05×) |
these calls the rollback leaves the throughput unchanged within run-to-run variation, and it costs no accuracy: against the model's BF16 attention output, our kernels are as accurate as the conventional softmax on the same quantized operands, in every format within 0.1 percentage points (Appendix A gives the numbers). With the gate disabled every kernel's output is NaN: the frozen maximum alone overflows on these inputs, so the rollback is needed.
5.3.2 Visual quality
Figure 4 shows the same frame of both prompts through each attention configuration. MXFP8 and MXFP6 are practically indistinguishable from the BF16 baseline. MXFP4 drifts: the cat loses its tongue and softens, and the biker's road and foreground change. Such artifacts of FP4 attention in diffusion models have been noted and addressed in earlier work (Zhang et al., 2024; 2026b); the hybrid schedule removes them and stays close to the baseline.
5.3.3 End-to-end latency
We measure the end-to-end latency on a single MI355X GPU. After one warm-up run, we generate the motorcycle prompt five times and report the slowest run (Table 6). The self-attention speedup of our kernels carries over to video generation, and the hybrid schedule keeps nearly all of MXFP4's speedup. With the model GEMMs quantized to FP8/FP4 and VAE decoding parallelized, attention accounts for a larger share of the latency and the speedups grow further.
5.3.4 VBench scores
We generate all 248 prompts with each attention configuration and score the videos with VBench (Huang et al., 2024) on the six dimensions of the MLPerf evaluation (Table 6; per dimension in Appendix A). MXFP8, MXFP6 and the hybrid schedule match the BF16 score; only MXFP4 on its own falls noticeably behind. VBench scores each video on its own (temporal consistency, motion, match to the prompt) rather than by its closeness to the baseline. Since every configuration starts from the same initial latent, we also measure each video's fidelity to the BF16 video of the same prompt, on every fourth frame, with peak signal-to-noise ratio (PSNR), structural similarity (SSIM) and learned perceptual image patch similarity (LPIPS). These order the configurations by precision: MXFP8 stays closest to the BF16 generation, MXFP6 next and MXFP4 furthest, while the hybrid schedule comes close to MXFP6's fidelity at nearly MXFP4's speed.

Figure 4: Wan2.2-T2V-A14B, frame 40 of the cat (top) and motorcycle (bottom) prompts with each self-attention kernel.

Figure 5: Motorcycle prompt across two additional models and all self-attention kernels.
5.4 Other diffusion models
We also replace self-attention with our kernels in HunyuanVideo (Kong et al., 2024) and MiniMax-H3 (MiniMaxAI, 2026) (Figure 5). The hybrid uses MXFP6 for the first and last steps (5 and 15 of 50 for HunyuanVideo and MiniMax-H3) and MXFP4 otherwise. As in Wan2.2, MXFP4 changes the scene (the rider disappears in HunyuanVideo and the background changes in MiniMax-H3); the hybrid, however, recovers the reference appearance. MXFP8 and MXFP6 stay close to the reference, as in Wan2.2, suggesting good generalization of our kernels across models.
6 Conclusion
We presented Fused-Softmax Attention, a quantized attention pipeline that addresses the growing imbalance between matrix-core and vector-unit throughput. A speculatively frozen row maximum and an affine exponential approximation make max subtraction and exponential evaluation foldable into the score GEMM. A two-stage conversion then produces microscaled probabilities, reusing its block reduction to derive their scales and detect overflow. Detected overshoots trigger an accurate rollback, while evaluating the row sum as a matrix multiplication—sparse for MXFP8—removes the remaining reduction from the vector path.
Implemented for the AMD CDNA™ 4 architecture, the resulting MXFP8, MXFP6 and MXFP4 kernels reach approximately 3.0, 4.0 and 4.6 PFLOP/s on an AMD Instinct™ MI355X GPU, yielding speedups of 2.1×, 2.8× and 3.2× over BF16 attention. The additional error from Fused-Softmax remains below the error floor set by quantizing the GEMM operands. In the cross-platform comparison with published related methods, our reported throughput is 1.26–1.56× higher at similar or higher cosine similarity.
These kernel gains translate to end-to-end diffusion inference. A hybrid MXFP6/4 schedule delivers up to 2.1× speedup on video generation while preserving the visual quality of the outputs. Evaluations on Wan2.2-T2V-A14B, HunyuanVideo and MiniMax-H3 show a consistent precision-quality pattern: MXFP8 and MXFP6 stay close to BF16, pure MXFP4 maximizes throughput at a visible quality cost, and the hybrid schedule recovers that loss.
The kernels are deployed: they ship in the open-source AITER library behind the mha_v4 entry point (AMD, 2025), where they compose with block-sparse attention. An earlier version of the hybrid kernel powered AMD's MLPerf Inference v6.1 Wan2.2-T2V-A14B submission (Zhang et al., 2026a; Arunachalam et al., 2026), whose SingleStream latency fell from the previous round on the same MI355X system. Overall, our work shows that recasting softmax in terms of matrix operations enables attention to capitalize on growing low-precision matrix throughput.
References
Advanced Micro Devices, Inc. Introducing AMD CDNA 4 architecture: Breakthrough AI and HPC acceleration with enhanced AI capabilities, advanced precisions, and high efficiency. White Paper PID#2258402-C, Advanced Micro Devices, Inc., Oct. 2025. URL https://www.amd.com/content/dam/amd/en/documents/instinct-tech-docs/white-papers/amd-cdna-4-architecture-whitepaper.pdf.
AMD. AITER: AI tensor engine for ROCm. https://github.com/ROCm/aiter, 2025.
J. Ansel, E. Yang, H. He, N. Gimelshein, A. Jain, M. Voznesensky, B. Bao, P. Bell, D. Berard, E. Burovski, G. Chauhan, A. Chourdia, W. Constable, A. Desmaison, Z. DeVito, E. Ellison, W. Feng, J. Gong, M. Gschwind, B. Hirsh, S. Huang, K. Kalambarkar, L. Kirsch, M. Lazos, M. Lezcano, Y. Liang, J. Liang, Y. Lu, C. K. Luk, B. Maher, Y. Pan, C. Puhrsch, M. Reso, M. Saroufim, M. Y. Siraichi, H. Suk, S. Zhang, M. Suo, P. Tillet, X. Zhao, E. Wang, K. Zhou, R. Zou, X. Wang, A. Mathews, W. Wen, G. Chanan, P. Wu, and S. Chintala. PyTorch 2: Faster machine learning through dynamic Python bytecode transformation and graph compilation. In Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), pages 929–947, 2024.
M. Arunachalam, M. Hodak, P. Palangappa, U. Kannikanti, R. Brugarolas, H. Acharya, K. Verma, Y. P. Kamisetty, R. Lee, N. Mathews, R. Poornachandran, J. Chen, H. Zhao, M. Lauri, J. Carabano Bravo, N. Holmberg, and E. Li. Technical dive into AMD MLPerf inference v6.1 submission. ROCm blogs, Sept. 2026. URL https://rocm.blogs.amd.com/artificial-intelligence/mlperf-inf-v6.1/README.html.
J. Chee, Y. Cai, V. Kuleshov, and C. De Sa. QuIP: 2-bit quantization of large language models with guarantees. In Advances in Neural Information Processing Systems (NeurIPS), volume 36, 2023.
T. Dao. FlashAttention-2: Faster attention with better parallelism and work partitioning. In International Conference on Learning Representations (ICLR), 2024. URL https://arxiv.org/abs/2307.08691.
T. Dao, D. Y. Fu, S. Ermon, A. Rudra, and C. Ré. FlashAttention: Fast and memory-efficient exact attention with IO-awareness. In Advances in Neural Information Processing Systems (NeurIPS), volume 35, pages 16344–16359, 2022. URL https://arxiv.org/abs/2205.14135.
C. Deng, J. Fang, and D. Dong. MpFA: Hardware-efficient train-free QK4V8 FlashAttention kernels on Blackwell GPUs. 2026. URL https://arxiv.org/abs/2609.33135.
J. Fang, J. Pan, X. Sun, A. Li, and J. Wang. xDiT: an inference engine for diffusion transformers (DiTs) with massive parallelism. arXiv preprint arXiv:2411.01738, 2024.
R. Hu. Hardware-aware FP4 FlashAttention-4. 2026. URL https://arxiv.org/abs/2609.04105.
W. Hu, D. Wadsworth, S. Siddens, S. Winata, D. Y. Fu, R. Swann, M. Osama, C. Ré, and S. Arora. HipKittens: Fast and furious AMD kernels. In Proceedings of Machine Learning and Systems (MLSys), 2026. URL https://arxiv.org/abs/2511.08083.
Z. Huang, Y. He, J. Yu, F. Zhang, C. Si, Y. Jiang, Y. Zhang, T. Wu, Q. Jin, N. Chanpaisit, Y. Wang, X. Chen, L. Wang, D. Lin, Y. Qiao, and Z. Liu. VBench: Comprehensive benchmark suite for video generative models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 21807–21818, 2024.
W. Kong, Q. Tian, Z. Zhang, R. Min, Z. Dai, J. Zhou, J. Xiong, X. Li, B. Wu, J. Zhang, K. Wu, Q. Lin, J. Yuan, Y. Long, A. Wang, A. Wang, C. Li, D. Huang, F. Yang, H. Tan, H. Wang, J. Song, J. Bai, J. Wu, J. Xue, J. Wang, K. Wang, M. Liu, P. Li, S. Li, W. Wang, W. Yu, X. Deng, Y. Li, Y. Chen, Y. Cui, Y. Peng, Z. Yu, Z. He, Z. Xu, Z. Zhou, Z. Xu, Y. Tao, Q. Lu, S. Liu, D. Zhou, H. Wang, Y. Yang, D. Wang, Y. Liu, J. Jiang, and C. Zhong. HunyuanVideo: A Systematic Framework For Large Video Generative Models. 2024. URL https://arxiv.org/abs/2412.03603.
X. Li, D. Zou, S. Zhang, J. Chen, H. Xi, L. Zhang, J.-Y. Zhu, S. Han, Z. Zhang, Y. Lin, and M. Li. VC-Attention: Value smoothing and softmax casting for low-bit attention. 2026. URL https://arxiv.org/abs/2609.15810.
M. Milakov and N. Gimelshein. Online normalizer calculation for softmax. 2018. URL https://arxiv.org/abs/1805.02867.
MiniMaxAI. MiniMax-H3. Hugging Face model card, 2026. URL https://huggingface.co/MiniMaxAI/MiniMax-H3.
MLCommons Association. MLPerf inference benchmark suite: Reference implementations. https://github.com/mlcommons/inference, 2026. Inference Datacenter v6.1, text-to-video (Wan-2.2-T2V-A14B).
NVIDIA Corporation. Inside NVIDIA Blackwell Ultra: The chip powering the AI factory era. NVIDIA Technical Blog, 2025a. URL https://developer.nvidia.com/blog/inside-nvidia-blackwell-ultra-the-chip-powering-the-ai-factory-era/.
NVIDIA Corporation. NVIDIA Blackwell Ultra datasheet. Datasheet, 2025b. URL https://dam-cdn.nvd.orangelogic.com/AssetLink/1k0p832eq8r5ca0u5383ie5o4tp3bst1.pdf. Individual Blackwell Ultra GPU specifications, GB300 NVL72 column.
NVIDIA Corporation. CUDA C++ Programming Guide, Release 12.9. NVIDIA Corporation, 2025c. URL https://docs.nvidia.com/cuda/archive/12.9.0/cuda-c-programming-guide/index.html#arithmetic-instructions. Table 7, Throughput of Native Arithmetic Instructions.
Open Compute Project. OCP microscaling formats (MX) specification, version 1.0. Technical report, Open Compute Project Foundation, Sept. 2023. URL https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf.
M. N. Rabe and C. Staats. Self-attention does not need memory. 2021. URL https://arxiv.org/abs/2112.05682.
V. J. Reddi, C. Cheng, D. Kanter, P. Mattson, G. Schmuelling, C.-J. Wu, B. Anderson, M. Breughe, M. Charlebois, W. Chou, R. Chukka, C. Coleman, S. Davis, P. Deng, G. Diamos, J. Duke, D. Fick, J. S. Gardner, I. Hubara, S. Idgunji, T. B. Jablin, J. Jiao, T. St. John, P. Kanwar, D. Lee, J. Liao, A. Lokhmotov, F. Massa, P. Meng, P. Micikevicius, C. Osborne, G. Pekhimenko, A. T. R. Rajan, D. Sequeira, A. Sirasao, F. Sun, H. Tang, M. Thomson, F. Wei, E. Wu, L. Xu, K. Yamada, B. Yu, G. Yuan, A. Zhong, P. Zhang, and Y. Zhou. MLPerf inference benchmark. In Proceedings of the ACM/IEEE 47th Annual International Symposium on Computer Architecture (ISCA), pages 446–459, 2020.
N. N. Schraudolph. A fast, compact approximation of the exponential function. Neural Computation, 11(4): 853–862, 1999. doi: 10.1162/089976699300016467.
J. Shah, G. Bikshandi, Y. Zhang, V. Thakkar, P. Ramani, and T. Dao. FlashAttention-3: Fast and accurate attention with asynchrony and low-precision. In Advances in Neural Information Processing Systems (NeurIPS), 2024. URL https://arxiv.org/abs/2407.08608.
Team Wan, A. Wang, B. Ai, B. Wen, C. Mao, C.-W. Xie, D. Chen, F. Yu, H. Zhao, J. Yang, J. Zeng, J. Wang, J. Zhang, J. Zhou, J. Wang, J. Chen, K. Zhu, K. Zhao, K. Yan, L. Huang, M. Feng, N. Zhang, P. Li, P. Wu, R. Chu, R. Feng, S. Zhang, S. Sun, T. Fang, T. Wang, T. Gui, T. Weng, T. Shen, W. Lin, W. Wang, W. Wang, W. Zhou, W. Wang, W. Shen, W. Yu, X. Shi, X. Huang, X. Xu, Y. Kou, Y. Lv, Y. Li, Y. Liu, Y. Wang, Y. Zhang, Y. Huang, Y. Li, Y. Wu, Y. Liu, Y. Pan, Y. Zheng, Y. Hong, Y. Shi, Y. Feng, Z. Jiang, Z. Han, Z.-F. Wu, and Z. Liu. Wan: Open and Advanced Large-Scale Video Generative Models. 2025. URL https://arxiv.org/abs/2503.20314.
A. Tseng, J. Chee, Q. Sun, V. Kuleshov, and C. De Sa. QuIP#: Even better LLM quantization with Hadamard incoherence and lattice codebooks. In Proceedings of the 41st International Conference on Machine Learning (ICML), 2024.
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NeurIPS), volume 30, 2017. URL https://arxiv.org/abs/1706.03762.
P. von Platen, S. Patil, A. Lozhkov, P. Cuenca, N. Lambert, K. Rasul, M. Davaadorj, D. Nair, S. Paul, W. Berman, Y. Xu, S. Liu, and T. Wolf. Diffusers: State-of-the-art diffusion models. https://github.com/huggingface/diffusers, 2022.
Wan Team. Wan2.2: Open and advanced large-scale video generative models. https://github.com/Wan-Video/Wan2.2, 2025. Sampling configuration wan/configs/wan_t2v_A14B.py.
J. Yu, J. Lin, L. Kong, A. Chen, W. Sun, C. Zeng, W. Lan, J. Li, Z. Zheng, Z. Yue, D. Ke, F. Yi, T. Hu, Y. Ding, Y. Yao, and J. Wang. MXAttention: Data-free optimal scaling and pre-normalization quantization for MXFP4 attention. 2026. URL https://arxiv.org/abs/2607.24377.
T. Zadouri, M. Hoehnerbach, J. Shah, T. Liu, V. Thakkar, and T. Dao. FlashAttention-4: Algorithm and kernel pipelining co-design for asymmetric hardware scaling. In Proceedings of Machine Learning and Systems (MLSys), 2026. URL https://arxiv.org/abs/2603.05451.
J. Zhang, H. Huang, P. Zhang, J. Wei, J. Zhu, and J. Chen. SageAttention2 technical report: Accurate 4 bit attention for plug-and-play inference acceleration. Technical report, arXiv, 2024. URL https://arxiv.org/abs/2411.10958v1.
J. Zhang, H. Huang, P. Zhang, J. Wei, J. Zhu, and J. Chen. SageAttention2: Efficient attention with thorough outlier smoothing and per-thread INT4 quantization. In International Conference on Machine Learning
(ICML), volume 267 of Proceedings of Machine Learning Research, pages 75097–75119, 2025a. URL https://proceedings.mlr.press/v267/zhang25ae.html.
J. Zhang, J. Wei, H. Wang, P. Zhang, X. Xu, H. Huang, K. Jiang, J. Chen, and J. Zhu. SageAttention3: Microscaling FP4 attention for inference and an exploration of 8-bit training. In Advances in Neural Information Processing Systems (NeurIPS), 2025b. URL https://arxiv.org/abs/2505.11594. Spotlight.
J. Zhang, J. Wei, P. Zhang, J. Zhu, and J. Chen. SageAttention: Accurate 8-bit attention for plug-and-play inference acceleration. In International Conference on Learning Representations (ICLR), 2025c. URL https://openreview.net/forum?id=OL44KtasKc.
J. Zhang, C. Raymond, and M. Hodak. AMD delivers its broadest MLPerf inference 6.1 submission. AMD blog, Sept. 2026a. URL https://www.amd.com/en/blogs/2026/amd-delivers-its-broadest-mlperf-inference-6-1-submission.html.
P. Zhang, M. Noto, W. Tan, C. Jiang, W. Lin, W. Zhou, and H. Zhang. Attn-QAT: 4-bit attention with quantization-aware training. 2026b. URL https://arxiv.org/abs/2603.00040.
W. Zhao, L. Bai, Y. Rao, J. Zhou, and J. Lu. UniPC: A unified predictor-corrector framework for fast sampling of diffusion models. In Advances in Neural Information Processing Systems (NeurIPS), volume 36, 2023.
APPENDIX
A VBench evaluation
We follow the benchmarking protocol of the MLPerf Inference v6.1 text-to-video benchmark for Wan-2.2-T2V-A14B (Reddi et al., 2020; MLCommons Association, 2026). It generates 720p videos (81 frames) in 20 denoising steps with the UniPC scheduler (Zhao et al., 2023) and scores them with VBench. Queries are issued by the open-source MLPerf LoadGen library, in the Offline scenario for the VBench runs and the SingleStream scenario for the latency measurement (Section 5.3.3).
We generate the 248 prompts of the VBench set (Huang et al., 2024) with Wan2.2-T2V-A14B (81 frames at , 20 sampling steps, the reference guidance of 4 for the high-noise expert and 3 for the low-noise expert, the reference negative prompt, one fixed seed and initial latent), once with BF16 attention and once with each of our quantized kernels and the hybrid schedule, which runs MXFP6 attention for the first and last three of the 20 denoising steps and MXFP4 for the fourteen between them. The self-attention calls have s=75600, h=40 and d=128. We run the BF16 Diffusers (von Platen et al., 2022) checkpoint of the model through xDiT (Fang et al., 2024) with torch.compile (Ansel et al., 2024). GEMMs stay in BF16 and cross-attention uses the BF16 attention kernel of AITER (AMD, 2025), the same kernel as the BF16 self-attention baseline, so only the self-attention kernel changes between the runs.
Flow shift. The MLPerf reference implementation does not set the scheduler's flow shift, so it inherits the checkpoint's default of 3; Wan2.2's own configuration samples this model with a shift of 12 (Wan Team, 2025). At the default, the videos degrade even with BF16 attention: Figure 6 shows the motorcycle prompt of Section 5.3.2 at both values, everything else unchanged: the road melts into water at 3 and stays intact at 12. We therefore use a shift of 12 throughout, the only change from the reference settings.
Rollback capture. For the per-call analysis of Section 5.3.1 we capture the BF16 generations of the two prompts of the main paper's Figure 4, "a motorcycle cruising along a coastal highway" and "a cat grooming itself meticulously with its tongue". We record the latent that enters the transformer at each denoising step and replay those latents through the model with a hook on its self-attention, so the captured calls are exactly those of the generation shown. Each prompt gives 1600 calls: all 20 denoising steps, both classifier-free guidance passes and all 40 layers.
Rollback on the worst calls. The five calls with the highest rollback rates roll back on 0.666–0.672% of workgroup tiles. On them, enabling the gate changes the throughput by -0.01%, -0.15% and +0.21% for MXFP8, MXFP6 and MXFP4, respectively, all within run-to-run variation. Against the model's BF16 attention output, our kernels reach a global relative error of 2.73%, 2.86% and 18.03%, against 2.74%, 2.95% and 18.07% for the conventional softmax on the same quantized operands (emulated), averaged over the five calls. Over all 3200 calls the median call rolls back on 0.014% of workgroup tiles.
VBench scores each video automatically on six dimensions, reported here on a 0–100 scale: subject and background consistency (whether the subject and the background keep their appearance across frames), motion smoothness, dynamic degree (how much motion the video contains), and appearance style and scene (how well the video matches the style and scene named in the prompt). Some dimensions apply only to a subset of the prompts. Table 7 reports the mean of each dimension and the overall score, the mean of the six.

Figure 6: Wan2.2-T2V-A14B, motorcycle prompt, at the MLPerf text-to-video settings with the scheduler's default flow shift of 3 (left) and with 12 (right), frames 0, 40 and 80, for BF16 and MXFP6 attention. Only the flow shift differs between the two sides.
Table 7: VBench scores and closeness to the BF16 videos for Wan2.2-T2V-A14B, flow shift 12. Each VBench dimension is the mean over the prompts it applies to, on the 0–100 scale; Overall is the mean of the six dimensions, the benchmark's accuracy score. PSNR, SSIM and LPIPS compare every fourth frame of each video with the same frame of the BF16 video of the same prompt, averaged over the 248 prompts.
| Wan2.2 | Subject consistency | Background consistency | Motion smoothness | Dynamic degree | Appearance style | Scene | Overall | PSNR | SSIM | LPIPS |
|---|---|---|---|---|---|---|---|---|---|---|
| BF16 | 92.64 | 93.64 | 96.77 | 93.06 | 20.74 | 34.16 | 71.83 | reference | ||
| MXFP8 | 93.22 | 93.71 | 96.82 | 93.06 | 20.77 | 33.14 | 71.78 | 17.37 | 0.584 | 0.324 |
| MXFP6 | 93.03 | 93.88 | 96.72 | 91.67 | 20.58 | 35.25 | 71.85 | 16.32 | 0.546 | 0.363 |
| MXFP4 | 92.66 | 93.82 | 97.38 | 90.28 | 20.68 | 31.98 | 71.13 | 14.55 | 0.477 | 0.486 |
| hybrid | 93.09 | 94.01 | 97.06 | 93.06 | 20.42 | 34.45 | 72.01 | 16.31 | 0.540 | 0.382 |
Table 8: What each proxy width buys. M and E are the mantissa and exponent widths of the pattern the proxy carries. The exponent-scale reach of is approximately and depends on E alone. The error columns depend on M alone and are swept over one doubling interval of ; the last column is the part of the RMS contributed by , separated in quadrature from the 1.770% the ramp carries regardless.
| proxy | M | E | of | relative error over one doubling interval of | RMS | added by | |
|---|---|---|---|---|---|---|---|
| min | max | ||||||
| continuous | — | — | -3.939% | 1.966% | 1.770% | — | |
| U32 / FP32 | 23 | 8 | -3.939% | 1.966% | 1.770% | 0.000% | |
| U16 / FP16 | 10 | 5 | -3.972% | 2.000% | 1.770% | 0.020% | |
| U16 / BF16 | 7 | 8 | -4.199% | 2.242% | 1.777% | 0.162% | |
| U8 / E4M3 | 3 | 4 | -8.012% | 6.398% | 3.141% | 2.595% | |
B Proxy and Schraudolph accuracy
Section 4.2 narrows the Schraudolph proxy from the classic 32-bit FP32 pattern to a 16-bit BF16 pattern. This appendix measures what the narrower mantissa costs in accuracy, and Table 8 sets that cost against the reach each candidate format affords.
The Schraudolph approximation emulates the exponential operation by exponentiating the exponent bits while linearly interpolating the mantissa bits. For emulating , there are two main error sources:
-
linear ramp: the linear interpolation of mantissas versus exponentiating the mantissas.
-
pattern quantization: representing the interpolated result in the corresponding floating-point format by rounding.
When it comes to the choice of proxy, the linear ramp is proxy-invariant: it is inherent to the Schraudolph approximation. Pattern quantization, by contrast, depends on the mantissa width of the datatype in question. Figure 7 illustrates the linear ramp error over the range of input .
Letting denote the fractional part of , an M-bit mantissa field cannot hold itself, only , so the pattern carries where the argument still calls for . That substitution is the entire second error source: is discretized in steps of , so the relative error it contributes is bounded by the half-step .

Figure 7: The ramp error, independent of any datatype. Top: over one doubling interval the mantissa field interpolates linearly, the chord from to . Bottom: the resulting relative error is periodic with period one doubling.
The half-step sets the scale. At M = 10 it is 0.049%, lost beneath the ramp's 1.770%; at M = 7 it is 0.391%, adding 0.162% in quadrature for a 0.4% relative rise in RMS; at M = 3 it reaches 6.250% and dominates, lifting RMS by 77%.
Even the 0.162% has negligible measured output impact. 's destination is FP6, whose own three mantissa bits carry the same 6.250% half-step, so the BF16 proxy is finer than the format it feeds, and its rounding vanishes beneath stage B's. Hence the design rule: the proxy needs mantissa bits comfortably above the destination's, and 7 against 3 leaves four bits of headroom, where an E4M3 proxy would carry exactly three and quantize twice at the same granularity.
Mantissa width is not the only constraint for the proxy. FP16 provides 10 mantissa bits, compared with 7 for BF16 and 3 for the U8/E4M3 proxy. However, FP16 and U8/E4M3 are ruled out by their limited exponent
Table 9: How v_pk_maximum3_f16 reads a Stage-A pattern. Here is the pattern's nine-bit sign-plus-exponent code, and its offset from the retained reference in doublings. The gate is an unsigned compare against the cap, , of Section 4.1. Only the third band misreads; its upper boundary falls inside , so the bands are delimited by pattern.
| pattern | read as FP16 | reduction | gate | ||
|---|---|---|---|---|---|
| 0–247 | 0x0000–0x7BFF | < 121 | positive finite | correct | fires iff above the cap |
| 248–255 | 0x7C00–0x7FFF | 121–128 | +∞ or +NaN | kept (∞) or propagated (NaN) | fires |
| 256–504 | 0x8000–0xFFC00 | 129–377 | negative finite, and –∞ | dropped | misses |
| 504–511 | 0xFFC01–0xFFFF | 377–384 | –NaN | propagates NaN | fires |
range, since E = 5 reaches only about and E = 4 about , giving a far tighter dynamic range than E = 8. Among the proxies that clear the range requirement, U32 is marginally more accurate, but BF16 enables the packed two-stage conversion while adding only 0.007 percentage points to the RMS error. Therefore, the efficient choice is BF16.
C Evaluation on the 16-bit maximum operations
Section 4.2 mentions placing the block maximum after Stage-A, on packed data. Two 16-bit reductions can do that. v_pk_max_u16 reads the codes as the unsigned integers they are and is exact; v_pk_maximum3_f16 retires twice as many values per issue but hands a BF16 pattern to an FP16 interpretation, and two properties of the construction decide whether a gate built on it is sound. Our MXFP6 kernel takes the exact reduction throughout; the MXFP4 one takes maximum3 in the steady state and falls back to the unsigned reduction in the rollback.
The unsigned reduction is exact over every doubling. The packed normalized conversion is monotone in its affine input, so unsigned code order preserves input order across the whole code space: no peak can be dropped, and there is no Inf/NaN band to invent one. The pattern domain also makes the gate and the rollback integer work, one doubling being exactly 128 pattern units. Its only ceiling belongs to the conversion rather than the reduction, since a coordinate saturated at 0xFFFF is unrecoverable from its code. The price is issue slots: 15 two-input maxima and a halfword fold per 32-element block, 17 instructions against the 10 of a maximum3 chain.
Stage-A cannot emit anything but a pattern. The packed normalized conversion clamps to [0, 1] before scaling by 65535, so the code written out always lies in [0, 65535]; a coordinate past the top saturates at 0xFFFF rather than wrapping to a small one. Below the sign bit, ordering survives the reinterpretation: FP16's 1+5+10 split ranks positive codes exactly as BF16's 1+8+7 does. What FP16 adds is an Inf/NaN band above 0x7C00, and it costs nothing, since the instruction propagates NaN and every FP16 NaN pattern is at least 0x7C00 unsigned, hence above any useful cap. The one unsigned compare that catches a genuine overshoot therefore also catches a poisoned reduction, after which the rollback re-reduces with v_pk_max_u16.
A large overshoot reaches the sign bit. Schraudolph writes the score into the exponent field, so an overshoot climbs through the exponent into bit 15 rather than saturating. Both formats read bit 15 as a sign but place their Inf/NaN bands at different heights, which opens a gap. Of the four bands in Table 9 only the third misreads: a pattern there is an ordinary negative finite to FP16, so maximum3 has nothing to propagate and returns the positive neighbor, and the peak leaves the reduction before the gate sees it. (0xFCC00) belongs to that band, since only NaN propagation is sign-agnostic.
What matters is that the band is and NaN-free when interpreted as BF16. Stage-B reads the dropped pattern as BF16, where bit 15 is again a sign and the exponent sits far below the reference, so the row's dominant probability is packed as a small negative weight: the mass is lost and the MFMA and the sum take a finite perturbation of one row, with nothing to propagate. A NaN reaching those accumulators would destroy the output irrecoverably, and that is the failure this band cannot produce. A missed gate would instead cause a finite perturbation; we observed no such missed-gate failure across the evaluated model calls. The band is also hard to reach, opening at against a cap at and only when the peak is isolated within its own 32-element block — any block-mate above the cap but below 129 still fires the gate. maximum3 therefore guarantees 97 doublings rather than the whole code space, which is why MXFP6 pays the seven extra issues per block and only MXFP4 takes the cheaper reduction.
D Memory bandwidth roofline
The operands have to reach the matrix cores before they can be multiplied, over two hops: high-bandwidth memory (HBM) into LDS, and LDS into registers. We cost each against the matrix and vector work of Section 3.
HBM to LDS. Without cache reuse, each loads 2Nd, 1.5Nd, or Nd bytes at FP8, FP6, or FP4 through the HBM. Sharing 8 TB/s across 256 CUs at 2.4 GHz gives 13.02 B/clk/CU, hence
We double-buffer LDS: slot 0 supplies registers for the current tile while slot 1 receives the next tile, then their roles swap. Both wave groups use the same , so the next transfer arrives in time when
Even without cache reuse, these transfer costs remain below the combined matrix and vector work, and any reuse lowers them further.
LDS to registers. Each of the eight waves reads from LDS. At 256 B/clk/CU (Advanced Micro Devices, Inc., 2025), the ideal read costs are
for FP8, FP6, and FP4, respectively. These are also below the matrix cycle cost, and we use this to our advantage by interleaving the LDS reading into the matrix execution shadow.