Manuscript Offprint
arXiv:2610.38983Beyond atol and rtol: Sound Test Oracles for Low-Precision GPU Kernels
XINYI SHI, Duke University, USA
Low-precision GPU kernels are commonly tested against a reference using hand-picked absolute and relative tolerances. Legitimate numerical error varies with the input, format and precision plan, so a fixed tolerance trades false alarms for missed faults. We present numeracle, which derives per-element acceptance regions from precision-annotated reference programs. Its calculus tracks shared rounding errors, provenance-ordered products, block-scaled quantizers and calibrated math-library errors. A rounding-interval check detects faulty stores that symmetric bounds can admit. Soundness is conditional on explicit rounding, hardware, domain and implementation assumptions; a fixed-input mode removes the zero-mean rounding assumption.
We evaluate 13 Triton operators from Liger-Kernel, Unsloth and vLLM on two GPU generations. The main campaigns produce no false alarm on 33,960 correct-kernel and behavior-preserving-variant runs per GPU. Under input shift, the GPU campaigns record no false alarm while tuned tolerances flag up to 30% of correct runs; final-version reference checks identify inputs without complete finite-range certificates. On the RTX PRO 6000, numeracle kills 116 of 124 effective mutants, versus 59–83 for four fixed baselines. Among 400 tuned tolerance configurations, requiring at most 1% false alarms in every evaluated Liger input group permits at most 31 of 53 main-mutant kills, versus numeracle's 50. Historical replays expose accuracy faults in eight change pairs without rejecting their matched corrected controls; a ninth change concerns rounding parity.
CCS Concepts: • Software and its engineering → Software testing and debugging; • Mathematics of computing → Mathematical software.
Additional Key Words and Phrases: test oracles, floating-point arithmetic, rounding-error analysis, GPU kernels, low precision, mutation testing
1 Introduction
Hand-written GPU kernels implement normalization, activation, attention and loss operations in libraries such as Liger-Kernel [Hsu et al. 2024], vLLM [Kwon et al. 2023] and Unsloth. Written in Triton [Tillet et al. 2019] or CUDA, they combine low-precision storage with higher-precision intermediates and approximate math intrinsics.
Reduction order and rounding positions change a correct kernel's output. Tests therefore accept differences up to atol + rtol|ref|, usually against a PyTorch reference [Barr et al. 2015]. These hand-picked tolerances can both hide faults and reject correct outputs. A vLLM Mamba2 test used atol = rtol = 0.5 before its memory-offset and test-coverage fix [vLLM contributors 2025b]; Liger's bf16 SwiGLU MLP test uses atol = 10⁴ [Liger-Kernel contributors 2026b]. Conversely, PyTorch's defaults flag 24% of correct Liger runs in our study, often because the low-precision reference is less accurate than the kernel (Section 2.3).
Allowable error depends on computation and input: a sum's error scales with term magnitudes despite cancellation, and normalization can amplify errors when row statistics are small. Both depend on the precision plan: intermediate rounding positions, formats and block scales. A tolerance covering the hardest inputs can sacrifice sensitivity elsewhere. Tuned baselines expose this trade-off across input families, shapes and row statistics (Section 7.4).
A reference program and precision plan specify an implementation class, fixing numerical obligations but leaving reduction order open. The analysis derives its input-specific acceptance region. Under an explicit zero-mean error model, probabilistic rounding analysis tightens linear-algebra bounds from worst-case nu to √n u scaling [Higham and Mary 2019]. A whole-program oracle must compose bounds through tensor operations, track rounding events shared by broadcasting
Author's Contact Information: Xinyi Shi, Duke University, Durham, North Carolina, USA.
Xinyi Shi
and reuse, model quantizers and non-RN hardware accumulators [Fasi et al. 2021], and account for the final output grid.
We present numoracle, an executable analysis of precision-annotated tensor references. Shadow tensors propagate float64 reference values, separating deterministically bounded residuals from modeled random errors; axis keys and event provenance preserve shared-error dependence across tensor operations. Per-element error-bound and rounding-interval checks judge kernel outputs. The latter can reject incorrect stores admitted by the symmetric bound, adding detections on individual inputs but no additional killed mutant in the main campaign. The per-call false-alarm claim assumes the rounding, hardware, domain and implementation contracts in Section 3.3; probability is over model executions, not repeated deterministic GPU runs. Fixed-input mode removes the zero-mean assumption but retains the other numerical contracts.
We evaluate 13 Triton operators in bf16, fp16 and fp32 on an RTX PRO 6000 Blackwell and an A100. Correct-kernel and variant campaigns had no false alarms; under input shift, finite-range checks identify uncertifiable inputs (Section 7.2). Reruns confirmed LayerNorm and SSD checks with the final implementation. On the RTX PRO 6000, numoracle killed 116/124 effective mutants, versus 59–83 for fixed oracles. Historical-bug replays test whether fixes eliminate rejection; CPU emulations and targeted witnesses separately evaluate deeper compositions and dependence rules (Section 7). Our contributions are:
-
Problem. We specify kernel correctness by a class of implementations and derive input-specific acceptance regions, exhibiting inputs on which fixed tolerances lose sensitivity or raise false alarms (Sections 3 and 7.4).
-
Calculus. We give a dependence-aware probabilistic error calculus for whole low-precision tensor programs, with shared random components, provenance-ordered products, block-scaled quantizers and calibrated math-library profiles, and prove it sound under a stated rounding model (Sections 4 and 5).
-
Checks and limits. We introduce a rounding-interval check that detects sub-ulp faults, and state a single-run indistinguishability limit for oracles that accept every legal output (Section 5.3).
-
Tool and study. We implement numoracle and evaluate it on 13 Triton operators from three libraries on two GPUs, against 400 tuned tolerance configurations and with nine historical bugs (Sections 6 and 7). The library, references, mutants and raw data are in the artifact.
Prior work gives probabilistic GPU matrix-product checksum thresholds [Braun et al. 2014; Gao et al. 2026], calibrates tolerances from correct runs [Sarkar 2026b] and measures benchmark-checker blind spots [Du et al. 2026]. Our contribution composes acceptance regions, shared-error tracking and a call-level probability budget through tensor references (Section 9). Through broadcasting, products and nonlinear operations, our rules preserve the probability bound's conditions: shared events remain correlated, event order justifies tighter products, and residuals are conservatively bounded. This composition gives a call-level guarantee and converts pre-store bounds into output-grid intervals.
2.1 Formats and Precision Plans
A binary floating-point format with significand bits rounds a real to a representable value with under round-to-nearest (RN), outside the subnormal range. Current kernels use fp32 () for accumulators and row statistics, fp16 () and bf16 () for activations and weights, FP8 E4M3 (, largest value 448) and E5M2 () for GEMM inputs and gradients, and block-scaled 4-bit formats. These store each element in E2M1 (), whose magnitudes are {0, 0.5, 1, 1.5, 2, 3, 4, 6}, and share one scale per block: MXFP4 uses 32-element blocks with a power-of-two scale [Rouhani et al. 2023], and NVFP4 uses 16-element blocks with an E4M3 scale and an fp32 tensor scale [Alvarez et al. 2025].
Precision plans specify rounding positions. Typical Triton normalization kernels load bf16 inputs, convert and reduce in fp32, and store in bf16; matrix kernels accumulate products in fp32 on tensor cores. Plans intentionally differ: Liger's RMSNorm offers bf16 or fp32 weight application. Kernels also use approximate math intrinsics: Triton lowers fp32 exp to ex2. approx applied to x log₂ e, and fp32 division to div. full1, whose specified errors exceed correct rounding's half ulp [NVIDIA 2026; Triton contributors 2026].
2.2 Current Kernel-Testing Practice
Kernel tests usually compare output o with the same-dtype PyTorch reference r, requiring |o - r| ≤ atol + rtol · |r| elementwise. PyTorch's assert_close defaults are rtol = 1.6×10⁻² for bf16, 10⁻³ for fp16 and 1.3×10⁻⁶ for fp32, each with atol = 10⁻⁵ [PyTorch 2026]. Libraries override these per test. AMD's aiter RFC proposes replacing hard-coded atol = 100 in mixture-of-experts tests with format-derived tolerances: rtol = f · max(u_c, u_o, Ku_acc) and atol = f · 2^⌊log₂ max |r| · max(u_c, 2u_o, Ku_acc), for compute, output and accumulation precisions, reduction length K and safety factor f [AMD ROCm 2026].
Tolerances drift toward looseness. We mined the full histories of 11 open-source kernel libraries (Liger-Kernel, Uncloth, vLLM, FlashAttention, xFormers, TransformerEngine, FlashInfer, SGLang, torchao, bitsandbytes and apex, up to 1 October 2026) for test-code commits changing atol, rtol or cosine-similarity thresholds. The detector reports 247 candidates: 125 with loosenings, 70 with tightenings (13 both), and 65 classified only as literal-to-formula changes. A random sample of 40 reports per direction (78 distinct commits) was checked against the diffs (labeling and review: Section 7.1); 35 loosening and 25 tightening reports genuinely changed allowances. Adjusting detector counts by these estimated precisions gives a loosening-to-tightening ratio of about 2.5 to 1. At repository heads, 178 of 397 bf16 relative-tolerance literals in test code (45%) are at least 1.6×10⁻², the assert_close default. The artifact contains pinned commits, the detector and every labeled diff.
2.3 Three Ways a Fixed Tolerance Fails
Permissive tests and missed bugs. vLLM's Mamba2 kernels process continuous-batch sequences in fixed-size chunks. A wrong chunk-scan memory offset corrupted outputs whenever a sequence with an initial state started inside a chunk longer than one tile. The test used atol = rtol = 0.5 except for chunk sizes 8 and 256, compared only one output head and channel, and omitted bf16 continuous batching. The fix tightened tolerance to 5 × 10⁻³–10⁻² depending on sequence length [vLLM contributors 2025b]; a second fault on the same path survived until a later release [vLLM contributors 2025a]. Section 7.5 reports numeracle's results on both.
The reference is less accurate than the kernel. For a bf16 RMSNorm input-gradient element, Liger returns 0.00146484, the float64 reference approximately 0.00146491, and the bf16 PyTorch reference 0.0018158 (24% off). Comparing kernel with reference, assert_close flags the correct kernel. PyTorch's defaults flag all 80 runs in each bf16/fp16 RMSNorm and RoPE configuration we tested (Section 7.2).
Legitimate error depends on the input. The rounding error of a sum scales with Σ |terms| while the result scales with |Σ terms|, so a correct kernel's relative error is unbounded under cancellation. Normalization kernels divide by row statistics, so a row whose mean square or variance is close to ε amplifies every rounding error. A tolerance tuned on Gaussian inputs therefore fails on heavy-tailed
Xinyi Shi
or degenerate ones, and a tolerance wide enough for those is blind on Gaussian ones. Figure 1 shows this for the bf16 RMSNorm backward kernel: against the PyTorch reference, correct implementations need on Gaussian inputs but 0.125 on near-degenerate rows, a 20-fold spread; against the float64 reference the hardest family is a different one.

