OZAKI II / GPU NOTES

Ozaki II supplement: INT8 range conditions and paper performance results

Back to the article · 中文版

This supplement collects range derivations, bit budgets, and the complete paper performance tables and stage breakdowns. The main article concentrates on preprocessing costs on H20.

1 The Ozaki II pipeline and the conditions for INT8 computation

Let A∈Rp×qA\in\mathbb R^{p\times q}, B∈Rq×rB\in\mathbb R^{q\times r}, and C=ABC=AB. Each output is a dot product of length qq. In the square experiments, p=q=r=np=q=r=n. We use ss for the number of moduli and kk for a bit budget after scaling.

Ozaki II scales floating point inputs into integer values, represents each integer through ss small residues, computes the residue matrix products with ss INT8 GEMMs, and combines the results before restoring the original scale. Before discussing performance, we need to establish what each INT8 computation can reliably do. Paper, Section 3

1.1 From FP64 inputs to multiple INT8 GEMMs

Choose pairwise coprime moduli m1,…,msm_1,\ldots,m_s, with product M=∏tmtM=\prod_t m_t. Choose diagonal powers of two, D∈Rp×pD\in\mathbb R^{p\times p} and E∈Rr×rE\in\mathbb R^{r\times r}, to scale rows of A and columns of B.

Stage Operation Result
Scale and integerize A′=trunc⁡(DA), B′=trunc⁡(BE)A'=\operatorname{trunc}(DA),\ B'=\operatorname{trunc}(BE) Integer-valued inputs with controlled range
Form input residues At=ρmt(A′), Bt=ρmt(B′)A_t=\rho_{m_t}(A'),\ B_t=\rho_{m_t}(B') One pair of INT8 matrices per modulus; ρ\rho denotes centered reduction
Main matrix multiplication Pt=AtBtP_t=A_tB_t INT8 inputs with INT32 accumulation and output
Reduce the output Rt=Pt mod mtR_t=P_t\bmod m_t Each output's nonnegative residue under that modulus
Combine and rescale Combine the residues into XX using CRT; return C^=D−1XE−1\widehat C=D^{-1}XE^{-1} An FP64 result at the original scale

CRT, the Chinese Remainder Theorem, combines the residue channels. Scaling must enforce 2cmax⁡<M2c_{\max}<M, where cmax⁡c_{\max} bounds the absolute integer product A′B′A'B'. With the range and arithmetic requirements satisfied, the reconstruction target is X=A′B′X=A'B'.

Two checks are needed: whether the input residues fit in INT8, and whether a length-qq accumulation fits in INT32. They establish the reliability of the low precision core. See Section 2 of the main article for how fast and accu choose scaling.

1.2 Why the modulus limit is 256

INT8 represents 256 values in [−128,127][-128,127]. Conventional nonnegative residues lie in [0,mt−1][0,m_t-1]; for moduli larger than 128, some of them would not fit in signed INT8. Ozaki II uses centered residues:

ρm(x)∈[−⌊m2⌋, ⌈m2⌉−1].\rho_m(x)\in \left[-\left\lfloor\frac m2\right\rfloor,\, \left\lceil\frac m2\right\rceil-1\right].

Subtracting a modulus preserves the represented congruence. For 2≤mt≤2562\le m_t\le256, this entire interval fits in INT8. At the boundary mt=256m_t=256, it is exactly [−128,127][-128,127], with the nonnegative residue 128 represented by the congruent value −128.

What is preserved here is the input's information modulo the selected modulus. The original integer a′a' can be far larger than the INT8 range; each channel stores only one of its residues. Multiple moduli jointly represent the required information, so the complete integer a′a' does not have to fit into eight bits.

The moduli must also be pairwise coprime. Subject to this constraint, a larger modulus contributes more range bits, log⁡2mt\log_2m_t, helping reach the required total budget with fewer GEMMs. Paper, Section 3.1

1.3 The dot product length determines whether INT32 accumulation is safe

After fitting the inputs, we must prevent overflow during multiplication and accumulation. For the tt-th modulus, one output is

(Pt)ij=∑ℓ=1q(At)iℓ(Bt)ℓj.(P_t)_{ij}=\sum_{\ell=1}^{q}(A_t)_{i\ell}(B_t)_{\ell j}.

The largest absolute INT8 value is 128, so an individual product has magnitude at most 1282=214128^2=2^{14}. Signed INT32 represents [−231,231−1][-2^{31},2^{31}-1]. Summing absolute values gives a conservative bound independent of cancellation:

