The Integer Alibi: Localizing Cross-Kernel Divergence in INT8-Quantized LLM Inference
Organizations: Krixvon, Taipei 100, Taiwan
Abstract
Two GPU kernels implementing the same scaled INT8 GEMM interface are usually treated as interchangeable. We test that assumption: holding the checkpoint, prompts, hardware, inference engine, decoding, and quantization configuration fixed, we swap only the INT8 linear kernel (CUTLASS versus Triton) inside vLLM. At 1.7B each arm reproduces itself bit-for-bit across cold restarts, yet the arms agree on no sequence in any end-to-end comparison we ran (0/8, 0/16, and 0/64). What makes this more than a benchmark discrepancy is an integer alibi: for shared INT8 operands under a verified no-overflow bound, the INT32 dot product is exact and order-independent, so the accumulator cannot be the source of any difference. Feeding both kernels identical operands from every linear layer of Qwen3-1.7B and 8B (196 and 252 layers), we find bit-identical outputs under power-of-two scales, confirming a pinned prediction list 196/196 and 252/252 (pre-registered at 1.7B, pinned but not blind at 8B), and observed differences of at most one bfloat16 spacing under the checkpoints' real scales. This localizes the divergence to scale application and output rounding after the exact accumulator. Applied as a probe checkpoint, the same intervention restores end-to-end bitwise agreement (8/8 and 16/16 sequences). Cross-implementation FP8 GEMM shows a different signature: both the prevalence and the magnitude of differences grow with reduction depth, while the INT8 fraction stays at parts per million and within one spacing over a 64x range of K. Teacher-forced replay ties layers to tokens: flips concentrate at small logit margins, which predict flip risk with ROC-AUC 0.94 on 16,384 positions. We will release the pre-registration, per-layer predictions, manifests with kernel-selection evidence, and a conformance procedure that turns these controls into a concrete check for kernel interchangeability.
Figures & tables
| Work | Treatment variable | Numeric path | Observation scale | Relation to this paper |
|---|---|---|---|---|
| Schlögl et al. [ 9 ] | Platform, SIMD, convolution algorithm | General NN inference | Layer, model output | Stacks are not numerically neutral; we fix the platform and isolate one kernel |
| Yuan et al. [ 10 ] | Batch size, GPU count/type, precision | BF16, FP32 | Token, accuracy, length | Greedy LLM outputs are configuration-sensitive; we fix configuration and add an exact integer control |
| He [ 11 ] | Batch size (serving shape) | Floating-point kernels | Kernel to token | Buys batch invariance with throughput; we study fixed-shape interchangeability |
| TBIK [ 12 ] | Tensor-parallel size | Floating-point reductions | Bitwise model output | Aligns reduction trees; the integer path needs only an epilogue contract |
| Pape et al. [ 13 ] | Whole inference backend | Mostly floating-point serving | Benchmark score | Backend is a hidden hyperparameter; we isolate one kernel within it |
| HEAL [ 14 ] | Heterogeneous GPUs, 16-bit path | FP16/BF16 boundaries | Activation, token, task | Attributes error to kernel boundaries, uses teacher forcing; we add an exact-accumulator control and a scale intervention |
| Qwen3-1.7B | Qwen3-8B | |
| int8 linear layers | 196 | 252 |
| predicted bitwise-safe | 196 | 252 |
| min headroom to (bits) | 2.82 | 3.36 |
| capture tile (tokens/layer) | 512 | 512 |
| uniform pow2 scales: bit-identical layers | 196/196 | 252/252 |
| real scales: bit-identical layers | 8/196 | 10/252 |
| comparison | 1.7B | 8B |
|---|---|---|
| same arm, two cold runs (each arm) | 8/8 | — |
| CUTLASS vs. Triton, real scales | 0/8 | 0/16 |
| same, 64-prompt rail run | 0/64 | — |
| CUTLASS vs. Triton, pow2 probe | 8/8 | 16/16 |
| SGLang vs. vLLM arms, real scales | 0/8 | — |
| SGLang vs. vLLM, pow2 probe | 1/8 | — |
| Check | Requirement | A violation suggests, or first check |
|---|---|---|
| Shared operands | Both arms consume the same int8 tensors and scales, verified from artifacts | The comparison is not kernel-only; no localization is licensed |
| INT32 no-overflow | for the layer’s | Accumulation may wrap, so the integer alibi does not apply at all and no localization is licensed |
| Lossless FP32 entry | Observed per layer | Only the universal no-loss guarantee at the epilogue boundary is lost; individual values may still be exact, so judge per value or widen the tolerance rather than discard the layer |
| Exact accumulator | Bit-identical INT32 accumulation across arms | An integer-path defect: the arithmetic admits no legal difference |
| Pow2-scale identity | Bit-identical outputs under power-of-two scales, excluding subnormal and overflow results | First check the listed preconditions and each arm’s intermediate semantics; if those hold, an epilogue defect, since rounding order cannot matter under ( 2 ) |
| Real-scale tolerance | Cross-arm bf16 ulp distance , assuming both arms round once from fp32 intermediates; near-zero and non-finite elements reported separately | Suggests reduced intermediate precision, fusion, or another departure from single-rounding semantics rather than mere double rounding |