Fig. 1. Smallest that passes every correct run of the bf16 RMSNorm backward kernel ( and ), per input family. CPU emulations of correct kernels with different reduction orders, 20 seeds and four shapes per family. The required tolerance changes by up to across families, and which family is hardest depends on the reference.
2.4 Probabilistic Rounding-Error Analysis
For an inner product of length evaluated with unit roundoff , the classical worst-case bound is with , assuming and no overflow or under-flow [Higham 2002]. Higham and Mary [2019] model the relative rounding errors as independent random variables of mean zero; later work weakens independence to mean independence, under which each error has mean zero conditionally on the previous ones [Connolly et al. 2021; Higham and Mary 2020]. Under the original model, with probability at least ,
for fixed and as . Its growth matches observed errors far better than , and the model has been validated for random data [Higham and Mary 2020; Ipsen and Zhou 2020]. numoracle adopts the conditional mean-zero formulation but needs more than bounds for single linear-algebra kernels: per-element bounds for whole tensor programs, dependence between elements, quantized formats and real math libraries. Section 4 builds that calculus.
3 Problem Formulation
3.1 References, Precision Plans and Correct Implementations
A kernel maps input tensors to output tensors . Its specification is a reference program , a straight-line tensor program over real arithmetic whose exact result on we write . A precision plan annotates with the decisions every implementation must respect:
-
the format to which each stored intermediate and each output is rounded;
-
the accumulation format of each reduction and contraction;
-
each quantizer, with its format and scale granularity;
-
the math-library profile, i.e. the accuracy guaranteed for each elementary function.
The plan deliberately leaves out what an implementation is free to choose: the order and tree shape of every reduction, its blocking into tiles, and fused multiply-add contraction. This freedom is exactly what makes bit-exact testing impossible. Anything that rounds is not free: a split-K decomposition that stores partial sums in low precision performs extra roundings, so it must appear in , and an implementation that adds roundings outside is outside the class.
Definition 3.1 (Correct implementations). is the set of implementations that evaluate by performing, in any order allowed above, the roundings that prescribes (fused multiply-add may skip the rounding of a product), with elementary functions within the profile. Their outputs on form the legal set .
Accuracy and parity. In accuracy mode, is the intended mathematics and the kernel's precision plan; a quantizer then contributes error relative to the unquantized input. In parity mode, includes selected rounding steps of a trusted implementation, such as a Hugging Face intermediate cast to bf16, as semantic operations. It still admits the choices left open by and does not require bit-exact replay. The two modes can disagree. The GEGLU kernel that Liger-Kernel PR #986 changed was more accurate than the Hugging Face reference, so it passes our accuracy check. In parity mode the uncertain input to that semantic cast also makes our enclosure too wide to distinguish the change (Section 7.5).
3.2 Sound and Sensitive Oracles
An oracle maps an input and an output to pass or fail; numeracle may also answer inconclusive (A3).
Definition 3.2 (-soundness). is -sound for under a rounding model , a probability law for the rounding errors, if, for every and every input , . The probability is over the rounding errors as modeled by .
-soundness is a statement about the model . On real hardware a fixed input produces fixed rounding errors, so the probability is not a frequency over repeated runs. We therefore state precisely which model Theorem 5.1 uses, test it empirically on 33,960 GPU runs per GPU (Section 7.2), and offer a fixed-input mode whose guarantee needs no zero-mean rounding assumption.
We measure the sensitivity of by its detection rate on faulty implementations over the evaluated inputs. A -sound oracle passes correct implementations except with probability under the model; the less it accepts beyond their likely outputs, the more faults it can detect. We measure this tightness on correct runs as , the fraction of the per-element bound that the worst element of a run uses.
3.3 Rounding Model and Assumptions
A1 (Rounding model.) The model executes an implementation with each ordinary rounding of an intermediate value to a format replaced by , where is a random variable with at most half the spacing of at (gradual underflow included) and , in the event order of Appendix A. Semantic casts, quantizer scales and each output's final store are of the model's values; both checks observe these stored outputs, which are not reused inside the call. Round-to-nearest is the path : it meets the bounds, but for a fixed input its errors are fixed numbers.
Xinyi Shi
A2 (Math library and accumulators.) Each elementary-function call satisfies for the active profile, and each hardware accumulator follows its calibrated model (Section 4.6).
A3 (Domain.) Every exact value is finite, modeled arithmetic and stored values do not overflow, and every divisor and every argument of a logarithm or root stays inside the function's domain over its whole interval , so that every bound is finite. Otherwise numeracle reports the element as uncertified and the result is inconclusive rather than a fault; Section 7.2 reports such outcomes under input shift.
A4 (Implementation.) numeracle evaluates and in float64 rather than in real arithmetic. The checks use , assuming the float64 values , satisfy .
A1 is the mean-independence model of Higham and Mary [2020] and Connolly et al. [2021], a weakening of the independence model of Higham and Mary [2019], and, like any rounding model, an idealization. For a fixed input, deterministic round-to-nearest commits a fixed error, and even inputs drawn from a continuous distribution do not make each error exactly mean-zero. A1 is plausible when test inputs randomize the low-order bits that rounding errors depend on, and it fails on structured inputs, such as tensors of identical values, whose errors repeat. Theorem 5.1 is therefore a statement about the model; Section 7 tests the model on real kernels, and the fixed-input mode drops A1's zero-mean condition and uses deterministic worst-case bounds throughout. A2 is a hardware assumption that calibration tests for the intrinsics and Triton's t1.dot on each GPU and compiler version but cannot prove (Section 6.2); for the cuBLAS GEMMs of one historical bug we assume t1.dot's model without calibrating cuBLAS. A1 assumes gradual underflow; flushing subnormals to zero is outside the model. A4 is tested, not proved, against 100-digit arithmetic on sampled inputs of every shipped library reference and Liger's cross-entropy (Section 6.3), excluding SSD and the historical-bug references.
3.4 Limits of Fixed Tolerances
Let be the legal error radius of one output element, the largest over . A fixed tolerance accepts every legal output only if on every input the test will ever see. For a sum, grows with while , so is unbounded under cancellation, and grows with the input's scale and the reduction length. Any such is therefore loose by the ratio between the hardest and easiest inputs it must cover, often an order of magnitude (Fig. 1). An input-adaptive oracle avoids this trade-off by using an input-specific region. Under A2–A4 and the bounded-error premise of A1, numeracle's fixed-input mode gives a worst-case enclosure; its probabilistic mode instead gives a model-conditional high-probability region, not a bound on every legal output.
4 The numeracle Error Calculus
4.1 Overview
A mathematical shadow element carries the real-arithmetic reference value and an error model. The implementation approximates these quantities in float64 under A4. Each operation propagates the reference value and the error model according to the precision plan. The tester writes the reference much like a PyTorch reference, passing the plan's formats as arguments (Fig. 2). At the end, numeracle turns each output's error model into a per-element bound and, for outputs stored in a low-precision format, into an interval of acceptable representable values, and checks the kernel's output against both (Fig. 3).
import numoracle as nm from numoracle import shadow as no
def ref_rms_norm_fwd(X, W, eps, dt="bf16"): x, w = no.shadow(X), no.shadow(W) ss = no.sum(no.mul(x, x, "fp32"), -1, keepdim=True, acc="fp32", out=None) ms = no.div(ss, float(X.shape[-1]), "fp32", lib="triton_fast") r = no.rsqrt(no.add(ms, eps, "fp32"), "fp32", lib="accurate") xn = no.cast(no.mul(x, r, "fp32"), dt) return no.mul(xn, w, out=dt)
Liger RMSNorm, casting_mode="llama"
# inputs are taken as exact
# fp32 div.full
# libdevice rsqrt
# normalized row stored in bf16
# weight applied in fp32, stored in bf16
Y = liger_rms_norm(X, W, eps) report = nm.check_kernel({"Y": (Y, ref_rms_norm_fwd(X, W, eps))}, delta=1e-6)
Fig. 2. A numoracle reference for the forward pass of Liger's RMSNorm, as used in our evaluation. Each operation names the format it rounds to; out=None leaves a value unrounded, and acc sets the accumulation format of a reduction.