∣(Pt)ij∣≤∑ℓ=1q∣(At)iℓ(Bt)ℓj∣≤q 214.\left|(P_t)_{ij}\right| \le\sum_{\ell=1}^{q}\left|(A_t)_{i\ell}(B_t)_{\ell j}\right| \le q\,2^{14}.

The condition

q 214<231⟺q<217=131072,q\,2^{14}<2^{31} \quad\Longleftrightarrow\quad q<2^{17}=131072,

therefore prevents overflow in the final result. Every intermediate partial sum is bounded by the same total of absolute values, so the guarantee does not rely on eventual cancellation and also covers different accumulation orders.

When integer products and sums stay within range, they are exact; they do not suffer from floating point significand rounding. This is the reason for using INT8 × INT8 → INT32: narrow inputs reduce hardware cost, while a wider accumulator preserves the dot product.

The strict inequality matters. At q=217q=2^{17}, the worst-case bound reaches 2312^{31}, exceeding the largest positive INT32 value. This is a sufficient condition. Longer dot products do not always overflow, but the general guarantee no longer holds.

For larger qq, the inner dimension can be partitioned into blocks with safe accumulations. Reduce each block result modulo the selected modulus, then combine those residues within a safe range. Overflow must be prevented before it occurs; applying a remainder operation after an INT32 overflow does not generally recover the correct residue. Paper, Section 3.1

1.4 How many GEMMs are required

Each modulus contributes a pair of residue matrices and one main GEMM, so ss moduli require ss main GEMMs. Each channel uses its own INT32 accumulation; increasing ss does not change the preceding dot product length into sqsq.

The choice of ss depends on the required total range budget:

log⁡2M=∑t=1slog⁡2mt.\log_2 M=\sum_{t=1}^{s}\log_2m_t.

A modulus close to 256 contributes almost eight bits. The paper's 16-modulus configuration supplies about 125 range bits in total, shared by the two inputs, accumulation headroom, and the signed range. With mild magnitude variation and suitable scaling and reconstruction precision, 16 main GEMMs can therefore plausibly support FP64-like accuracy. It is not a fixed count guaranteed to work for arbitrary inputs.

The two limits serve different purposes:

Constraint Controlled by What it determines
Accumulation range within each integer GEMM Residue magnitudes and inner dimension qq Whether the individual product can be computed exactly
Reconstruction range of the complete integer product Modulus product MM and input scaling Whether enough input information can be accommodated

The suffix in fast-ss and accu-ss denotes the number of moduli used for the main products. Accu also performs a bound-estimation GEMM, which belongs to preprocessing.

2 Why constrain scaled entries by 2k2^k

Bounding inputs provides a sufficient bound on their product. If ∣a′∣≤2kA|a'|\le2^{k_A} and ∣b′∣≤2kB|b'|\le2^{k_B}, then

(∣A′∣∣B′∣)ij≤q2kA+kB.\bigl(|A'||B'|\bigr)_{ij}\le q2^{k_A+k_B}.

This lets us bound every output before computing the product. We also want scaling to be as large as possible: the integer grid corresponds to a step of 1/Dii1/D_{ii} or 1/Ejj1/E_{jj} in the original scale. A larger scale generally loses less information during truncation.

For equal budgets on both inputs, Equation (18) in the paper is

k=⌊12log⁡2M/2−1q⌋.k=\left\lfloor\frac12\log_2\frac{M/2-1}{q}\right\rfloor.

Expanding the product of moduli gives

k=⌊12(∑tlog⁡2mt−log⁡2q−1+log⁡2(1−2/M))⌋.k=\left\lfloor\frac12\left( \sum_t\log_2m_t-\log_2q-1+\log_2(1-2/M) \right)\right\rfloor.

Ignoring the floor and the small final correction explains the trend:

k≈12(∑tlog⁡2mt−log⁡2q−1).k\approx\frac12\left(\sum_t\log_2m_t-\log_2q-1\right).

The moduli supply range bits. The dot product length consumes accumulation headroom, the signed interval costs one bit, and the two inputs share the remaining budget. Adding a modulus close to eight bits contributes roughly four bits per input; multiplying qq by four costs roughly one bit per input.

Paper Figure 3, INT8 modulus count and bit budget

Paper Figure 3. Source: Section 3.1. This is a fixed point range budget, not a guarantee that every element retains the same number of floating point significant bits.

This formula connects the modulus count to the input budget, but shared scaling remains sensitive to magnitude variation. Large and small entries in the same row can cause the small ones to be truncated away. A bound that better reflects the actual product can reduce unnecessarily conservative scaling.

3 Performance gains and where execution time goes

3.1 How much faster can INT8 emulation be than native FP64

