Computing FP64 from INT8 and FP4: How Ozaki Turns 59 GEMMs into One High-Precision Matmul

Two apparently contradictory articles shared the Hacker News front page on 2026-11-29. One is titled FP64 Is All You Want, INT8 Is All You Need, FP4/6/8 Is All You Have (110 points). The other is a survey by Lemieux and Overton, The Rise of Low Precision Floating Point (46 points). The first carries a hard number: on B300, FP64 matrix products emulated with FP4 units run up to 83 times faster than native FP64.

This is not marketing. The paper, arXiv:2609.37693 from ETH Zurich by Mazumder, Calotoiu and Hoefler (submitted 2026-09-29), frames the whole thing as a verifiable combinatorial optimization problem and provides a lower bound: at K=2^14, within a stated moduli range, no FP4 scheme needs fewer than 59 GEMMs. The survey, arXiv:2611.00301 (submitted 2026-10-30, revised 2026-11-09), moves from the 1985 binary32/binary64 standards to today's standardization work on 4-bit formats.

My read: both papers describe the same shift from two sides. Precision is no longer bought with wider formats; it is bought with algorithms that assemble narrow ones. What matters for developers is which part of that bill is a hard cost and which part is an implementation detail.

Why FP64 became scarce

Start with hardware. Figure 1 of the paper collects peak throughput across mainstream GPUs. FP64 matrix rates at NVIDIA and AMD have been falling for several years while lower-precision rates keep rising. B300 has both its FP64 and INT8 rates reduced, marked with exclamation marks in the figure. Blackwell publishes no INT4 rate at all because its 4-bit integer instruction runs at the 8-bit rate. The MI355X datasheet simply lists INT4 at the INT8 rate.

In other words, using INT4 on current accelerators is fiction: you pay INT8 time and get no INT4 bandwidth win. The genuinely fast formats are sub-8-bit floating point, not sub-8-bit integers. That is the third clause of the paper title, FP4/6/8 Is All You Have: the fastest cells on the board are all you get.

What about FP64 Is All You Want? Solvers, scientific codes and simulation do not drop 64-bit precision because a GPU spec changed. Ozaki I and II answer with emulation: many low-precision GEMMs assembled into one exact FP64 GEMM.

What Ozaki II actually computes

Given A of size M by K and B of size K by N in FP64, the reference result is fl(AB), rounded once per entry. Emulation has three stages: convert operands to integers, form the exact integer product on a low-precision unit, then round once at the end. Conversion scales each row and column by a power of two, called mu and nu, and truncates toward zero. Scaling by powers of two is exact, so the only conversion error is truncation.

The problem is magnitude. Every integer entry is below 2^53, a single product is below 2^106, and a sum over K terms can reach K times 2^106. No low-precision unit stores that. Ozaki II works modulo several pairwise coprime moduli m: reduce A prime and B prime mod m, take representatives nearest zero, issue one GEMM, and obtain (A prime times B prime) mod m. The Chinese remainder theorem then recovers the full product, provided the product of moduli exceeds the range of the integer product.

The format alphabet decides how many GEMMs each modulus costs. A k-bit integer format represents every residue of a modulus up to 2^k, so INT8 can use one GEMM per modulus and emulate DGEMM in about 16 GEMMs. FP8 and FP4 cover only short consecutive runs. E2M1, at its smallest exponent, has the alphabet 0, plus and minus 1, 2, 3, 4, 6, 8 and 12: fifteen values with gaps. Each residue must be written as D0 plus b times D1 using two low-precision matrices, so one modulus costs three or four GEMMs.

Scheme selection as combinatorial optimization

The real contribution is not another instance of the scheme. It is a joint program over moduli, residue splits and product forms, minimizing GEMM count. Three results are worth remembering. The FP8 scheme uses 30 GEMMs against a previous best of 42. The FP4 scheme uses 59, matching AWE but this time with a lower-bound certificate. FP6 previously appeared only in an Ozaki I count table, so this is the first Ozaki II scheme for FP6.

The bound is stronger than the construction: at K=2^14, no FP4 scheme in the stated moduli range can use fewer than 59 GEMMs, and no INT8 scheme fewer than 16. These are not the best found so far; they are the best possible in that search space. Exactness is a separate constraint. Each scheme has a K_max, and above that inner dimension the emulation is approximate rather than exact.

Reproducing CRT reconstruction in plain Python

No library is needed. Pick three pairwise coprime moduli, reduce and multiply two integers mod each, then reconstruct with CRT and compare against the exact product. The third case deliberately exceeds the moduli product to show when the method fails.

# stdlib only; run: python ozaki_crt.py
from math import gcd, prod

