Research Papers 论文研究 5d ago Updated 4d ago 更新于 4天前 45

The Integer Alibi: Localizing Cross-Kernel Divergence in INT8-Quantized LLM Inference 整数替罪羊:定位INT8量化LLM推理中的跨内核分歧

Swapping only the INT8 linear kernel (CUTLASS vs Triton) inside vLLM while holding all other factors fixed produces zero end-to-end sequence agreement across 1.7B and 8B Qwen3 models, despite each kernel being internally reproducible bit-for-bit The "integer alibi" proves the INT32 accumulator cannot be the divergence source: under verified no-overflow bounds, the dot product is exact and order-independent, localizing differences to post-accumulator scale application and output rounding Under po 在固定checkpoint、硬件、推理引擎和量化配置下,仅交换vLLM中的INT8线性内核(CUTLASS vs Triton),发现两个内核在端到端推理中完全不一致(0/8, 0/16, 0/64序列) 通过"整数不在场证明"(integer alibi)理论分析,证明在验证的无溢出边界下,INT32点积是精确且与顺序无关的,累加器不是差异来源 在Qwen3-1.7B(196层)和8B(252层)的所有线性层中,使用2的幂次缩放时内核输出位级相同,实际checkpoint下差异最多为一个bfloat16间距 差异被精确定位到精确累加器之后的缩放应用和输出舍入阶段,使用探针checkpoint

58
Hot 热度
72
Quality 质量
65
Impact 影响力

Analysis 深度分析

TL;DR

  • Swapping only the INT8 linear kernel (CUTLASS vs Triton) inside vLLM while holding all other factors fixed produces zero end-to-end sequence agreement across 1.7B and 8B Qwen3 models, despite each kernel being internally reproducible bit-for-bit
  • The "integer alibi" proves the INT32 accumulator cannot be the divergence source: under verified no-overflow bounds, the dot product is exact and order-independent, localizing differences to post-accumulator scale application and output rounding
  • Under power-of-two scales, both kernels produce bit-identical outputs across all 196 layers (1.7B) and 252 layers (8B), with real-scale differences capped at one bfloat16 spacing; a probe checkpoint intervention fully restores end-to-end bitwise agreement
  • FP8 GEMM exhibits a fundamentally different divergence signature: both prevalence and magnitude of differences scale with reduction depth, unlike INT8 where discrepancies remain at parts-per-million levels across a 64x K range
  • Teacher-forced replay maps flips to tokens with small logit margins, achieving ROC-AUC 0.94 for flip-risk prediction across 16,384 positions, with full pre-registration, per-layer predictions, and a conformance procedure to be released

Why It Matters

This work directly challenges a foundational assumption in production LLM deployment—that interchangeable GPU kernels yield identical results—revealing that kernel choice alone can completely alter model outputs in quantized inference. For practitioners running INT8-quantized models, the findings imply that kernel provenance and version pinning are critical reproducibility concerns, not merely performance optimizations. The conformance procedure and released manifests offer the community a concrete methodology for auditing kernel interchangeability claims.

Technical Details

  • Experimental design: Controlled swap of only the INT8 GEMM kernel (CUTLASS vs Triton) inside vLLM, with checkpoint, prompts, hardware, inference engine, decoding strategy, and quantization config held constant; tested on Qwen3-1.7B (196 linear layers) and Qwen3-8B (252 layers)
  • Integer alibi proof: Demonstrated that for shared INT8 operands under a verified no-overflow bound, the INT32 dot product accumulator is exact and order-independent, mathematically ruling out the accumulator as a divergence source
  • Layer-wise localization: Feeding identical operands from every linear layer to both kernels confirmed bit-identical outputs under power-of-two scales (196/196 and 252/252 pinned predictions), with real-scale deviations bounded to at most one bfloat16 ULP—localizing divergence strictly to scale application and output rounding after the accumulator
  • FP8 contrast: Cross-implementation FP8 GEMM shows divergence magnitude and prevalence growing with reduction depth, while INT8 stays stable at ppm-level across a 64x range of K dimensions, indicating fundamentally different numerical behavior between quantization formats
  • Flip prediction: Teacher-forced replay links layer-level flips to specific tokens; small logit margins are the primary predictor of flip risk, achieving ROC-AUC 0.94 on 16,384 positions; a probe checkpoint intervention restores full end-to-end bitwise agreement (8/8 and 16/16 sequences)