Fig. 3. The reference and the kernel see the same inputs. Shadow execution turns the precision plan into per-element bounds, and the two checks compare the kernel's output with them.
4.2 Shadow Elements
A shadow element carries the exact value , a deterministic error-magnitude bound , and random error components. Each component has a key of tensor axes, sub-Gaussian proxy , worst-case bound , rounding origins orig, global incidence cap , and complete coordinate-placement token (Section 4.7). The element also records origins dorig whose effects were folded into , for product ordering (Section 4.5). At nonterminal values, on the event of Section 5, , where , , and is a martingale sum over orig with proxy at most . The residual may be random. Terminal-store summaries are numerical envelopes of the deterministic round-to-nearest values actually stored, handled separately in the proof (Section 5).
The key records axes along which events may be shared and errors must be combined coherently; their coefficients need not agree. For each event, the positions where it can occur project to at most distinct coordinate tuples outside . Thus a line of length along contains at most occurrences of one event. Two summaries drive everything else: the worst-case total , and the probabilistic scale , which combines components correlation-safely within groups that share rounding operations and in quadrature across groups. The groups are the connected components of the relation “orig sets intersect”. The high-probability error bound of an intermediate value is , with (Section 5 accounts for its failure probability):
Xinyi Shi
Figure 4 states the core propagation rules; the following subsections explain them. Here is the unit roundoff and is half the smallest positive subnormal value of format f.
Fig. 4. Core rules of the calculus. A component has key , proxy , worst-case bound and origin set ; incidence and placement metadata are omitted here and propagated as in Section 4.7. A fresh private component has . . merges components with equal keys, adding if their origins intersect and otherwise; does the same over the positions of axis , adding coherently if and as otherwise, with . is a fresh set of accumulation events, , and means that every event of one set precedes every event of the other. In FUN, LIB is the library bound maximized over . Nonlinear rules also add orig of their inputs to dorig of what they fold into .
4.3 Rounding
When the plan rounds an intermediate z with shadow to format f, numoracle adds a private component, with empty key, incidence cap 1 and a fresh origin, of size
The bound uses , which holds on the event analyzed in Section 5.
4.4 Linear Operations, Broadcasting and Reductions
Addition merges equal-key components coherently when origins intersect and in quadrature otherwise (Fig. 4). Broadcasting along adds to each key. For reduction over positions of , let for a sum and for a mean. If is in a component's key, its terms may share events and add coherently, . Otherwise each event occurs in at most terms, giving by Cauchy–Schwarz. Pure quadrature is the case .
The reduction projects the event's support onto the retained coordinates, so it preserves the inherited global cap (Section 4.7).
The accumulation's own rounding errors are bounded independently of the summation order. Whatever the tree, at most additions occur, the computed addends satisfy , and by induction every partial sum is at most . numeracle adds one private component for the relative part and charges the underflow part to , which needs no zero-mean assumption: many tiny addends of one sign may all round the same way.
Unlike the classical factor , the factor stays finite for every ; numeracle warns when , where the bound is valid but loose.
Ignoring keys is not a harmless simplification. Multiplying 4,096 ones by the bf16 scalar and summing gives an error of exactly 8: the scalar's rounding error, , is added 4,096 times. A model that treats the 4,096 errors as independent bounds the error by 1.42 and raises a false alarm on every run. With the scalar's component keyed by the broadcast axis, numeracle's bound is 17.1.
4.5 Products and Nonlinear Operations
Products are where classical analyses add second-order terms. Summed worst-case over a contraction, those terms can dominate FP8 and FP4 bounds. numeracle avoids them with an exact decomposition. Let and . Then
Suppose every rounding operation that affects precedes every one that affects in program order, as when two operands are quantized independently. “Affects” includes operations whose effect an earlier nonlinear step folded into : a row maximum computed from rounded values depends on those roundings even though its error is now deterministic, and multiplying it by the same values is not an ordered product. numeracle therefore tests ordering on orig dorig. Then the coefficient of is fixed before 's errors occur. Under A1, 's components therefore remain martingale sums, with coefficients bounded by , and no second-order term is needed (Theorem 5.4). When origins are shared or interleaved, as in , numeracle propagates both first-order terms with exact coefficients and adds the second-order term to .
Matrix multiplication applies the same rule along the contraction axis and records contraction sharing. An error in reaches every column of the result, so 's components gain the column axis in their key; 's gain the row axis. An unshared contraction axis of length uses the factor ; projection of that axis and sharing of the new axis preserve the inherited cap. Division uses first-order terms with exact coefficients and adds a bounded second-order remainder to .
An elementary function scales every component by , a deterministic coefficient. It adds , a Taylor remainder and the library error of the active profile to :
Linearizing at the perturbed point instead, without a remainder, is unsound: evaluated at a perturbed point depends on the error itself, so the result is no longer zero-mean. (Charging the whole propagated error to would be sound but loose.)
4.6 Quantizers, Math Libraries and Accumulators
Quantizers. In accuracy mode, quantizing with scale to a grid contributes, per element, at most half the grid spacing at times , plus a deterministic clipping error for values beyond
Xinyi Shi
the grid's maximum. numoracle supports per-tensor, per-row and per-group FP8 scales and block-scaled MXFP4 and NVFP4. Scales are computed from the exact values and widened to cover any input within , because an implementation computes its scale from its own, perturbed values. In parity mode the quantizer belongs to the reference, and input uncertainty can change its output when the interval crosses grid boundaries. The same holds for a semantic cast, a rounding that the reference itself performs: the reference value becomes , the kernel computes , and . numoracle keeps the components of and adds to , where is half the format's spacing at a magnitude.
Math libraries. Elementary functions are rarely correctly rounded on GPUs. numoracle charges each call a deterministic error , with an envelope chosen per function and profile (Table 1). The accurate profile models CPU libraries and CUDA's libdevice. Its one exception is GELU: standard implementations evaluate , which loses about to cancellation for negative , so the envelope is rather than . The triton_fast profile models Triton's default fp32 lowering, where the rounding of alone contributes a relative error of about to exp. Every profile entry also adds a floor : a library may return zero for a tiny result, as fp32 sigmoid(-90) does when its internal exp overflows, and a purely relative envelope would reject that. Both profiles are generous by design and are tested on each GPU (Section 6.2).
Table 1. Library error bounds per profile (: fp32 unit roundoff; : sigmoid). Every entry except correctly rounded operations also adds .
| Function | accurate | triton_fast |
|---|---|---|
| exp | ||
| sigmoid | ||
| silu | ||
| log | ||
| rsqrt, approximate sqrt | ||
| sqrt_t_rn, div_rn | correctly rounded (ordinary rounding) | correctly rounded (ordinary rounding) |
| tanh, erf | via libdevice, as accurate | |
| gelu (tanh or erf form) | ||
| fp32 division | correctly rounded |
Accumulators. Tensor cores may accumulate with truncation rather than round-to-nearest [Fasi et al. 2021], which violates A1's zero mean. For such accumulators numoracle charges the whole accumulation error to . Following Fasi et al. [2021], we model each block of products as aligning the products and running sum to the largest term, truncating each, and then truncating the block sum; under this model, each of these truncations loses less than in the normal range, so the charge is , the last term for truncation below the normal range. Calibration found a bias toward zero in Triton's t1.dot on both GPUs and fitted on the RTX PRO 6000 and on the A100 (Section 6.2).
4.7 Shape Operations and Duplication
Shape operations can copy one rounding event to several positions: for example, repeat, gathers with repeated indices, or combining a tensor with a rotated copy of itself, as in rotary embeddings. The global incidence cap bounds how many coordinate tuples outside can contain any one event. Reductions project these coordinates and preserve the cap; duplication along unshared axes and row-dependent gathers may increase it. A placement token certifies a common support envelope for shared events, independently of their coefficients and masks. Merges take the larger cap when origins are disjoint or tokens agree, and sum the caps otherwise. Concatenation sums operand caps when origins overlap because operands occupy different coordinate ranges. Appendix A gives the updates and proves the invariant. The certified reduction factor is .
4.8 Checks
For one kernel call whose outputs have elements in total, numoracle computes for every output element the bound
and performs two checks. Sharing across all outputs makes the false-alarm budget hold per kernel call rather than per tensor. Both checks use (A4), and the interval endpoints below are rounded outward.
Bound check. Every element must satisfy .
Rounding-interval check. For an output stored in format , numoracle keeps the shadow of the value before the final rounding, with exact value and bound . Because is monotone, a correct implementation's stored value lies in the interval
and every representable value in that interval is the rounding of some value within of (Theorem 5.2). The ideal check accepts exactly those values. When is small compared with the spacing of , the interval holds the correctly rounded value and, for elements near a rounding boundary only, its neighbor. A store that truncates instead of rounding then produces a rejected value in a large fraction of elements (Theorem 5.7). In general, a symmetric tolerance on cannot express this interval: its endpoints depend on the position of between representable numbers. Each failure reports the float64 reference value and computed bound as a witness.
5 Soundness, Sensitivity and the Single-Run Limit
5.1 Soundness
THEOREM 5.1 (SOUNDNESS). Let , let be an input, let , and let , where conservatively counts the call's propagation checkpoints (Appendix A). Under A1–A4, the probability under the rounding model that numoracle's bound check or rounding-interval check fails on any output element of the call is at most . In fixed-input mode, where and throughout, neither check fails, and only A2–A4 and the error bound in A1 are needed.
The proof (Appendix A) orders the ordinary rounding events, one per ordinary rounding operation and element, by program order. Let be the event that all propagation checkpoints stay within their envelopes ; copies made by shape operations then stay within their own and need no tail events (Appendix A). The invariant holds for each nonterminal element on the event that all earlier propagation checkpoints stayed within their envelopes: the element's error equals with , where each sums rounding errors of the events in orig with coefficients fixed before occurs, and . Merges follow from Minkowski's inequality (Theorem 5.3), ordered products from judging order on orig dorig (Theorem 5.4), and reduction factors from the global incidence invariant and Cauchy–Schwarz (Theorem 5.5); remainders, library errors, underflow and semantic casts go to . Azuma–Hoeffding bounds the first propagation checkpoint leaving its envelope by ( allows about checkpoints at ; numoracle checks the count), using predictable truncation rather than conditioning the martingale on the success event. The final store is of the pre-store
Xinyi Shi
value and is not reused. Its numerical summary adds a rounding allowance to , without treating the deterministic store residual as centered. One pre-store tail event of probability per output covers both checks: in total. Monotonicity places the stored value in the checked interval (Theorem 5.2).
LEMMA 5.2 (EXACTNESS OF THE ROUNDING INTERVAL). Let be finite reals in the nonoverflowing domain of round-to-nearest , with a fixed tie rule. Then maps onto exactly the representable values in .
LEMMA 5.3 (COMBINING COMPONENTS). Let and be martingale sums with predictable coefficients, deterministic coefficient-magnitude bounds, and proxies . Then has proxy at most , and at most when no event appears in both sums.
LEMMA 5.4 (ORDERED PRODUCTS). If every rounding event affecting , including those folded into its deterministic part, precedes every rounding event affecting , then restricted to 's random part is a martingale sum whose inherited coefficients are multiplied by the predictable , bounded by on .
LEMMA 5.5 (MULTIPLICITY). If each rounding event appears in the components of at most positions along , the quadrature sum over , multiplied by , bounds the proxy of the reduction. For an unshared axis of length , the global incidence invariant supplies and remains valid after the axis is projected away.
5.2 Tightness
Soundness only needs the rules to over-approximate; usefulness needs them to lose little, and we give no general guarantee of that. is a sub-Gaussian proxy built from worst-case increment bounds, so can exceed the true error's standard deviation by far more than when actual rounding errors are much smaller than their bounds, and correlation-safe merges can add more. We therefore measure tightness. On 200 CPU trials per configuration of emulated correct kernels with different reduction orders, the worst element of a run uses a median of 88% of its bound for GEMM, 62% for attention, 97–99% for normalizations, activations and RoPE, where the half-ulp of the final store dominates, 22–27% for FP8, MXFP4 and NVFP4 GEMMs in accuracy mode and 5% for cross-entropy; the median share of the bound taken by the deterministic part is at most 6%. No trial exceeded it.
5.3 Single-Run Detection Limits
PROPOSITION 5.6 (SINGLE-RUN LIMIT). Let accept every output in the legal set . If a faulty implementation produces an output in on input , then passes on .
The statement is elementary, but it separates two reasons why a fault escapes. Either the oracle is loose, with an acceptance region much larger than , or the fault is invisible on that input because its effect stays inside . Tightness addresses only the first reason; the second requires different inputs or more observable outputs.
Theorem 5.6 assumes an oracle that accepts every legal output. A -sound oracle need not: numoracle's default bound covers a correct kernel's error with probability under A1, not every point of , and only its fixed-input bound contains . So we cannot claim that the faults below are invisible to every oracle; we claim only that their effect lies within numoracle's bound on the inputs tested. Misplacing in changes outputs by a relative when the mean square is of order one, far below bf16's rounding scale and within the measured fp32 bounds. On rows with it changes them by orders of magnitude, and there numoracle detects every instance (Section 7.4). Two further faults alter only per-row losses inside a cross-entropy kernel whose test observes their mean; with reduction set to none, numoracle detects both (Appendix B). A third adds one rounding to the loss and stays within the bound in both settings.
One might hope to pool evidence across runs instead, since a fault repeats in every run while rounding noise does not. Pooling does not come for free, because correct kernels also deviate systematically. In the GPU runs, the correct Unloth RoPE gradient deviated from the float64 reference value in the same direction in every run, and correct normalization kernels showed a magnitude bias of the same sign in 56–64% of runs, where errors symmetric about zero would give 50%. A pooled test must bound such biases a priori or it will flag correct kernels; we leave such tests to future work.
PROPOSITION 5.7 (SENSITIVITY TO ROUNDING FAULTS). Consider an output element stored in a format of at most 24-bit precision with pre-rounding bound , and assume A4. Suppose a faulty kernel computes the same pre-rounding value but rounds toward zero, that the position of between consecutive representable numbers is uniformly distributed, and that the pre-rounding value lies within of except with probability at most (Theorem 5.1). Then the implemented rounding-interval check rejects the element with probability at least .
PROOF SKETCH. Let be the fractional position of in ulps. If , every pre-rounding value within of truncates to the lower neighbor, while is the upper one. Under A4, float64 and move the implemented lower end by less than ulp (Appendix A).
Over elements with independent positions, and since Theorem 5.1 bounds the joint event that any pre-rounding value of the call leaves its bound by , a truncating store escapes with probability at most . This is why the rounding-interval check catches truncation faults that the fixed tolerances used in practice miss (Section 7.3).
6 Implementation
6.1 Library and References
numoracle is a pure-PyTorch core library of 1,535 lines of code, excluding comments, blank lines and docstrings, with no other dependencies. Shadow tensors store and in float64, with keys, origins and incidence/placement metadata; variance estimates are diagnostic only. The library provides elementwise arithmetic and casts; sums, means and cumulative sums; matmul, bmm and two-operand e-insum; softmax, including the flash-attention variant that stores probabilities in bf16; FP8 quantizers per tensor, row and group, and MXFP4 and NVFP4 block quantizers; the elementary functions of Table 1; and shape operations. Format emulation, round-to-nearest and round-toward-zero for every format of Section 2.1, is exact in float64.
We wrote references for GEMM in bf16 and fp16, scaled FP8 GEMM, NVFP4 and MXFP4 GEMM, RMSNorm, LayerNorm, fused RMSNorm with dynamic FP8 quantization, softmax, attention with flash numerics, GEGLU and SwiGLU forward and backward, cross-entropy, rotary embeddings, and the Mamba2 chunked state-space scan. The Liger and Unloth subjects share these references, adapted to each kernel's precision plan (Section 7.6).
6.2 Calibrating Math Libraries and Accumulators
Theorem 5.1 relies on A2, so the profile must match the hardware and compiler. Before testing on a new GPU or compiler version, a calibration step of under one minute evaluates every math intrinsic that the kernels under test call on inputs, including arguments up to where exp overflows, against float64. It stops the campaign if any error exceeds its profile, or if an operation documented as correctly rounded misses half an ulp. It also measures the signed accumulation
Xinyi Shi
error of t1.dot on positive inputs for from 256 to 16,384, tests for bias in both directions, and fits the truncation period . On the RTX PRO 6000 (sm_120) and the A100 (sm_80) with Triton 3.6, every intrinsic stayed within its profile, the largest ratio being 0.80 of the bound (libdevice tanh); sqrt_rn and div_rn matched correct rounding on the sampled inputs. t1.dot accumulation was biased toward zero on both GPUs, with no positive bias, and consistent with and respectively. Calibration is evidence for A2, not a proof: a sampled maximum is not a supremum. An adversarial A100 stress test, with one large product and many below of it, showed the small ones dropped, exceeding an earlier per-block charge up to 1.97 times; the alignment charge (Section 4.6) covers all 240 configurations; a 32-case grid passed on both GPUs ( of the bound). Calibration also showed why such evidence is needed: on the CPU, PyTorch's float32 sqrt missed correct rounding on 17% of 65,544 samples, by up to 1.5 half-ulps.
6.3 Validating the Calculus Against Witnesses
We developed the calculus test-first, turning inputs on which an emulated correct implementation exceeded a rule's bound into regression tests. Initial witnesses led to the rounding-interval, sharing and ordered-product rules; proof review exposed accumulation/underflow, lost provenance, semantic-cast and math-library-floor errors. Later audits corrected shared-event duplication through where and coordinate shifts, quantizer half-spacing after division, nonfinite and overflow handling, softmax shifts of perturbed inputs, and incidence counts under composed shape operations. Appendix B records the individual witnesses; Section 7.1 describes reference comparisons and GPU reruns after the repairs.
The revised rule set is checked by the CPU regression suite recorded in the artifact, including composed movement and reduction witnesses for the global-incidence invariant. On 200 trials per configuration of 21 operator configurations, emulated correct kernels with different reduction orders never exceeded their bound. With the final implementation, we re-evaluated and of 40 outputs on 20 inputs each with 100-digit arithmetic, covering every shipped library reference and Liger's cross-entropy. The largest discrepancies were and of the A4 allowance for and , respectively. This check excludes SSD and the historical-bug references.
7 Evaluation
We answer six research questions:
RQ1 Does numoracle accept correct kernels and variants across GPUs and input shifts?
RQ2 How many seeded faults does it detect compared with fixed oracles?
RQ3 How does it compare with tuned tolerances, including under input shift?
RQ4 Does it detect historical numerical bugs and pass their fixes?
RQ5 What do writing references and running the checks cost?
RQ6 Which calculus refinements matter, and how does affect the results?
7.1 Setup
Subjects. We test 13 Triton operators from three libraries: 11 Liger and Unsloth operators, forward and backward, and two vLLM kernels, forward only. Liger-Kernel at commit 91e51df: RMSNorm (casting mode 11ama), LayerNorm (affine), SwiGLU, GEGLU, cross-entropy and rotary embeddings. Unsloth at commit d68515a: RMSNorm, rotary embeddings, SwiGLU, GEGLU and cross-entropy. vLLM's Mamba2 chunked state-space kernels, batched and with continuous batching (ssd, ssd_varlen), at the merge commit 46ae7f6 of PR #21783. Every operator runs in bf16, fp16 and fp32 on four shapes, including non-powers of two such as and and vocabularies of 12,345 and 32,000. Cross-entropy runs with reduction mean and none.
Mutants. We apply seven mutation operators to the Triton source, one edit per mutant (Table 2). We also generate behavior-preserving variants that change block sizes, warps or pipeline stages, swap commutative operands, re-associate sums or split reduction loops; any alarm on them is a false alarm. Mutants that crash on every run or are bit-identical to the correct kernel on every run (inert) are excluded, which leaves 53 effective mutants for Liger (of 79; 2 crashing, 24 inert), 27 for Unsloth (of 48) and 44 for vLLM (of 68).
Table 2. Mutation operators and effective mutants per library.
| Operator | Change | Liger | Unsloth | vLLM |
|---|---|---|---|---|
| M1 | drop an fp32 upcast on load | 3 | 2 | 0 |
| M2 | insert an extra rounding to the input dtype | 12 | 8 | 8 |
| M3 | downgrade an fp32 accumulator | 0 | 0 | 9 |
| M4 | store with truncation instead of rounding | 11 | 2 | 4 |
| M5 | misplace ε in rsqrt(x + ε) | 2 | 1 | 0 |
| M6 | shift a tail mask by one | 14 | 9 | 18 |
| M7 | apply a constant or scale in low precision | 11 | 5 | 5 |
| Total | 53 | 27 | 44 |
Inputs. Each configuration runs 20 seeds that cycle through three input families: Gaussian, Student-t with 3 degrees of freedom, and Gaussian with 1% outlier channels scaled by 20. For the normalization operators, a degenerate-row phase draws rows whose mean square or variance is with log-uniform in [1/4, 4], over 10 seeds. For vLLM, a probe phase uses layouts in which a sequence starts inside one chunk and continues into the next. These probes are a separate historical-bug phase and do not enter the 480 main correct-kernel runs; their corrected control includes the later PR #23279 fix.
Oracles. We compare numoracle's certified checks (, per kernel call) with four fixed oracles: the tolerances in each library's own tests at the pinned commit, checked by hand (file and line in the artifact; dtypes a library does not test are left out); PyTorch's assert_t_close defaults; atol = rtol = ; and the aiter formula with . The fixed oracles compare against the PyTorch reference in the kernel's dtype, as the tests they come from do. RQ3 adds tuned tolerances, defined there.
Metrics. A false alarm is a flagged run of a correct kernel or a behavior-preserving variant. A mutant is killed by an oracle if, on the same input, the oracle fails the mutant and passes the correct kernel. Inconclusive outcomes count as neither detections nor false alarms. We report counts and compare kill sets with exact McNemar tests at the mutant level; these tests are exploratory because mutants share kernels.
Platform and versions. We use an RTX PRO 6000 Blackwell (sm_120) and A100-SXM4-40GB (sm_80), with PyTorch 2.11.0 (CUDA 12.8) and Triton 3.6.0. Results are for the RTX PRO 6000 unless stated otherwise. Main campaigns and timings used earlier implementations. After the repairs in Section 6.3, we reran LayerNorm, SSD and three historical bugs on both GPUs; all 10,290 correct/variant controls per GPU pass, with LayerNorm retaining 10/11 main and 11/11 degenerate-row kills and SSD 41/44. RQ4 reports the historical reruns; RQ6 uses new Liger/vLLM and original Unsloth ablations. The experimental "final implementation" is e447e916; the artifact adds guard patch de63b01, compared offline without GPU reruns (Appendix B). A100's Unsloth count is 26/28 instead of 25/27: one RoPE truncation mutant changes outputs only there.
Xinyi Shi
Use of AI assistants. Claude (Anthropic) and Codex (OpenAI) assisted with library/reference code, mutation and analysis scripts, proof drafts, counterexample search and manuscript preparation. Codex produced the initial labels in Section 2.2; an author reviewed all 80 judgments against the diffs. Numerical measurements come from execution records, with regression witnesses and high-precision checks in Section 6.3. The authors are responsible for the claims and artifact.
7.2 RQ1: False Alarms
numoracle raised no false alarm in any of the 3,960 runs of correct kernels or the 30,000 runs of behavior-preserving variants, on either GPU (Table 3). These trials test the reference and hardware contracts; shared inputs preclude an independent-trial confidence bound, and the counts do not establish the model-level guarantee (Theorem 5.1). The fixed oracles that compare against the PyTorch reference do not share this property. assert_close flags 24.0% of correct Liger runs, including all 80 runs of the bf16 and fp16 RMSNorm and rotary-embedding configurations separately, and every run of the correct vLLM kernels, because the low-precision reference is less accurate than the kernel (Section 2.3). The aiter formula flags 54 of 80 correct fp32 Liger SwiGLU runs, and 97% of correct vLLM runs.
Table 3. False alarms on correct kernels (flagged runs; RTX PRO 6000; identical counts for numoracle on the A100). Degenerate rows: Liger and Unsloth normalization kernels. Library: only dtypes the library's tests cover.
| Oracle | Liger | Unsloth | vLLM | Degenerate rows |
|---|---|---|---|---|
| numoracle | 0 / 1,680 | 0 / 1,440 | 0 / 480 | 0 / 360 |
| Library tolerances | 58 / 1,280 (4.5%) | 0 / 560 | 125 / 400 (31.2%) | 41 / 280 (14.6%) |
| atol = rtol = 10⁻² | 3 / 1,680 (0.2%) | 2 / 1,440 (0.1%) | 203 / 480 (42.3%) | 86 / 360 (23.9%) |
| aiter formula | 56 / 1,680 (3.3%) | 125 / 1,440 (8.7%) | 465 / 480 (96.9%) | 0 / 360 |
| assert_close defaults | 404 / 1,680 (24.0%) | 326 / 1,440 (22.6%) | 480 / 480 (100%) | 168 / 360 (46.7%) |
On behavior-preserving variants the picture is the same: numoracle flags none of 30,000 runs, while assert_close flags 23%, 28% and 100% of the Liger, Unsloth and vLLM ones on the main inputs. The A100 reproduces every count in Table 3 except one more library and one more assert_close alarm on Liger's degenerate rows, although its t1.dot truncates every 8 products instead of 16; calibration adapts the bounds.
Distribution shift. We then ran every correct kernel and a sample of variants, 20 seeds per configuration, on four shifted input families not used for tuning; heavy-tailed Student- inputs scaled to median (S1; the main runs use the same family scaled to unit variance), magnitudes spread log-uniformly over (S2), rows with a large common offset, , that make normalizations cancel (S3), and magnitudes near the underflow threshold (S4). Inputs whose exact output would overflow were scaled down just enough (320 of 3,600 cases under each of S2 and S3, all fp16 gated activations). Fixed oracles retain their settings (Table 4, A100; RTX PRO 6000 differs in three Liger baseline counts under S4). The original GPU campaigns recorded no false alarm among 14,400 correct and 2,616 variant runs per GPU. With the final implementation, we reran the 536 correct calls and 98 equivalent-variant calls per GPU identified by incomplete A3 certificates: all 634 were inconclusive and none failed. Terminal output error envelopes cross the fp16 range in these rescaled GEGLU/SwiGLU cases; GEGLU's global bound on is loose at large arguments. Appendix B gives the rerun scope and reconstruction limits. Tuned tolerances flag 29–30% of correct runs under S2/S3 and library tolerances up to 39%. Tiny magnitudes (S4) are benign for them because absolute tolerance dominates, but a fixed atol is then blind to relative errors of any size. On 216 changed-output runs of five additional shifted-input faults, numoracle detects 179 (all five faults) versus 49 for atol = rtol = 10⁻² (four faults); 11 of 144 correct inputs are inconclusive.
Table 4. False alarms on correct kernels under distribution shift (A100; Liger, Unsloth and vLLM pooled; 3,600 runs per family, 2,240 for library tolerances). Tuned: the per-library tolerance with at most 1% false alarms on every input group of Section 7.4, fixed before these runs. Parentheses: inconclusive correct calls in the affected-subset GPU reruns with the final implementation.
| Oracle | S1 heavy tail | S2 wide range | S3 large offset | S4 tiny magnitudes |
|---|---|---|---|---|
| numoracle | 0 | 0 (266) | 0 (270) | 0 |
| Tuned tolerance | 2.6% | 29.1% | 30.1% | 0.1% |
| Library tolerances | 20.1% | 25.6% | 39.4% | 0.2% |
| atol = rtol = 10⁻² | 8.8% | 22.2% | 22.2% | 1.4% |
| aiter formula | 16.8% | 19.8% | 13.2% | 17.2% |
| assert_close defaults | 34.9% | 31.5% | 36.3% | 17.6% |
7.3 RQ2: Fault Sensitivity
On the main inputs, numoracle killed 116 of 124 effective mutants: 50 of 53 in Liger (94%), 25 of 27 in Unsloth and 41 of 44 in vLLM (Table 5), against 59–83 for the fixed oracles. Leaving out any one of the 13 operators, it still kills at least 23 more than the best fixed oracle, and it kills at least as many as each fixed oracle in every mutation class except ε misplacement (M5). Restricted to the inputs that the libraries' own tests cover, it kills 106 against their 77. p-values are exploratory: mutants share kernels and come from a deterministic generator, not a sample of real faults.
Table 5. Mutants killed on the main inputs and exact McNemar p against numoracle (mutant level; exploratory).
| Oracle | Liger (of 53) | p | Unsloth (of 27) | p | vLLM (of 44) | p |
|---|---|---|---|---|---|---|
| numoracle | 50 | – | 25 | – | 41 | – |
| assert_close defaults | 40 | 0.013 | 19 | 0.07 | 0 | 9 × 10⁻¹³ |
| aiter formula | 30 | 2 × 10⁻⁶ | 21 | 0.12 | 32 | 0.022 |
| Library tolerances | 30 | 4 × 10⁻⁵ | 13 | 0.002 | 34 | 0.039 |
| atol = rtol = 10⁻² | 26 | 8 × 10⁻⁷ | 19 | 0.031 | 31 | 0.006 |
Truncating stores (M4) separate the oracles most clearly: numoracle kills all 11 Liger M4 mutants and the best fixed oracle kills 3. The bound check alone finds each; the rounding-interval check flags additional runs (Section 7.7). Appendix B gives exclusive kills and precision-specific run shares.
Missed mutants. The eight misses expose three limits: loose fp32 library allowances, mutations that do not reduce accuracy, and errors indistinguishable under our single-run checks. They include the three epsilon misplacements, an extra rounding of Liger's loss, an Unsloth RoPE change, and three vLLM changes. Appendix B gives per-case error and bound measurements; these are retained in the reported denominator.
Xinyi Shi
7.4 RQ3: Tolerance Tuning
We give fixed tolerances strong advantages. A hindsight-optimal tolerance picks, for each operator and dtype, the (atol, rtol) grid point that kills the most mutants among points with no false alarm on any correct main run. It is tuned on the test inputs and the mutants themselves, so no point of our grid kills more mutants without a false alarm on these runs. A diagonal tolerance sets atol = rtol to the smallest value with no false alarm on the correct main runs, using no mutant information. A fair tolerance sets atol = rtol on a separate tuning phase of 10 Gaussian seeds on the first shape, as a developer would before releasing a test. Each is evaluated against the PyTorch reference and against the float64 reference.
Table 6. Tuned tolerances on Liger (killed of 53 on the main inputs; false alarms on correct runs). Held-out: main runs whose input family is not Gaussian and whose shape is not the tuning shape. Degenerate rows: kills of the 22 mutants with an effect there. Hindsight and diagonal tolerances were tuned on all main runs, so their held-out column is in-sample.
| Tolerance | Reference | Killed | False alarms | Degen. | ||
|---|---|---|---|---|---|---|
| Main | Held-out | Degenerate rows | kills | |||
| hindsight-optimal | PyTorch | 52 | 0 (tuned) | 0 | 167 / 240 (70%) | 11 |
| hindsight-optimal | float64 | 51 | 0 (tuned) | 0 | 125 / 240 (52%) | 19 |
| diagonal | PyTorch | 47 | 0 (tuned) | 0 | 123 / 240 (51%) | 17 |
| diagonal | float64 | 44 | 0 (tuned) | 0 | 117 / 240 (49%) | 14 |
| fair | PyTorch | 53 | 335 / 1,680 (19.9%) | 202 / 819 (24.7%) | 210 / 240 (88%) | 17 |
| fair | float64 | 44 | 302 / 1,680 (18.0%) | 190 / 819 (23.2%) | 151 / 240 (63%) | 9 |
| numoracle | float64 | 50 | 0 / 1,680 | 0 / 819 | 0 / 240 | 22 |
Three findings stand out (Table 6). On the inputs it was tuned on, a hindsight tolerance matches numoracle: it kills 52 mutants against 50 (McNemar ), but it was chosen with access to every correct run and every mutant. Without hindsight, the trade-off returns: tolerances tuned on Gaussian inputs of one shape flag 18–20% of correct main runs and 23–25% of held-out runs. Under input shift, all six tuned baselines raise false alarms: on degenerate rows, tolerances that never false-alarmed on the main inputs flag 49–70% of correct runs and the fair ones 63–88%, while numoracle flags none and kills all 22 mutants with an effect there, against 9–19, including every instance of both misplacements.
A single atol = rtol per operator and dtype may be too weak a baseline, so we strengthened it. We tuned 400 configurations on the tuning phase only: one tolerance per operator or per output (loss, input and weight gradients separately), atol = rtol or the full frontier of a two-dimensional (atol, rtol) grid, against the PyTorch or the float64 reference, each widened by safety factors 1, 2, 4, 8 and 16. Figure 5 plots each configuration's false-alarm rate against its kills; the lines show, in hindsight and per panel, the best at each false-alarm rate.
No configuration reaches numoracle's corner. At most 1% false alarms on every Liger input group permits at most 31 of 53 main-mutant kills and, separately, 16 of 22 degenerate-row kills.
numoracle kills 50 and 22, respectively (McNemar on the main mutants). Allowing 10% false alarms raises the tuned counts to 42 and 20 (). Configurations that kill 50 main mutants flag at least 12% of correct main runs and at least 35% of degenerate-row runs. The same holds on the other libraries. For Unsloth, at most 1% false alarms everywhere allows at most 22 of 27 kills, against numoracle's 25 (); for vLLM, at most 1% on main and held-out inputs allows 36 of 44, against 41 (), reaching 41 costs 18% false alarms.
Percentile calibration. Setting tolerances to 1.5 times the 95th percentile of earlier correct-run errors [Sarkar 2026b] flags 32%, 31% and 41% of later correct Liger, Unsloth and vLLM runs against PyTorch, and 90–100% on degenerate rows. Appendix B reports the per-operator, float64-reference and evaluation-set calibration variants (23–54% false alarms across the tuning-phase variants).
7.5 RQ4: Historical Bugs
We reproduced seven historical bugs from Liger-Kernel and Unsloth [Liger-Kernel contributors 2026a; Unsloth contributors 2026] by running the source before and after each fix on the same inputs, 20 seeds per input family, against an independent float64 reference (Table 7). An input counts as a detection if the pre-fix version fails and the post-fix version passes. We compare with the projects' own regression tests and with tuned tolerances: fair ones calibrated on Gaussian seeds disjoint from the evaluation seeds, and hindsight ones chosen with the pre-fix outcomes in view. Input families on which a bug does not show are kept in the counts; the two negative control families of #10616, where the faulty path is not taken, are not (numoracle passes both versions on all 80 control runs; the fair PyTorch-referenced tolerance flags both in 20).
numoracle raised no false alarm on any post-fix version and detected six of the seven bugs. Hindsight float64 tolerances also raise no post-fix alarm: on the RTX PRO 6000 they detect one more input for #1433, match numoracle for #1498, #10616 and #10617, and detect fewer for #1329 and #92. The fair float64 tolerance also matches #1498 without an alarm. Hindsight choices use the pre-fix outcomes; they are not available to a developer before seeing those faults. Where a project's pre-fix test could be replayed, it missed every bug except #1329 on high-confidence logits. For #1433, numoracle detected 128 of 200 inputs where the fair PyTorch-referenced tolerance detected 1 and flagged the post-fix version 101 times. For #1329 it detected every high-confidence input in bf16 and fp16 and 9 of 20 Gaussian fp16 inputs; in fixed-input mode, which drops A1's zero-mean condition, the wider deterministic bound no longer detects the fp16 high-confidence cases (0 of 20).
On the A100 the whole study again gave no false alarm on any post-fix version and the same numoracle detections, except #1329 (54/80 in the original run) and #1433 (86/200 in the rerun). The latter depends strongly on precision, input family and (Appendix B). Its cuBLAS GEMMs use the alignment model at the t1.dot block, a hardware assumption; the A100's shorter block yields wider bounds. The #1498 tests also detect all four deterministic inputs placed at half-ulp boundaries.