def crt(residues, moduli):
    M = prod(moduli)
    total = 0
    for r, m in zip(residues, moduli):
        Mi = M // m
        total += r * Mi * pow(Mi, -1, m)
    return total % M

def ozaki_product(A, B, moduli):
    residues = [(A % m) * (B % m) % m for m in moduli]
    return crt(residues, moduli), prod(moduli)

pairwise = [251, 253, 255]
ok = all(gcd(a, b) == 1 for i, a in enumerate(pairwise) for b in pairwise[i + 1:])
print("moduli:", pairwise, "| pairwise coprime:", ok)
for a, b in [(12, 34), (1000, 999), (12345, 6789)]:
    exact = a * b
    got, M = ozaki_product(a, b, pairwise)
    print("a*b =", exact, "| CRT =", got, "| range =", M, "| exact:", got == exact)
big_a, big_b = 10000000, 10000000
got, M = ozaki_product(big_a, big_b, pairwise)
print("overflow case:", big_a * big_b, "vs range", M, "-> match:", got == big_a * big_b)

Output:

moduli: [251, 253, 255] | pairwise coprime: True
a*b = 408 | CRT = 408 | range = 16193265 | exact: True
a*b = 999000 | CRT = 999000 | range = 16193265 | exact: True
a*b = 83810205 | CRT = 2843880 | range = 16193265 | exact: False
overflow case: 100000000000000 vs range 16193265 -> match: False

The first two lines show the mechanism works. The last two show CRT is exact only when the moduli product covers the real range. That maps directly to the paper's condition that the moduli product must exceed the integer product range, and to K_max: more moduli are not automatically better; the moduli must cover your inner dimension.

GEMM count is the real cost

Intuition says FP4 peak is tens of times FP64, so emulation should win easily. Do not forget the division: 59 GEMMs dilute the peak advantage. Here is a calculation with illustrative numbers; replace them with your GPU datasheet and rerun.

# stdlib only; run: python gemm_breakeven.py
FP64_TFLOPS = 60.0
FORMATS = {
    "INT8": (3000.0, 16),
    "FP8": (6000.0, 30),
    "FP4": (12000.0, 59),
}
print("format | peak/fp64 | GEMMs | emulated TFLOPS | vs FP64")
for name, (peak, ng) in FORMATS.items():
    ratio = peak / FP64_TFLOPS
    emulated = peak / ng
    print(name, "|", f"{ratio:.1f}x", "|", ng, "|", f"{emulated:.1f}", "|", f"{emulated / FP64_TFLOPS:.2f}x")
print("break-even: peak_low / peak_fp64 must exceed GEMM count")
for name, (peak, ng) in FORMATS.items():
    need = ng * FP64_TFLOPS
    print(name, "needs peak >", f"{need:.0f}", "| have", f"{peak:.0f}")

Output:

format | peak/fp64 | GEMMs | emulated TFLOPS | vs FP64
INT8 | 50.0x | 16 | 187.5 | 3.12x
FP8 | 100.0x | 30 | 200.0 | 3.33x
FP4 | 200.0x | 59 | 203.4 | 3.39x
break-even: peak_low / peak_fp64 must exceed GEMM count
INT8 needs peak > 960 | have 3000
FP8 needs peak > 1800 | have 6000
FP4 needs peak > 3540 | have 12000

Note the counterintuitive result: FP4 with 200 times the peak ends up only slightly ahead of FP8, 3.39x versus 3.33x, because the GEMM count grows too. The decision rule is one line: low-precision peak divided by FP64 peak must exceed the scheme GEMM count. The 83x on B300 happens because FP64 is cut hard while FP4 remains high enough, so both conditions hold at once.

When not to switch

  • Above K_max the emulation is no longer exact. The certificate is tied to the inner dimension. Do not reuse a scheme designed for K=2^14 on a longer contraction unless you accept the error and verify it separately.
  • Truncation error still exists. Scaling is exact but truncating toward zero drops low bits. Overflow protection does not make the original FP64 inputs lossless.
  • This solves GEMM, not every operator. The paper covers matrix products. Reductions, nonlinearities and communication need their own precision analysis.
  • Low-precision units can be cut too. B300 INT8 is not full rate. Check the exact model datasheet before selecting hardware; do not reuse last generation peak ratios.

Taken together, the two papers carry a simple message: narrower formats are irreversible, but precision can be bought back with algorithms at a price measured in GEMMs. Price that on your own hardware before replacing DGEMM.

Further reading

フィードバック

このサイトはフロントエンドのみでバックエンドやアカウントはなく、フィードバックはGitHub Issues・ディスカッション・メールで受け付けています。

issueやメールに貼り付けていただくと問題特定が早まります。入力内容は含まれません

その他:既存の報告を見る · メールでのフィードバック(GitHubアカウント不要):278975598@qq.com