The dense peak specifications in paper Table 1 provide useful context. Floating point columns use TFLOPS, and the integer column uses TOPS. These are specifications, not measured rates.

GPU Ordinary FP64 FP64 Tensor Core INT8 Tensor Core
Hopper specifications corresponding to GH200 34 67 1979
RTX 4090 1.29 — 660.6

Source: paper Table 1 and Section 4.1. We do not apply GH200 specifications to H20.

Native DGEMM is direct double precision matrix multiplication. The following performance values are reproduced from the paper, in effective TFLOPS: the final product's work, 2n32n^3, divided by elapsed time. They do not measure the total internal throughput of all ss integer products.

GH200 throughput across sizes and modulus counts (paper Table 3).

Method 2048 4096 8192 16384
DGEMM 56.9 61.3 62.0 60.9
fast-14 16.5 48.6 72.1 80.2
fast-15 15.4 45.2 67.4 74.6
fast-16 14.6 43.2 63.8 70.4
fast-17 13.8 40.5 60.1 66.1
fast-18 13.0 38.3 56.9 62.6
accu-14 14.7 42.7 64.7 71.1
accu-15 14.0 40.2 60.9 66.9
accu-16 13.3 38.5 58.0 63.3
accu-17 12.6 36.4 55.1 59.9
accu-18 12.0 34.7 52.2 56.6

RTX 4090 throughput across sizes and modulus counts (paper Table 4).

Method 2048 4096 8192
DGEMM 0.61 0.62 0.62
fast-14 3.73 6.94 9.81
fast-15 3.54 6.55 9.20
fast-16 3.31 6.22 8.76
fast-17 3.07 5.90 8.29
fast-18 2.91 5.56 7.83
accu-14 3.46 6.51 9.23
accu-15 3.29 6.04 8.68
accu-16 3.10 5.69 8.26
accu-17 2.93 5.40 7.81
accu-18 2.84 5.18 7.41

Source: paper Tables 3 and 4. The suffixes 14–18 are modulus counts.

GH200 has strong native FP64 performance. For small matrices, OS II's extra work outweighs the benefit. At size 16384, fast-14 reaches 80.2/60.9≈1.32×80.2/60.9\approx1.32\times. RTX 4090 has much weaker native FP64 throughput; at size 8192, the corresponding ratio is 9.81/0.62≈15.8×9.81/0.62\approx15.8\times. The hardware's throughput ratio between low and high precision matters considerably.

For every matched size and modulus count in these tables, fast is faster than accu. Increasing the modulus count lowers throughput for both. However, choosing a method requires comparing time to satisfy the same error target. If accu reaches that target with fewer moduli, the ranking at equal ss is insufficient. The throughput tables alone do not establish accuracy thresholds for each input; a practical configuration still needs validation on the target data.

3.2 Where one Ozaki II call spends its time

Color Implementation stage Work included
Green conv_64f_2_8i Bound estimation, scaling, truncation, all INT8 input residues; also accu's bound GEMM
Yellow cublasGemmEx The ss main INT8 × INT8 → INT32 products
Blue conv_32i_2_8u Reduce each INT32 output to a nonnegative UINT8 residue
Red inverse_scaling CRT combination, range reduction, and inverse scaling

Paper Figure 6, GH200, n=1024,16384n=1024,16384, accu and fast.

Paper Figure 6a Paper Figure 6b Paper Figure 6c Paper Figure 6d

Paper Figure 7, RTX 4090, n=2048,8192n=2048,8192, accu and fast.

Paper Figure 7a Paper Figure 7b Paper Figure 7c Paper Figure 7d

Original paper figures. Source: Figures 6 and 7. Each bar is normalized to 100%; the horizontal axis is the number of moduli.

In Figure 6, moving from size 1024 to 16384 on GH200 increases the share of main GEMMs, especially for fast. Preprocessing and reconstruction are more easily amortized at the larger size. Accu retains a heavier green stage because it includes an additional bound product.

Figure 7 shows a similar increase in the yellow share from size 2048 to 8192 on RTX 4090, while green conversion and red reconstruction remain substantial. This is consistent with Table 4's large speedup: the weak native FP64 baseline allows emulation to win despite its overhead. The two figures use different sizes, so bars at matching positions are not direct GPU comparisons at equal dimensions.

These plots show that work outside the main GEMMs matters. Percentages locate time, but do not explain its cause. A smaller green fraction can coexist with longer absolute preprocessing time. A GEMM inside green also means that complexity cannot be inferred from color alone.

For the operations and execution resources inside green, continue to Part II of the main article.