Skip to content
DAH

FP8 GEMM with FP32-accumulation accuracy at long K without a throughput penalty

OpenTo verify: GPU benchmarkPosed by Limited FP8 tensor-core accumulation reported in the DeepSeek-V3 report (2024)
AI-reviewed
On this page14 sections
Difficulty
34/100Hard
How far from a resolution. P vs NP = 100
Application value
47/100Significant
Realistic practical impact if resolved. P vs NP = 100
Leverage
26/100Local
How much other knowledge hinges on it. P vs NP = 100

Difficulty 34: getting promoted-FP32 accuracy at fast-accumulate speed requires a new way to hide promotion cost against a 13-bit hardware accumulator, harder than plain parity (24) and close to the parked accumulator-width bound problem (35.5). Application value 47: weight-gradient GEMMs with K equal to the token count decide FP8 training stability. Leverage 26: informs FP8 recipes and kernels.

The problem

Can an H100 FP8 matrix multiply add very long sums as accurately as 32-bit, at full fast-mode speed?

  1. 1Long sums pile up rounding errors
  2. 2H100 FP8 adds with 13-bit precision
  3. 3Moving sums to FP32 costs time
  4. 4Fast mode skips it, loses accuracy
  5. 5Want both: accurate and fast

What is asked. Each entry of a matrix product is a long sum: cij=∑k=1Kaikbkjc_{ij} = \sum_{k=1}^{K} a_{ik} b_{kj}. In neural-network training, KK can be tens of thousands, for example when the gradient for a weight matrix is summed over every token in a batch. On an H100, FP8 matrix multiplies are fast, but the hardware adds the products with limited precision. The problem asks for an FP8 matrix multiply, for KK up to 32768, whose error is at most twice that of an ideal version that adds in full 32-bit precision. It must also run within 5% of the speed of cuBLAS's fast-accumulate mode, which skips the usual accuracy fix.

Why long sums go wrong. A running sum stored with only a few fractional bits loses the small products. Suppose the accumulator keeps 13 fractional bits (a relative precision of about 2−13≈10−42^{-13} \approx 10^{-4}) and the running total has reached 1000. Its spacing is then 29−13approx0.062^{9-13} approx 0.06, so adding a product of 0.05 changes nothing after truncation. Over 30000 additions, these lost pieces can add up to a large error. The analogy is a bathroom scale with 100 g steps, used to weigh a sack of rice grain by grain. Every single grain registers zero. The analogy breaks because the hardware rounds whole groups of 32 products at once, not one grain at a time, so the loss depends on the data.

What is known. A bit-level study (Khattak and Mikaitis) models the H100's FP8 tensor-core path as adding groups of 32 products with only 13 fractional bits, with truncation. The newer B200 keeps 25. A PyTorch engineering post reached a similar conclusion by measurement. The fix used by DeepSeek-V3, and by cuBLAS by default, is promotion: every so often, copy the partial sum out of the tensor core and add it into a full 32-bit register on the ordinary cores. Promotion costs instruction slots and registers. Fast-accumulate mode skips it and is faster. How often to promote trades accuracy against speed, but nobody has published that trade-off curve as a function of KK. Nor is there a kernel that gets promotion-level accuracy at fast-mode speed.

What a solution looks like. A public kernel and a table of error and speed for each KK on one H100, on Gaussian and outlier-heavy inputs. It must meet both bounds on every shape, and an independent party must reproduce it.

Go deeper

The full technical text.

For K up to 32768 on one H100 SXM, produce an FP8 GEMM whose output error against an FP64 reference is at most 2x the error of a true FP32-accumulating FP8 emulation, while running within 5% of the throughput of cuBLAS's fast-accumulate FP8 GEMM (CUBLASLT_MATMUL_DESC_FAST_ACCUM = 1, which skips promotion of partial sums) on the same shapes. In other words: FP32-quality accumulation at the speed of the unpromoted kernel. Test inputs include Gaussian entries and activations with heavy-tailed outliers.

Words on this page (10)
Words on this page
FP8
An 8-bit floating-point format; E4M3 keeps more precision, E5M2 more range.
GEMM
General matrix multiply, C = A·B: the operation that takes most of the arithmetic in neural networks.
accumulator
The register that holds a running sum while many products are added together.
rounding error
The difference between a true value and the nearest number the format can store.
floating point
Scientific notation in binary: a sign, a fraction (mantissa) and an exponent.
tensor core
A unit inside each GPU core that multiplies small matrix tiles in one instruction, much faster than ordinary arithmetic.
cuBLAS
NVIDIA's closed-source library of tuned linear-algebra routines, the usual speed baseline for matrix multiply.
Hopper (H100)
NVIDIA's 2022 data-centre GPU generation; the H100 is its main chip.
gradient
The list of derivatives of the training loss with respect to each number in the model.
outlier
A value far larger in size than most others in the same set.
New to this? Read first (3)
New to this? Read first
AI-reviewedAn AI drafted this explanation. Check it against the technical text.

Path to understanding

foundations → problem

The research entries this problem rests on, in the order to read them. Each links to its explainer.

  1. Start with
  2. Step 2
  3. Step 3
  4. Then
    • FP8 GEMM with FP32-accumulation accuracy at long K without a throughput penaltyThe problem

State of the art

Khattak and Mikaitis (arXiv:2512.07004) model the H100 FP8 tensor-core path (wgmma) as adding groups of 32 products with only 13 fractional bits, truncating aligned significands, whereas B200 keeps 25 bits; a PyTorch engineering post reached a similar conclusion from measurements. The DeepSeek-V3 report works around this by promoting partial sums to FP32 on CUDA cores at fixed intervals, and cuBLAS does the same by default, periodically promoting unless fast accumulation is switched on. Promotion costs issue slots and registers, and its interval trades accuracy against throughput. No primary source publishes the error-versus-throughput frontier over K, or a kernel that gets promoted-level accuracy at fast-accumulate speed.

Realistic applications

Long-K reductions appear in the backward weight-gradient GEMM (K equal to tokens) and in large-hidden-size layers; accumulation error there decides whether FP8 training is stable.

What counts as solved

A public kernel and a published error and throughput table over K at a pinned commit, reproduced by an independent party.

How it gets verified

To verify: GPU benchmark

A kernel run and timed on stated hardware against a baseline.

Hardware: one H100 SXM 80 GB. Dtypes: E4M3 A and B with block scaling, BF16 output. Shapes: M=N in {1024, 4096}, K in {1024, 4096, 8192, 16384, 32768}. Inputs: standard normal and a heavy-tailed mixture (1% of entries scaled by 100) with fixed seeds. Reference: FP64 GEMM of the dequantised inputs. Baselines: cuBLAS FP8 GEMM (CUDA 12.9 or later) with fast accumulation on, for throughput (default-accumulation cuBLAS also reported, for error and speed); an emulated exact-FP32-accumulation FP8 GEMM for the error yardstick. Metric: max and RMS relative error, and median TFLOP/s over at least 100 iterations. Pass: error at most 2x the emulated-FP32 yardstick and throughput at least 95% of fast-accumulate cuBLAS for every listed shape. Harness: public script at a pinned commit.

Claims

No claimed results on this problem.

Where the work is

Theory
30%
New mathematical or conceptual ideas
Engineering
45%
Building instruments, chips, systems, software, formal proofs
Compute
15%
Raw computation, search, simulation
Empirical
10%
Observation, experiment, data collection

Mostly kernel engineering to hide promotion cost, plus error analysis against a now-documented accumulator model and measurement of error versus K.

Connected problems