Fig. 5. False alarms versus mutants killed for 400 tuned tolerance configurations (dots) and the best one at each false-alarm rate (lines), against numoracle (★). Liger panels: main inputs, held-out family and shape, degenerate rows; right: Unsloth main inputs. The x axis is linear up to 1% and logarithmic beyond.
Xinyi Shi
Table 7. Historical bugs in accuracy mode: paired detections (pre-fix fails and fixed passes on the same input), with false alarms on the post-fix version in parentheses (RTX PRO 6000). Rows #1433, #1498 and #10616 use the reruns described in Section 7.1. Project-test tolerances are replayed only for supported dtypes (bf16 here). Fair and hindsight tolerances: tuned as in RQ3.
| Bug | Fault | numoracle | Pre-fix project test | Fair, PyTorch ref. | Fair, float64 ref. | Hindsight, float64 ref. |
|---|---|---|---|---|---|---|
| Liger #1329 | cross-entropy: target-class gradient after an early low-precision store | 49/80 (0) | 20/40 (0) | 46/80 (3) | 39/80 (1) | 40/80 (0) |
| Liger #1433 | fused linear + JSD: projection kept in the input precision | 128/200 (0) | 0/120 (40) | 1/200 (101) | 65/200 (82) | 129/200 (0) |
| Liger #1498 | LayerNorm: mean and rstd saved in the input precision | 40/40 (0) | 0/20 (0) | 35/40 (5) | 40/40 (0) | 40/40 (0) |
| Liger #92 | RMSNorm: fp32 casts at the reference's positions | 149/160 (0) | 0/80 (0) | 152/160 (8) | 91/160 (16) | 110/160 (0) |
| Liger #986 | GEGLU: intermediate not cast as Hugging Face does | 0/80 (0) | - | 74/80 (6) | 0/80 (19) | 0/80 (0) |
| Unsloth #10616 | cross-entropy with softcap: padding mask not restored | 120/120 (0) | - | 83/120 (37) | 118/120 (2) | 120/120 (0) |
| Unsloth #10617 | RMSNorm backward with strided gradients | 440/560 (0) | - | 410/560 (34) | 424/560 (21) | 440/560 (0) |
Every post-fix call in these reruns passes (444 per GPU: 200 for #1433, 44 for #1498, and 200 for #10616, including its 80 negative controls); the controls also pass before the fix.
The miss, #986, adds a Hugging Face intermediate cast rather than repairing a demonstrated accuracy violation. Both versions pass our accuracy check. Uncertainty at the cast makes the current parity enclosure admit the difference (Section 4.6); PyTorch-referenced tolerances flag disagreement with that particular reference.
vLLM. Before PR #21783, numoracle detected the offset bug in all 120 runs, against 75 for atol = rtol = 10⁻² and 75 of 80 for the pre-fix test's own tolerance, which has no bf16 case. The post-fix kernel still mis-decays the initial state when a sequence starts inside one chunk and continues into the next, which upstream repaired later (PR #23279); on such layouts numoracle flagged the post-fix kernel in 83 of 90 runs and the corrected one in none; atol = rtol = 10⁻² detected 51 paired cases and falsely flagged 35 corrected runs.
7.6 RQ5: Cost
Writing references. Excluding comments and blank lines, references take 2–12 lines each (generic) or 10–29 (Liger, including each kernel's precision plan). Mamba2's scan takes 14 lines, or 145 with helpers for tiled dot products, TF32 conversion and state passing.
Running the checks. On the RTX PRO 6000, Liger forward-and-backward calls take 87–168 µs; checking all outputs takes 4.9–13.8 ms (median 83 times the kernel, range 29–127). Shadow-reference construction has median 11 ms; paired reference-plus-check time, 21 ms across 21 configuration medians. The A100 is about three times slower (kernels 252–478 µs, checks 13.8–39.1 ms), with similar ratios (median 80, range 29–116). Excluding report generation, campaigns with all oracles took about 6.5–17 minutes per library on the RTX PRO 6000 and 24–43 on the A100.
7.7 RQ6: Ablation
RTX PRO 6000 ablations separately disable each refinement in Liger, Unsloth and vLLM, reusing kernel outputs and rebuilding shadow references. The 200-trial CPU emulation reruns (Section 5.2) cover deeper references—GEMM, scaled FP8, MXFP4 and NVFP4 GEMMs, attention and cross-entropy—where intermediate errors weigh more (Table 8). Deliberately unsound controls treat broadcast copies as independent by ignoring keys, or assume independence for components sharing events.
Table 8. Ablation. GPU: paired detections among changed-output runs; Liger/vLLM reruns; original Unsloth campaign; Liger kills out of 53 (Unsloth 25 and vLLM 41 for all sound settings). Correct kernels raise no false alarms; variants checked under full and unsound-independence settings also raise none. CPU: final-implementation median over elements, then 200 seeds with two correct emulations each, with settings active during measurement. Quantized GEMMs use accuracy mode; other references are within 1%.
| Configuration | Sound | GPU (RTX PRO 6000) | CPU: | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Liger | Liger kills | Unsloth | vLLM | FP8 | MXFP4 | NVFP4 | CE | ||
| full numeracle | yes | 93.4% | 50 | 91.6% | 79.7% | 1 | 1 | 1 | 1 |
| bound check only | yes | 88.4% | 50 | 89.7% | 77.7% | 1 | 1 | 1 | 1 |
| fixed-input mode | yes | 89.7% | 50 | 87.0% | 79.6% | 2.8 | 2.2 | 2.2 | 4.4 |
| no quadrature across origins | yes | 93.4% | 50 | 91.4% | 79.7% | 1.50 | 1.43 | 1.45 | 1.52 |
| no ordered products | yes | 93.4% | 50 | 91.6% | 79.7% | 1.04 | 1.13 | 1.11 | 1.00 |
| independence despite shared origins | no | 93.4% | 50 | 91.6% | 79.7% | 1.00 | 1.00 | 1.00 | 1.00 |
| keys ignored | no | - | 1.00 | 1.00 | 1.00 | 1.00 | |||
Final-store half-ulps dominate our Triton bounds: correct-run worst elements use median bound fractions of 94% (Liger/Unsloth) and 78% (vLLM). Random-error refinements change few verdicts: removing quadrature loses 16 of 6,177 changed-output Unsloth runs and one vLLM run. Two GPU components matter. Removing the rounding-interval check loses 5.0, 1.9 and 1.9 percentage points of mutant-run detections on Liger, Unsloth and vLLM, and about 16% of truncating-store detections on Liger (1,670 versus 1,997) and Unsloth (401 versus 480). Dropping zero mean (fixed-input mode) loses 3.7 and 4.6 points on Liger and Unsloth and one Liger degenerate-row kill. Deeper computations benefit more: quantized-GEMM and cross-entropy bounds widen 2.2–2.8 and 4.4 times without zero mean, or 1.43–1.50 and 1.52 times without quadrature across disjoint origins, respectively. Removing ordered products widens FP4 GEMM bounds 11–13%.
Keys are necessary for soundness: ignoring them leaves tabulated median ratios at 1.00, but the correct broadcast-then-reduce output (Section 4.4) exceeds its bound 5.6 times; full numeracle uses 47%. Independence despite shared origins caused no false alarm: these references rarely sum such components; would.
Choice of . Changing to flags only 5, 11 and 5 additional Liger, Unsloth and vLLM runs with unchanged kills, since grows with . At , all main correct-input cases remain supported except 120 of 480 vLLM cases exceeding the intermediate budget (detection changes: Appendix B). At , all 3,600 are unsupported. Increasing restores budget admissibility but widens intermediate bounds.
7.8 Threats to Validity
Seeded faults may not represent real faults [Just et al. 2014]; nine historical cases supplement them. Reference errors: a development plan modeled a bf16 product as fp32; audit correction removed its false alarms. Generality: three libraries, two GPU generations, one compiler version; new platforms
Xinyi Shi
require calibration, which tests but cannot prove A2. Statistics: shared seeds and kernels limit independence; Unsloth/vLLM mutant-level samples are small. A1: zero false alarms do not prove the model. Affected-subset GPU reruns gave 634 inconclusive outcomes per GPU (3.7% of the original shifted-call schedule). Fixed-input mode drops zero mean at a sensitivity cost. Tuned baselines cover granularities, grids, safety factors and percentiles, not every rule: row-statistic-dependent tolerances are another error model.
8 Discussion
Detection scope. Per-element checks miss outputs inside acceptance regions (Section 5.3). Fault-exposing inputs and finer observations help: near-degenerate rows expose all three misplacements; per-row cross-entropy exposes two faults hidden by averaging. Under the numerical assumptions, input-adaptive bounds avoid tuned tolerances' observed false alarms here.
Accuracy versus parity. The specification selects the mode. Parity preserves semantic casts with uncertain inputs (Liger #986); bit-exact replay additionally fixes operation order and rounding.
Writing references. Overly strict precision plans risk false alarms; permissive plans risk missed faults. Witnesses help investigate mismatches (Section 7.8); checking plans against kernel IR is future work.
Kernels written by language models. KernelBench tests generated kernels on five random inputs [Ouyang et al. 2025] with in fp16/bf16 [KernelBench contributors 2026]. Given a precision plan, numoracle offers a signal with a model-conditional false-alarm rate.
9 Related Work
Test oracles and approximate assertions. Poor numerical bounds [Barr et al. 2015] cause flaky tests [Dutta et al. 2020]. FLEX uses extreme-value theory [Dutta et al. 2021]; operator-aware calibration uses error percentiles and safety factors [Sarkar 2026b]. Both learn from correct executions and may fail to transfer (RQ3); numoracle derives bounds from computation and profiles.
Checking GPU kernels. Volta proves real-valued equivalence, abstracting floating-point conversions [Driscoll et al. 2026]. V-ABFT [Gao et al. 2026] extends A-ABFT's probabilistic matrix-checksum thresholds [Braun et al. 2014] to mixed precision using variance estimates. These hardware-fault checks bound single-operation checksums; numoracle analyzes fused-kernel numerical error. KernelBench mutations expose tolerated precision faults and cancellation-induced false alarms [Du et al. 2026]. Shape/dtype fuzzing [Sarkar 2026a] and formal verification [Martinez and Sorensen 2026] complement this. Cross-vendor tests expose numerical compiler differences, including math calls [Zahid et al. 2024]; we sample selected profiles in calibration.
Testing libraries. Backend differential testing [Pham et al. 2019], API fuzzing [Deng et al. 2023; Wei et al. 2022], compiler test generation [Liu et al. 2023] and numerical input search [Yan et al. 2021; Zhang et al. 2021] mostly use fixed-tolerance oracles that numoracle could replace. Other studies characterize numerical bugs and instability [Di Franco et al. 2017; Kloberdanz et al. 2022].
Roundoff analysis. Static analyses bound worst-case scalar roundoff [Darulova et al. 2018; Solovyev et al. 2018], also at scale [Das et al. 2020]. Higher-precision shadows localize accuracy problems [Benz et al. 2012; Sanchez-Stern et al. 2018]; GPU instrumentation detects exceptions [Laguna 2019; Li et al. 2023]. Stochastic arithmetic perturbs rounding to estimate significant digits [Denis et al. 2016; Jézéquel and Chesneaux 2008]. Probabilistic analyses give normwise and componentwise high-probability linear-algebra bounds [Connolly et al. 2021; Higham and Mary 2019, 2020; Ipsen and Zhou 2020] or analyze random-input programs [Constantinides et al. 2021; Lohar et al. 2019].
Componentwise analysis guides inference accumulation precision [El Arar et al. 2025]; CESTAC-inspired analysis estimates operator stability [Chen 2026]. numoracle leaves reduction order open in derived tensor-program test oracles.
ProbTaylor applies concentration inequalities to scalar programs with independent input distributions [Tao et al. 2026]; its probability is over inputs, whereas ours fixes inputs and models rounding. Kernel Contracts specifies precision, ordering and exceptional-value obligations [Veit 2026]; Shah and Shrestha [2026] build a contract-grade verifier with adversarial gates and reduction-scale thresholds. These motivate derived tolerances; numoracle composes per-element regions, shared errors and a call-level probability budget, complementing determinism, exception and shape checks.
Low-precision arithmetic and hardware. Low-precision formats [Alvarez et al. 2025; Micikevicius et al. 2022; Rouhani et al. 2023] support LLMs; tensor cores may truncate [Fasi et al. 2021]; some FP8 GEMMs need periodic partial-sum promotion [DeepSeek-AI 2024]. The aiter RFC derives tolerances from formats and reduction lengths [AMD ROCm 2026]; numoracle derives per-element bounds and calibrates its assumptions.
10 Conclusion
numoracle derives input-specific acceptance regions from reference programs and precision plans. Its calculus tracks shared rounding errors, uses provenance to justify tighter product bounds and models low-precision quantizers and hardware. The bound and rounding-interval checks turn these compositional rules into a model-conditional false-alarm guarantee for an entire kernel call, while leaving permitted reduction orders open.
Main campaigns on two GPU generations raised no false alarm. On the RTX PRO 6000, numoracle killed 116/124 effective mutants, versus 59–83 for fixed baselines; historical replays exposed eight accuracy faults, with a ninth case concerning rounding parity. Tuned-tolerance comparisons support input-specific bounds when input families and row statistics change.
The final-version affected-subset reruns returned 634 inconclusive outcomes per GPU. These identify where conservative envelopes prevent certification. Tighter local nonlinear bounds and automated checks of precision plans could extend coverage; fault-exposing inputs and finer output observations remain complementary ways to improve detection.
Data-Availability Statement
An artifact provides source, references, mutants, notebooks and per-run records with campaign source hashes. Scripts reproduce aggregates; GPU reruns require calibration. Appendix B states data exclusions.
References
Eduardo Alvarez, Omri Almog, Eric Chung, Simon Layton, Dusan Stosic, Ronny Krashinsky, and Kyle Aubrey. 2025. Introducing NVFP4 for Efficient and Accurate Low-Precision Inference. NVIDIA Technical Blog, https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/. June 24, 2025.
AMD ROCm. 2026. [RFC]: Replace the hardcoded atol=100 in the MoE op_tests with a derived tolerance. GitHub issue #5031, https://github.com/ROCm/aiter/issues/5031. Accessed 2026-10-06.
Earl T. Barr, Mark Harman, Phil McMinn, Muzammil Shahbaz, and Shin Yoo. 2015. The Oracle Problem in Software Testing: A Survey. IEEE Transactions on Software Engineering 41, 5 (2015), 507–525. doi:10.1109/TSE.2014.2372785
Florian Benz, Andreas Hildebrandt, and Sebastian Hack. 2012. A Dynamic Program Analysis to Find Floating-Point Accuracy Problems. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). ACM, 453–462. doi:10.1145/2254064.2254118
Claus Braun, Sebastian Halder, and Hans-Joachim Wunderlich. 2014. A-ABFT: Autonomous Algorithm-Based Fault Tolerance for Matrix Multiplications on Graphics Processing Units. In Proceedings of the 44th Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN). 443–454. doi:10.1109/DSN.2014.48
Xinyi Shi
Xinye Chen. 2026. Automated Numerical Stability Analysis of Deep Learning Operators. arXiv:2607.25494.
Michael P. Connolly, Nicholas J. Higham, and Theo Mary. 2021. Stochastic Rounding and Its Probabilistic Backward Error Analysis. SIAM Journal on Scientific Computing 43, 1 (2021), A566–A585. doi:10.1137/20M1334796
George Constantinides, Fredrik Dahlqvist, Zvonimir Rakamarić, and Rocco Salvia. 2021. Rigorous Roundoff Error Analysis of Probabilistic Floating-Point Computations. In Computer Aided Verification – 33rd International Conference, CAV 2021, Proceedings, Part II (Lecture Notes in Computer Science, Vol. 12760). Springer, 626–650. doi:10.1007/978-3-030-81688-9_29
Eva Darulova, Anastasiia Izycheva, Fariba Nasir, Fabian Ritter, Heiko Becker, and Robert Bastian. 2018. Daisy – Framework for Analysis and Optimization of Numerical Programs (Tool Paper). In Tools and Algorithms for the Construction and Analysis of Systems (TACAS) (Lecture Notes in Computer Science, Vol. 10805). Springer, 270–287. doi:10.1007/978-3-319-89960-2_15
Arnab Das, Ian Briggs, Ganesh Gopalakrishnan, Sriram Krishnamoorthy, and Pavel Panchekha. 2020. Scalable yet Rigorous Floating-Point Error Analysis. In SC20: International Conference for High Performance Computing, Networking, Storage and Analysis. 1–14. doi:10.1109/SC41405.2020.00055
DeepSeek-AI. 2024. DeepSeek-V3 Technical Report. arXiv:2412.19437.
Yinlin Deng, Chunqiu Steven Xia, Haoran Peng, Chenyuan Yang, and Lingming Zhang. 2023. Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models. In Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA). 423–435. doi:10.1145/3597926.3598067
Christophe Denis, Pablo de Oliveira Castro, and Eric Petit. 2016. Verificarlo: Checking Floating Point Accuracy through Monte Carlo Arithmetic. In 23rd IEEE Symposium on Computer Arithmetic (ARITH). 55–62. doi:10.1109/ARITH.2016.31
Anthony Di Franco, Hui Guo, and Cindy Rubio-González. 2017. A Comprehensive Study of Real-World Numerical Bug Characteristics. In Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE). 509–519. doi:10.1109/ASE.2017.8115662
Benjamin Driscoll, Kshitij Dubey, Anjiang Wei, Neeraj Kayal, Rahul Sharma, and Alex Aiken. 2026. Equivalence Checking of ML GPU Kernels. Proceedings of the ACM on Programming Languages 10, OOPSLA2 (2026), 652–680. doi:10.1145/3839470
Mingzhe Du, Anh Tuan Luu, Dong Huang, and See-Kiong Ng. 2026. Measuring the Checker: Mutation Analysis for GPU-Kernel Benchmark Oracles. arXiv:2609.22220.
Saikat Dutta, August Shi, Rutvik Choudhary, Zhekun Zhang, Aryaman Jain, and Sasa Misailovic. 2020. Detecting Flaky Tests in Probabilistic and Machine Learning Applications. In Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA). 211–224. doi:10.1145/3395363.3397366
Saikat Dutta, August Shi, and Sasa Misailovic. 2021. FLEX: Fixing Flaky Tests in Machine Learning Projects by Updating Assertion Bounds. In Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE). 603–614. doi:10.1145/3468264.3468615
El-Mehdi El Arar, Silviu-Ioan Filip, Theo Mary, and Elisa Riccietti. 2025. Mixed Precision Accumulation for Neural Network Inference Guided by Componentwise Forward Error Analysis. arXiv:2503.15568.
Massimiliano Fasi, Nicholas J. Higham, Mantas Mikaitis, and Srikara Pranesh. 2021. Numerical Behavior of NVIDIA Tensor Cores. PeerJ Computer Science 7 (2021), e330. doi:10.7717/peerj-cs.330
Yiheng Gao, Qin Hua, and Zizhong Chen. 2026. V-ABFT: Variance-Based Adaptive Threshold for Fault-Tolerant Matrix Multiplication in Mixed-Precision Deep Learning. arXiv:2602.08043.
Nicholas J. Higham. 2002. Accuracy and Stability of Numerical Algorithms (2nd ed.). Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA, USA. doi:10.1137/1.9780898718027
Nicholas J. Higham and Theo Mary. 2019. A New Approach to Probabilistic Rounding Error Analysis. SIAM Journal on Scientific Computing 41, 5 (2019), A2815–A2835. doi:10.1137/18M1226312
Nicholas J. Higham and Theo Mary. 2020. Sharper Probabilistic Backward Error Analysis for Basic Linear Algebra Kernels with Random Data. SIAM Journal on Scientific Computing 42, 5 (2020), A3427–A3446. doi:10.1137/20M1314355
Pin-Lun Hsu, Yun Dai, Vignesh Kothapalli, Qingquan Song, Shao Tang, Siyu Zhu, Steven Shimizu, Shivam Sahni, Haowen Ning, and Yanning Chen. 2024. Liger Kernel: Efficient Triton Kernels for LLM Training. arXiv:2410.10989.
Ilse C. F. Ipsen and Hua Zhou. 2020. Probabilistic Error Analysis for Inner Products. SIAM J. Matrix Anal. Appl. 41, 4 (2020), 1726–1741. doi:10.1137/19M1270434
Fabienne Jézéquel and Jean-Marie Chesneaux. 2008. CADNA: A Library for Estimating Round-off Error Propagation. Computer Physics Communications 178, 12 (2008), 933–955. doi:10.1016/j.cpc.2008.02.003
René Just, Dariusoh Jalali, Laura Inozemtseva, Michael D. Ernst, Reid Holmes, and Gordon Fraser. 2014. Are Mutants a Valid Substitute for Real Faults in Software Testing?. In Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE). 654–665. doi:10.1145/2635868.2635929
KernelBench contributors. 2026. KernelBench evaluation code, src/kernelbench/eval.py. https://github.com/ScalingIntelligence/KernelBench/blob/423217d9fda91e0c2d67e44a3fb62f96fd01d4f/src/kernelbench/eval.py. Commit 423217d (2026-03-05), get_tolerance_for_precision; accessed 2026-10-06.
Eliska Kloberdanz, Kyle G. Kloberdanz, and Wei Le. 2022. DeepStability: A Study of Unstable Numerical Methods and Their Solutions in Deep Learning. In Proceedings of the 44th International Conference on Software Engineering (ICSE). 586–597.
doi:10.1145/3510003.3510095
Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph Gonzalez, Hao Zhang, and Ion Stoica. 2023. Efficient Memory Management for Large Language Model Serving with PagedAttention. In Proceedings of the 29th Symposium on Operating Systems Principles (SOSP). 611–626. doi:10.1145/3600006.3613165
Ignacio Laguna. 2019. FPChecker: Detecting Floating-Point Exceptions in GPU Applications. In Proceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering (ASE), Tool Demonstrations. 1126–1129. doi:10.1109/ASE.2019.00118
Xinyi Li, Ignacio Laguna, Bo Fang, Katarzyna Swirydowicz, Ang Li, and Ganesh Gopalakrishnan. 2023. Design and Evaluation of GPU-FPX: A Low-Overhead Tool for Floating-Point Exception Detection in NVIDIA GPUs. In Proceedings of the 32nd International Symposium on High-Performance Parallel and Distributed Computing (HPDC). 59–71. doi:10.1145/3588195.3592991
Liger-Kernel contributors. 2026a. Liger-Kernel pull requests #92, #986, #1329, #1433 and #1498. GitHub pull requests #92, #986, #1329, #1433, and #1498. Merged 2024-08-28, 2025-12-23, 2026-08-03, 2026-09-28 and 2026-09-27. Accessed 2026-10-06.
Liger-Kernel contributors. 2026b. test/transformers/test_swiglu.py at commit 91e51df. https://github.com/linkedin/Liger-Kernel/blob/91e51dfd9c29c84175688c90776026c7df4493cf/test/transformers/test_swiglu.py. Accessed 2026-10-06.
Jiawei Liu, Jinkun Lin, Fabian Ruffy, Cheng Tan, Jinyang Li, Aurojit Panda, and Lingming Zhang. 2023. NNSmith: Generating Diverse and Valid Test Cases for Deep Learning Compilers. In Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2 (ASPLOS). 530–543. doi:10.1145/3575693.3575707
Debasmita Lohar, Milos Prokop, and Eva Darulova. 2019. Sound Probabilistic Numerical Error Analysis. In Integrated Formal Methods (iFM) (Lecture Notes in Computer Science, Vol. 11918). Springer, 322–340. doi:10.1007/978-3-030-34968-4_18
Guido Martinez and Tyler Sorensen. 2026. The Next Frontier for AI-Generated Kernels: Correctness. In Proceedings of the 2026 ACM SIGPLAN International Workshop on Principles of Agentic Engineering (PAgE). doi:10.1145/3819802.3820580
Paulius Micikevicius, Dusan Stosic, Patrick Judd, John Kamalu, Stuart Oberman, Mohammad Shoeybi, Michael Siu, Hao Wu, Neil Burgess, Sangwon Ha, Richard Grisenthwaite, Naveen Mellempudi, Marius Cornea, Alexander Heinecke, and Pradeep Dubey. 2022. FP8 Formats for Deep Learning. arXiv:2209.05433.
NVIDIA. 2026. Parallel Thread Execution ISA Version 9.4. https://docs.nvidia.com/cuda/parallel-thread-execution/. Sections 9.7.3.8 (div) and 9.7.3.21 (ex2). Accessed 2026-10-06.
Anne Ouyang, Simon Guo, Simran Arora, Alex L. Zhang, William Hu, Christopher Ré, and Azalia Mirhoseini. 2025. KernelBench: Can LLMs Write Efficient GPU Kernels?. In Proceedings of the 42nd International Conference on Machine Learning (ICML) (PMLR, Vol. 267). 47356–47415.
Hung Viet Pham, Thibaud Lutellier, Weizhen Qi, and Lin Tan. 2019. CRADLE: Cross-Backend Validation to Detect and Localize Bugs in Deep Learning Libraries. In Proceedings of the 41st International Conference on Software Engineering (ICSE). 1027–1038. doi:10.1109/ICSE.2019.00107
PyTorch. 2026. torch. testing. assert_close. https://docs.pytorch.org/docs/stable/testing.html. Accessed 2026-10-06.
Bita Darvish Rouhani, Ritchie Zhao, Ankit More, Mathew Hall, Alireza Khodamoradi, Summer Deng, Dhruv Choudhary, Marius Cornea, Eric Dellinger, Kristof Denolf, Dusan Stosic, Venmugil Elango, Maximilian Golub, Alexander Heinecke, Phil James-Roxby, Dharmesh Jani, Gaurav Kolhe, Martin Langhammer, Ada Li, Levi Melnick, Maral Mesmakhosroshahi, Andres Rodriguez, Michael Schulte, Rasoul Shafipour, Lei Shao, Michael Siu, Pradeep Dubey, Paulius Micikevicius, Maxim Naumov, Colin Verrilli, Ralph Wittig, Doug Burger, and Eric Chung. 2023. Microscaling Data Formats for Deep Learning. arXiv:2310.10537.
Alex Sanchez-Stern, Pavel Panchekha, Sorin Lerner, and Zachary Tatlock. 2018. Finding Root Causes of Floating Point Error. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). ACM, 256–269. doi:10.1145/3192363.3192411
Dipankar Sarkar. 2026a. The Correctness Illusion in LLM-Generated GPU Kernels. arXiv:2606.20128.
Dipankar Sarkar. 2026b. Operator-Aware Mixed-Precision Tolerance Calibration for Tensor Kernels. arXiv:2607.16228.
Rishi Shah and Rishav Shrestha. 2026. A Contract-Grade Verifier for LLM-Generated GPU Kernels, and a Native Blackwell Backward for the Gated-Linear-Recurrence Family. arXiv:2608.12700.
Alexey Solovyev, Marek Baranowski, Ian Briggs, Charles Jacobsen, Zvonimir Rakamarić, and Ganesh Gopalakrishnan. 2018. Rigorous Estimation of Floating-Point Round-Off Errors with Symbolic Taylor Expansions. ACM Transactions on Programming Languages and Systems 41, 1 (2018), 2:1–2:39. doi:10.1145/3230733
Yichen Tao, Hongfei Fu, Jiawei Chen, and Jean-Baptiste Jeannin. 2026. Probabilistic Floating-Point Round-Off Analysis via Concentration Inequalities. Proceedings of the ACM on Programming Languages 10, OOPSLA2 (2026), 6–33. doi:10.1145/3839447
Philippe Tillet, H. T. Kung, and David Cox. 2019. Triton: An Intermediate Language and Compiler for Tiled Neural Network Computations. In Proceedings of the 3rd ACM SIGPLAN International Workshop on Machine Learning and Programming
Xinyi Shi
Languages (MAPL). doi:10.1145/3315508.3329973
Triton contributors. 2026. ElementwiseOpToLLVM.cpp (NVIDIA backend), Triton v3.6.0. https://github.com/triton-lang/triton/blob/v3.6.0/third_party/nvidia/lib/TritonNVIDIAGPUToLLVM/ElementwiseOpToLLVM.cpp. Tag v3.6.0, commit 7c56a5e.
Unsloth contributors. 2026. Unsloth pull requests #10616 and #10617. GitHub pull requests #10616 and #10617. Both merged 2026-09-10. Accessed 2026-10-06.
Cooper Veit. 2026. Kernel Contracts: A Specification Language for ML Kernel Correctness Across Heterogeneous Silicon. arXiv:2604.22032.
vLLM contributors. 2025a. [Bugfix] Fix mamba2 prefill chunking. Pull request #23279, https://github.com/vllm-project/vllm/pull/23279. Merged 2025-09-08, commit e041314.
vLLM contributors. 2025b. [Bugfix] Mamba2 SSD varlen bug fix initstates decay, improve test, assert chunk pwr 2. Pull request #21783, https://github.com/vllm-project/vllm/pull/21783. Merged 2025-08-12, commit 46ae7f6.
Anjiang Wei, Yinlin Deng, Chenyuan Yang, and Lingming Zhang. 2022. Free Lunch for Testing: Fuzzing Deep-Learning Libraries from Open Source. In Proceedings of the 44th International Conference on Software Engineering (ICSE). 995–1007. doi:10.1145/3510003.3510041
Ming Yan, Junjie Chen, Xiangyu Zhang, Lin Tan, Gan Wang, and Zan Wang. 2021. Exposing Numerical Bugs in Deep Learning via Gradient Back-Propagation. In Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE). 627–638. doi:10.1145/3468264.3468612
Anwar Hossain Zahid, Ignacio Laguna, and Wei Le. 2024. Testing GPU Numerics: Finding Numerical Differences Between NVIDIA and AMD GPUs. In SC24-W: Workshops of the International Conference for High Performance Computing, Networking, Storage and Analysis. 547–557. doi:10.1109/SCW63240.2024.00077
Xufan Zhang, Ning Sun, Chunrong Fang, Jiawei Liu, Jia Liu, Dong Chai, Jiang Wang, and Zhenyu Chen. 2021. Predoo: Precision Testing of Deep Learning Operators. In Proceedings of the 30th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA). 400–412. doi:10.1145/3460319.3464843
A Proofs
Setting. We work in the model of A1. Three kinds of operation are distinguished. An ordinary rounding of one element (an arithmetic rounding, one addition inside an accumulation, the division or grid step of a quantizer) is a rounding event : it adds to the value it rounds, with at most half the spacing of its format at and , where is the -algebra generated by the errors of all earlier events. Events are totally ordered by the program order of and, within one operation, by a fixed order consistent with its data dependencies; for an accumulation, any topological order of the implementation's summation tree. Deterministic roundings (semantic casts and the computation of quantizer scales) are of the model's values. Terminal stores, the final rounding of each output of the call, are of the model's pre-store value ; the stored value is what both checks observe, and it is not reused inside the call. A rounding that an implementation skips, such as a product contracted into a fused multiply-add, is an event with . A real round-to-nearest execution is the sample path : the theorem is a statement about the model, and fixed-input mode makes the statement for every path. Half a spacing at is at most in the normal range and below it, so each event has the constant bound for an arithmetic rounding whenever , for an addition inside an accumulation, and the bounds of the quantizer case for its steps. The shadow quantities and are functions of the input alone, never of the errors. This also assumes that masks and indices of selection operations depend only on the inputs; that products inside contractions are exact or fused, as for fp16, bf16, FP8 and TF32 operands; that a quantizer divides with a correctly rounded fp32 division (a kernel that multiplies by a reciprocal needs a different plan); and, for the triton_fast profile, that operands of , rsqrt, log and division are normal, since calibration samples only normal inputs. A4 can fail where float64 evaluation cancels near the boundary of A3's domain, as in for a divisor, or where a format spacing jumps at a binade edge in semantic casts, quantizer grids and scales; the 100-digit re-evaluation did not sample these cases.
Checkpoints. Propagation checkpoints are the scalar analysis stages to which we assign a separate martingale tail bound: internal ordinary-rounding results and materialized arithmetic, reduction, contraction, elementary-function and quantization results. A terminal store's post-rounding value is not a propagation checkpoint; its pre-store value is covered by propagation, and the stored output is handled only by Theorem A.1. Deterministic semantic casts and value-copying shape or selection operations need no additional tail event, although their summaries can be tighter than their operand's. Such an element is exact or a copy of one element of an earlier checkpoint: its error is 's error plus deterministic cast residuals, which the rules add to , and its equals 's. Its components are 's, relabeled and possibly merged; where and cat may also enlarge origin sets or add components that are zero at this element. Those additions only coarsen the overlap groups and cannot lower , but merging two components with disjoint origins inside one group can: unit proxies with origins , and give , and once the first two merge. A merge only regroups the coefficients of the same martingale sum , so the of every copy is also a valid proxy root for (the merge rules applied to its groups, as for the outputs below). We therefore give each checkpoint element the envelope , where is the smallest among and its copies; is a function of alone. If , then every copy of satisfies . The local accumulation and quantization arguments below bound their internal partial sums, scale computations, quotient and grid inputs from the operand checkpoints, without separate tail events for those internal values.
Let be an upper bound on the number of propagation checkpoints, rather than the number of rounding events. The implementation's m_int is such a conservative count: ordinary rounding adds the number of result elements; elementwise arithmetic and elementary functions add that number before any separate rounding; quantization adds the number of reconstructed elements before output rounding; and cumulative sums add the number of prefix outputs. A reduction of length adds times the number of output elements when it models accumulation, and otherwise adds the number of outputs; a contraction of length adds times the number of outputs. These latter counts also charge internal stages for which the local magnitude proof needs no separate tail event. Shape operations, selections and semantic casts retain or sum their operand counts; the maximum rule may charge additional elements although its deterministic enclosure needs no new tail. Counts are summed across operands and across observed outputs, so reused ancestors can be counted repeatedly. Counts charged for terminal stores may also be retained in , even though these stores are excluded from the propagation checkpoints. Both kinds of overcount only weaken the budget condition.
Let be the event that every propagation checkpoint is within its envelope ; on , every checkpoint and every copy is within its . For an ordinary event , let be the event that the propagation checkpoints completed before obey their envelopes; the local operation rules then imply the operand and internal-value envelopes used to bound event , including those of operands that are copies. For a nonterminal element , let be the analogous event before , without constraining itself. Then , , and for every event affecting .
Truncation. Each event has an increment , except where a case below splits off a part whose indicator is -measurable (the subnormal part of an accumulation step). On the case bounds give . Define . All indicators are -measurable, so , everywhere, and on .
Invariant. For every nonterminal shadow element , on the implementation's error at equals , with the properties below. Post-terminal summaries are only numerical envelopes
Xinyi Shi
for the output checks; they do not assert a centered-sum representation of the deterministic store residual.
(1) (d may be random; only its magnitude is bounded);
(2) , defined on the whole probability space, with signed coefficients that are -measurable and bounded by constants, ;
(3) and ;
(4) for each event , project the positions where its coefficient can be nonzero onto the coordinates outside . At most distinct tuples occur. This deterministic support envelope is the component's global incidence cap. In particular, a line of length along contains at most occurrences of .
Preservation. We proceed by induction over the operations of . Each case uses only the bounds of its operands, which hold on , where is the element being built (the prefix event).
• Rounding. The new component has one event per element with coefficient 1, so and W = q. Events of distinct elements are distinct, so its global incidence cap is 1.
-
Scaling and broadcast. Coefficients scale by a and their bounds by ; this cannot enlarge support. A broadcast element's events now appear at every position along d, which is exactly what adding d to the key records. Projecting away this shared axis leaves the old support, preserving its cap.
-
Merging in one element (Theorem 5.3). If two components use disjoint event sets, the merged coefficient vector is their concatenation, so the proxies add. Otherwise the merged coefficient of each event is at most the sum of both, and Minkowski's inequality in gives
- Incidence under coordinate operations. Permuting axes remaps the key; a fixed roll or flip acts on one coordinate independently of the others. In both cases the projected support is merely relabeled. Basic slicing restricts support, relabels retained coordinates and projects away integer-indexed coordinates, so it cannot increase its cardinality. Singleton insertion is likewise harmless. These operations preserve .
For a reshape, each matched group of old and new axes has the same product of dimensions. If any old axis in the group is shared, all new axes of that group are marked shared; the group's coordinates disappear from the projected support. Otherwise the old and new group tuples are related bijectively. Thus each old unshared tuple determines at most one new unshared tuple, preserving . Repeating an unshared axis k times produces at most k projected tuples per old tuple, so its cap is multiplied by k. Repeating a shared axis preserves the cap.
Each component also carries a conservative token for its complete coordinate placement. Equal tokens certify a common support envelope for every shared event, independently of coefficient magnitudes and masks. Every coordinate-changing operation updates the token, including integer indexing on an axis other than the one later reduced. Ambiguous combinations receive fresh tokens. With disjoint event sets, a union has cap because any event comes from only one operand. For shared events at different placements, the union has cap at most . Equal certified placements permit the maximum instead: masks and zero coefficients only restrict the common envelope. These rules cover component merges, elementwise operations and where, including merges caused by two remapped keys becoming equal. Concatenation puts its operands in different coordinate ranges. If any origins overlap, it therefore uses the sum of all operand caps even when incoming tokens agree; otherwise it uses their maximum. This remains conservative when the concatenation axis is shared.
A general gather may choose a different index map at each setting of the other coordinates. If its axis is unshared and has output length , each old projected tuple can produce at most new gather coordinates, while all other unshared coordinates remain unchanged. Multiplying by is therefore safe. The implementation needs this factor only for a nonidentity gather when some input axis is shared and remains unshared. With no shared axes and distinct indices within every line, gather is injective on positions and preserves the cap. If any line repeats an index, is added to the key; if was already shared, it stays shared. In either case projection removes the only coordinate that could multiply, preserving the cap. An identity gather also preserves it. A structured index_select uses one index vector everywhere: distinct indices relabel or restrict projected support, and repeated indices are covered by adding to the key.
More generally, adding axes to a key can only reduce projected support. The implementation may also replace a cap by its minimum with , the cardinality bound supplied by the tensor shape. Neither operation invalidates the invariant. Legacy per-axis multiplicities and tags are retained as metadata; the certified reduction factor uses the global cap and complete placement token above.
- Reduction over . If , Minkowski over the positions gives . If , each event appears at no more than positions. For each event, Cauchy–Schwarz (Theorem 5.5) gives
The output event support is projected onto the retained coordinates, so its inherited global cap remains valid; the key and placement token are updated accordingly. This projection step is essential: a separate incidence bound on each input line need not remain valid on the new lines after reduction.
A cumulative sum applies the same bound to each prefix, using the conservative factor for the full axis length . It marks the prefix axis shared, so projected output support is contained in the input support projected away from that axis. Its inherited cap is preserved. Each accumulation event belongs to only one line, so its new component has cap 1, with the prefix axis shared for cumulative sums.
In a matrix product, an inherited component is reduced along the contraction axis of length with factor when that axis is unshared, or coherently when it is shared. The new column axis for a left-operand component, or row axis for a right-operand component, is marked shared, as are any new broadcast batch axes. Projecting away these axes and the contraction coordinate leaves a projection of the old unshared support, preserving its cap. Component unions from the two operands obey the merging rule above; new accumulation events are private to each output position and have cap 1.
- Accumulation. For any summation tree, the computed sum equals the sum of the computed terms plus the rounding error of each addition, all with coefficient 1. On the rule's bounds the absolute sum of the computed terms, from the operand checkpoints per term, and for a product the product of its operands' bounds). For a subtree with additions and leaf absolute sum : the leaf case is , and for , with both induction hypotheses and . Hence every partial sum, and the exact sum of the
Xinyi Shi
operands of every addition, is at most in magnitude, deterministically on the prefix event; no checkpoint is needed for them, and no condition . Whether lies in the normal range is determined by earlier events, so is -measurable, and the increment has conditional mean zero and ; these increments form the component. The remainder is at most , and the remainders go to without using their mean.
-
Truncating accumulators (A2). In the alignment model [Fasi et al. 2021], the accumulator starts at zero, each block of at most products is formed exactly, the products and the running sum are aligned to the block's largest term and each is truncated to fp32 precision, and the block sum is truncated once more. Truncation never increases a magnitude, so by induction every term, partial sum and block sum is at most , and in the normal range one truncation loses less than one fp32 ulp of a value at most , at most . There are product truncations and two per block, so these errors total less than . Below the normal range the model assumes a gradual-underflow grid of spacing : each product's projection to that grid loses less than , after which the running sum and the products lie on the grid and their subnormal sums are exact, which gives the term . The whole charge goes to and also covers the simpler model in which each block is summed exactly and truncated once. Scope of the evidence. The charge is sound for an accumulator that behaves as this model with block ; that premise is A2. For Triton's t1.dot, calibration measured the sign of the bias and fitted on each GPU, an A100 stress test with products below of the largest exceeded the one-truncation-per-block charge but not this one in any of 240 configurations, and a 32-case boundary grid passed on both GPUs. These are finite tests, not a proof of the hardware's behavior, and the study of Fasi et al. [2021] is an empirical characterization, not a specification. Applying the same model and to cuBLAS GEMMs (historical bug #1433) or to torch._scaled_mm is a further assumption that we did not test separately. Hardware that flushes subnormals, keeps a coarser internal floor or starts from a nonzero accumulator is outside this derivation.
-
Ordered products (Theorem 5.4). Use the identity . The first term multiplies 's error by the exact constant . In the second, depends only on events that precede all of 's events, provided the test includes the events folded into 's deterministic part (dorig), since those still determine 's value. For each of 's events , the coefficient is therefore -measurable, bounded by , and equal to on . Deterministic parts give .
-
Other products and division. With shared or interleaved origins, 's error is . The first two terms have constant coefficients, and the third is bounded by on . Division uses the exact identity
whose last two terms are bounded on the prefix event by
where by A3. When the calculus yields no finite bound and the element is uncertified; the actual divisor may still be safe, as for with a rounded input, whose component the merge rule keeps.
-
Elementary functions. For , of magnitude at most on (Eq. (6)); the random coefficients are multiplied by the signed and their bounds by . The library evaluates at a computed input in , so A2 with the supremum over , plus the floor , bounds its error deterministically. A3 requires inside the domain; for an interval that reaches 0 yields no finite bound.
-
Quantizer scales. Scale computations are deterministic RN operations applied to the model's perturbed inputs. For a block, let and . Its perturbed maximum is in , where and . Define analogously over the whole tensor. These conservative endpoints are the ones used by the implementation: the maximum is 1-Lipschitz in the infinity norm, so they enclose every permitted perturbed maximum.
For FP8 with scale format , the scale map is
For MXFP4, the implemented map is
The floor applies to all sufficiently small maxima, including zero. Both maps are non-decreasing and positive; applying the relevant map to and gives and . For NVFP4 define the implemented global-scale map and its endpoints by
Thus . Let
The effective scale of a perturbed block is . Put = and . By monotonicity of RN and positivity of , the raw block scale lies in . If > 0, zero replacement cannot occur, so the effective block-scale factor is at least . If = 0, every nonzero E4M3 factor is at least and the replacement factor 1 is no smaller. Hence, with when > 0 and otherwise,
enclose . For the upper bound, a nonzero raw factor is at most ; a replaced factor is 1, covered by the second term. These are the implementation's endpoint formulas, including its positive global floor, zero-block replacement, and final fp32 scale-product rounding. Their evaluation is subject to A3–A4.
- Quantization. Under A1, the ordinary fp32 division gives . Let , , and . Then and on the operand prefix event. Clip to and model its ordinary grid rounding by . The grid increment has magnitude at most by A1. Both increments have conditional mean zero, and is fixed before either event. Before its separate reconstruction rounding,
Let . The first two terms form a martingale sum with proxy at most . Their events are private to one quantized element, so the new component has
Xinyi Shi
global incidence cap 1 even when its predictable scale coefficient is shared across a block. If , clipping is impossible. Otherwise, writing , the remaining term satisfies
The implementation charges the conservative amount to whenever , which covers this residual. A quantizer contract that bypasses grid rounding on a clipped element is also covered by setting that grid increment to zero; the clipping indicator is known before the grid event. The subsequent reconstruction rounding is an ordinary event unless it is a terminal store, in which case Theorem A.1 applies.
-
Maximum, absolute value and shifted exponentials. and on ; both go to , with the operands' origins recorded in dorig. Softmax and log-sum-exp subtract a maximum before exponentiating. When the operand is exact, the kernel's maximum is the exact one. Otherwise the kernel subtracts the maximum of its own perturbed values, and the reference uses this maximum rule for the shift; it does not use the shift invariance of the exact function, so the bound may be looser but not smaller.
-
Semantic casts. With the computed value and v the reference value, . The first term keeps its components; on the prefix event, and , both deterministic residuals, not centered increments. A cast whose input interval reaches beyond the largest finite value yields no finite bound, and the cast's output tensor, with every value computed from it, is uncertified; an ordinary rounding, an elementary-function result or an accumulation whose interval may overflow makes its element uncertified, as does an element whose exact value is not finite. For a mean the overflow test uses the unscaled partial sums, which a sum-then-scale implementation accumulates.
Tail bound. Let over events in order, with -measurable and , and let and . Given , the increment has mean zero and lies in with . By convexity, , so for every real , the last step because (for ). This is the conditional Hoeffding lemma used by Connolly et al. [2021]. Since is -measurable,
and by induction . For and , Markov's inequality gives , which makes ; the same holds for . With , . If , then and the event is empty.
LEMMA A.1 (TERMINAL STORE). Let an output's pre-store value have summary , where is the pre-store worst-case total. On , let with , and a martingale sum of proxy at most . Let the stored value be , let , and let the calculus's ordinary rounding produce . With and , both checks pass on , and .
Proof. First : the new event is in no old component. If it forms its own group, grows by exactly ; if it merges into a component of proxy in a group whose other components have total root proxy , the group grows by , and no other group changes. On , . On , by Cauchy-Schwarz,
, and always , so the bound check passes. Since and , also , so by monotonicity and the interval check passes. Finally, , and the event is empty when . ( because .)
PROOF OF THEOREM 5.1. For , consider the first checkpoint that leaves its envelope: the event is contained in , and on the invariant gives with defined everywhere and , so it is contained in . Because is the of a valid summary of , the tail bound applies with ; copies need no tail events of their own. A union over the checkpoints gives , the premise of the theorem; this uses an unconditional tail bound for a sum defined everywhere and never conditions a centered variable on . Applying the merge rules to the final groups shows that each output's pre-store error is on with 's proxy at most . For an output with a terminal store, Theorem A.1 contains the failure of either check, together with , in an event of probability . For an output whose last step is a semantic cast, the cast keeps the components of its operand and its two residuals are in , so on both the bound check and the interval check (on the operand , with ) fail only on ; an output with no final rounding has only the bound check, which fails with only on the same event. Its probability is at most . A union over the output elements of the call gives . In fixed-input mode no probability is involved: every holds deterministically, so holds with , and with neither check can fail. Finally, A4 transfers the real-arithmetic bound to the float64 implementation through .
PROOF OF THEOREM 5.2. Assume finite endpoints, no overflow and a fixed tie rule. is non-decreasing, so it maps into , and the endpoints are attained by and . For a representable with : if , monotonicity and give , a contradiction; similarly would give . So and is attained.
PROOF OF THEOREM 5.6. If for some , then receives the same input and output in both cases. Since accepts every element of , it passes on .
PROOF OF THEOREM 5.7. Let be one of the formats of Section 2.1 and take ; for negative values mirror the argument. Let be the spacing of at , the representable number with , , and the precision of , so . Let and , of probability ; on . The implementation evaluates and in float64 as and , and we use A4 in the form that its allowance bounds these errors: . The check's lower end evaluates with three float64 roundings and then steps once toward . Since , and on the roundings and the step move by at most in total,
With and , the loss on the left is at most . On , every value within of lies in and is truncated to , while . Round-to-nearest maps to , without a tie, also when starts a new binade, so the check's lower end exceeds the truncated output and the element is rejected. With as in the proposition,
Xinyi Shi
. With independent positions, each of elements escapes with probability at most outside the joint failure event of Theorem 5.1.
B Additional Evaluation Details
Witness development. We developed the calculus test-first: for each rule we searched for witness inputs on which an emulated correct implementation exceeds the rule's bound, and each witness became a regression test. Five witnesses changed the rules during development: inputs at rounding midpoints, where underestimates the variance; legal intervals spanning several ulps, which led to the rounding-interval rule; broadcast-then-reduce patterns, which led to keys; the negative tail of PyTorch's GELU, which led to the envelope; and worst-case second-order product terms, which led to the ordered-product rule. A review of the proofs found five more: an accumulation so long that turned negative, underflow in a two-term accumulation, a semantic cast spanning many representable values, a product of a value with its own row maximum whose provenance had been lost in , and a library call whose internal exp overflow returned zero. They led to the rules for accumulation, dorig, semantic casts and the library floor. For those five repairs, none had caused a false alarm on GPU, and no median bound grew over 10%. A later audit corrected shared-event duplication through where and coordinate shifts, quantizer half-spacing after division, nonfinite and overflow handling, softmax shifts of perturbed inputs, and incidence counts under composed shape operations. Each repair has regression witnesses; Section 7.1 describes the associated reference comparisons and GPU reruns.
Experiment versions. The mutation, tuning and timing results use the campaign-specific implementations recorded in the artifact. LayerNorm, SSD, bugs #1433/#1498/#10616 and the Liger/vLLM ablations were rerun with the final implementation (e447e916); Unsloth ablations retain their original version. The final implementation adds global incidence bookkeeping, the A3 finite-range check and the later witness repairs. For a separate CPU comparison, we used snapshots 92d6e44 and e447e916, covering 730 reference calls across the four main shapes and sampled families/configurations. Bounds changed only for LayerNorm, SSD and the three historical bugs in this comparison. The largest sampled increase was 63.46% in SSD's pre-store (61.98% at the terminal output); this is not a universal bound on repair size. Equality on these samples does not establish identical GPU verdicts on all other inputs. Both snapshots, detailed coverage and per-tensor comparisons are preserved in the artifact.
Final guard patch. The artifact's numerical source is the final implementation plus a guard-only patch (de63b01). The patch rejects unsupported fast-library output formats. It reports possible overflow inside elementary functions and accumulations, including the unscaled partial sums of a mean, as uncertified; no finite bound changes. No GPU run was repeated with the patch, and every run above keeps its recorded version. We rebuilt the reference constructions of the main, stress, ablation, historical, boundary, shift and FP8 experiments with and without the patch, using the recorded input schedules and precision plans: historical inputs regenerated on each GPU and matched to their archived hashes, and SSD with the recorded TF32 truncation. All 41,758 records had bitwise-identical values, bounds, rounding intervals and certification flags, and the T7 and T10 CPU campaigns produced byte-identical data. RoPE uses only unchanged arithmetic paths, so GPU-specific trigonometric input generation does not affect this patch comparison.
Distribution-shift certification. CPU reconstruction with the final implementation found 536 correct-input references without complete A3 certificates among 14,400 stress cases: 266 under S2 and 270 under S3. The corresponding variant sampling schedule contributes 98 more, for 634/17,016 calls (3.7%) per GPU. These are all rescaled fp16 gated activations: 320 GEGLU and 216 SwiGLU references; the other 13,864 correct references remain certifiable. S2 and S3 each contain 320 rescaled cases. The first range failures occur at terminal output rounding, not at a nonterminal fp16 cast. For GEGLU, the global second-derivative bound gives a loose envelope at large arguments; local derivative bounds may reduce these inconclusive outcomes. An incomplete certificate prevents a certified pass; the checker can still reject a different, certified element. We therefore reran all 634 affected calls with the final implementation on each GPU. Both GPUs recorded 634 inconclusive outcomes and no failures: 536 correct calls and 98 equivalent-variant calls. These are new GPU measurements on the recorded input schedule, not a rescoring of the original GPU outputs or a rerun of the full 17,016-call campaign. The runner checks all 536 input hashes and the frozen source manifest; the returned plans, per-call records, summaries and logs agree. The lightweight result archives contain per-call records and file hashes; input/output tensors and per-element arrays are excluded from these archives.
This reconstruction evaluates references on CPU, not new GPU kernel executions. It uses the recorded seeds and scales; 54 prespecified scale-search replays reproduce the recorded factors bit for bit. This does not prove bitwise identity of every CPU/GPU input operation: RoPE trigonometric inputs, for example, were generated on GPU. The separate SSD check uses each GPU's calibrated accumulator configuration. Per-case coverage and hashes are in the artifact.
The additional shifted-input fault experiment uses 144 inputs and 216 changed-output pairs across five faults. Re-evaluating saved GPU tensors retains 179 detections (17/36 under S4), compared with 49 and four faults for atol = rtol = . Eleven correct inputs are inconclusive, but their mutants have unchanged outputs; all 216 changed-output pairs have passing correct controls and are scorable.
Additional mutation results. Truncating stores (M4) separate the oracles most clearly: numoracle kills all 11 Liger M4 mutants and the best fixed oracle kills 3; the rounding-interval check flags more of their runs (Section 7.7), but the bound check alone also finds each. Eight Liger mutants are killed by numoracle alone: six truncating stores, an extra rounding of the cross-entropy log-sum-exp, and a truncated store of the per-row loss. The last two are visible only with reduction set to none; with per-row losses numoracle flags 138 and 157 of 240 runs and every fixed oracle none. In Unsloth numoracle alone kills an extra rounding inside RMSNorm, and in vLLM four mutants (an extra rounding, three low-precision scales).
Per run, numoracle flags 85% of bf16 and 83% of fp16 runs of effective Liger mutants, against at most 73% for any fixed oracle; in fp32 it flags 43%, like assert_close and the aiter formula, because the triton_fast profile's library allowances dominate the tiny fp32 rounding errors.
Missed mutants. numoracle misses eight mutants, for three reasons. A loose fp32 bound. The three misplacements change bf16 and fp16 outputs by less than the final rounding. In fp32 their worst element lies a median 5–13 times further from the float64 reference than the correct kernel's, yet uses at most 52% of the bound, which the math-library allowance dominates there; assert_close kills them on 31–38 fp32 inputs, and numoracle detects every degenerate-row instance (Section 7.4). The extra rounding of the Liger loss also stays within the bound (at most 68% of it, against 39% for the correct kernel); only tuned tolerances kill it. No loss of accuracy. The Unsloth RoPE change is closer to the float64 reference than the correct kernel (50% of the bound against 95%), and no fixed oracle kills it. Not distinguished by our checks. The three vLLM changes leave the worst-element error exactly as large as the correct kernel's. Fixed oracles kill two of them only on 1–4 of 240 inputs, crossing a threshold at which they flag 46–95% of correct runs. Two are truncating stores whose bias toward zero shows in 95–97% of runs, suggesting a pooled test under a separate model of correct-kernel bias (Section 5.3).
Xinyi Shi
Percentile calibration. Operator-aware calibration sets each tolerance to 1.5 times the 95th percentile of the maximum absolute error over correct runs [Sarkar 2026b]. We computed it per operator, dtype and output from the stored per-output statistics. Calibrated on the tuning phase, as before a release, it flags 32% of correct Liger runs, 31% of Uncloth and 41% of vLLM runs against the PyTorch reference, and 90–100% on degenerate rows; calibrating per operator and dtype only, or against the float64 reference, gives 23–54%. Calibrated on the evaluation inputs themselves, it still flags 2.5%, 2.2% and 4.6% of correct runs (2.0–6.7% over these choices) and 88–100% on degenerate rows, and kills 47 of 53, 24 of 27 and 28 of 44 mutants, against numoracle's 50, 25 and 41.
Exact ablation populations. Table 8 counts paired detections: the correct control passes and the mutant fails on the same input. Its main-input changed-output denominators are 11,405 Liger runs, 6,177 Uncloth runs and 8,579 vLLM runs. Unchanged outputs of effective mutants are excluded from these percentages; including them gives denominators 15,120, 7,680 and 10,560 instead. These are run counts, not independent mutant counts.
For M4, the changed-output denominators are 2,088 Liger and 480 Uncloth runs. Removing the interval check loses 327 of 1,997 and 79 of 480 detections, respectively: relative losses of 16.4% and 16.5%, rather than a 16-percentage-point change in all-run detection rate. Removing quadrature loses 16 Uncloth and one vLLM detection; removing ordered products or enabling the unsound independence control changes no paired detection in these GPU campaigns (Liger/vLLM reruns; original Uncloth campaign).
Table 9. Paired detections by ablation setting, using the changed-output populations stated above.
| Configuration | Liger | Uncloth | vLLM |
|---|---|---|---|
| Full | 10,651 | 5,660 | 6,836 |
| Bound check only | 10,080 | 5,543 | 6,670 |
| Fixed-input | 10,225 | 5,375 | 6,828 |
| No quadrature | 10,651 | 5,644 | 6,835 |
| No ordered products | 10,651 | 5,660 | 6,836 |
| Unsound independence | 10,651 | 5,660 | 6,836 |
At , paired detections increase by 5, 11 and 5, with no losses and the same mutant kills. At , Liger detections are unchanged; Uncloth loses three (5,660 to 5,657), retaining 25 kills. vLLM drops from 6,836 to 5,040: 1,794 earlier detections become unsupported and two become passes. Its kills drop from 41 to 40. In total, 2,319 of 8,579 changed-output vLLM runs are unsupported at that budget. Unsupported results are neither passes nor detections. The paper's separate 120/480 budget count refers to main correct-input vLLM cases, not these mutant runs.
GPU reruns. Both GPUs ran the final implementation with 20 main seeds, 10 degenerate/probe seeds and four shapes. The 10,290 non-tuning control calls per GPU comprise 360 LayerNorm correct calls, 3,600 LayerNorm variants, 480 SSD correct calls, 5,760 SSD variants and 90 residual-bug controls. All their outputs passed both certified checks, with no inconclusive result; 90 additional tuning calls also passed. LayerNorm retains one main-input miss (an epsilon misplacement), and its two non-compiling mutants account for 720 crash calls per GPU, excluded from numerical kills. SSD retains three missed mutants. The original offset bug is detected on all 120 affected main inputs; the residual post-fix bug is detected on 83/90 probes, with 0/90 flags on the corrected control. The residual-bug probes compare the still-faulty version after the first fix with its matched corrected control.
The historical reruns contain 534 before/after pairs per GPU: 444 evaluation and 90 calibration pairs. Every post-fix output passes the certified checks. Statistical checks can be inconclusive when there are too few independent units; these are separate from certified outcomes. For #1498, 40/40 Gaussian cases and four deterministic inputs with the LayerNorm mean at a half-ulp boundary detect the bug in fixed-input mode. For #10616, all 120 affected cases are detected and both versions pass the 80 negative controls. The configuration-specific #1433 counts follow (each cell is detections out of 20). Its cuBLAS alignment charge remains a hardware-model assumption, not a proof from t1.dot calibration.
Table 10. Detections for historical bug #1433, out of 20 inputs per cell.
| dtype | RTX PRO 6000 | A100 | ||||
|---|---|---|---|---|---|---|
| β | Gaussian | High logits | Gaussian | High logits | ||
| bf16 | 0 | 20 | 20 | 12 | 20 | |
| bf16 | 0.5 | 14 | 20 | 0 | 20 | |
| bf16 | 1 | 20 | 20 | 5 | 20 | |
| fp16 | 0 | 0 | 14 | 0 | 9 | |
| fp16 | 1 | 0 | 0 | 0 | 0 | |
The Liger and SSD ablation reruns completed all 1,920 and 480 planned cases, respectively. Held-out counts (819 Liger and 234 SSD correct inputs) are filters on main, not additional trials. All supported correct and checked equivalent outputs pass. At , 78/234 held-out SSD controls are unsupported and the held-out kill count is 36/44; at neither campaign has a scored correct input. Recorded mutant-output differences relative to the original campaign affect 20 Liger and 181 SSD comparisons. Every ablation setting uses the same newly recorded output and paired correct control; changed-output populations are derived from that campaign, so the new SSD denominator is 8,579 rather than the original 8,640. These differences are not attributed solely to the bound repair. The distributed archive contains case metadata and verdict summaries; per-element arrays from these ablation runs are not included.