Industry Insight

  • Kernel interchangeability cannot be assumed in production quantized inference pipelines; organizations should adopt kernel pinning and conformance testing as part of their deployment verification, especially for safety-critical or regulated applications
  • The INT8 vs FP8 divergence signatures suggest that quantization format choice carries distinct reproducibility trade-offs: INT8 offers tighter numerical bounds but hidden rounding divergence, while FP8 exhibits depth-dependent error accumulation that may be more predictable but harder to bound
  • The released conformance procedure and pre-registration framework establish a new standard for reproducibility auditing in ML systems, encouraging the community to treat kernel-level verification as a first-class concern alongside model-level reproducibility

TL;DR

  • 在固定checkpoint、硬件、推理引擎和量化配置下,仅交换vLLM中的INT8线性内核(CUTLASS vs Triton),发现两个内核在端到端推理中完全不一致(0/8, 0/16, 0/64序列)
  • 通过"整数不在场证明"(integer alibi)理论分析,证明在验证的无溢出边界下,INT32点积是精确且与顺序无关的,累加器不是差异来源
  • 在Qwen3-1.7B(196层)和8B(252层)的所有线性层中,使用2的幂次缩放时内核输出位级相同,实际checkpoint下差异最多为一个bfloat16间距
  • 差异被精确定位到精确累加器之后的缩放应用和输出舍入阶段,使用探针checkpoint可恢复端到端位级一致性
  • FP8 GEMM呈现不同特征:差异频率和幅度随归约深度增长,而INT8差异保持在百万分之几且在一个间距内,教师强制回放显示翻转集中在小logit边际处(ROC-AUC 0.94)

为什么值得看

本文首次系统性地验证了GPU内核可互换性假设,揭示了INT8量化推理中跨实现差异的根本来源,为量化模型部署的可靠性验证提供了理论框架和实用工具。研究提出的"整数不在场证明"方法为量化推理的调试和标准化提供了可复现的基准测试方案。

技术解析

  • 实验设计:在vLLM推理引擎中固定checkpoint(Qwen3-1.7B和8B)、提示、硬件、解码策略和量化配置,仅交换INT8线性内核实现(CUTLASS vs Triton),进行端到端序列比较测试(8/16/64长度)
  • 整数不在场证明:对于共享的INT8操作数,在验证的无溢出边界下,INT32点积是精确且与顺序无关的,因此累加器不能产生差异;差异只能来自累加器之后的缩放应用和输出舍入
  • 逐层验证:从Qwen3-1.7B(196层)和8B(252层)的每个线性层提取操作数, feeding到两个内核,在2的幂次缩放下实现位级相同(196/196和252/252层确认),实际checkpoint下差异最多为一个bfloat16间距
  • FP8对比:FP8 GEMM的差异模式与INT8不同,差异频率和幅度随归约深度增长,而INT8差异保持在百万分之几范围内且在一个间距内,跨越64倍K范围
  • 教师强制回放分析:将层与token关联,发现翻转集中在小logit边际处,预测翻转风险的ROC-AUC达到0.94(16,384个位置)

行业启示

  • 量化部署标准化:研究揭示了不同内核实现间的潜在差异,建议建立内核可互换性验证流程,确保量化模型在不同硬件和软件栈上的行为一致性
  • 调试方法论:提出的"整数不在场证明"和逐层探针方法可作为量化推理调试的标准工具,帮助快速定位数值差异来源
  • FP8 vs INT8选择:FP8在深层归约中差异增长更快,而INT8在广泛K范围内保持稳定,这对选择量化格式和验证策略具有指导意义

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

LLM 大模型 Quantization 量化 Inference 推理 GPU GPU Research 科学研究