GPUカーネル最適化における許容誤差の影響を解明
Understanding the Impact of Tolerance Threshold in Automated GPU Kernel Optimization
GPUカーネル最適化で使われる許容誤差が、推論時のモデル挙動に与える影響を実カーネル置換と制御摂動で調査した論文。
著者: Zirui Wang, Yunbo Ni, Jinjie Liu, Chijin Zhou, Shaohua Li
分類: cs.LG, cs.DC, cs.SE
原文アブストラクト
GPU kernel optimization is increasingly driven by standardized benchmarks and autonomous kernel agents. To assess correctness, these benchmarks and agents commonly use differential testing, accepting an optimized kernel when its outputs remain within a predefined tolerance threshold of the reference outputs. However, how discrepancies accepted by these tests affect model behavior during inference remains poorly understood. In this paper, we investigate this question through real kernel replacements and controlled perturbations. We first integrate 1,160 published optimized kernel implementations from CUDA-L1 and the KernelBench leaderboard into 13 real-world models across three numerical precisions. Across 2,739 replacement evaluations, 55.28% produce at least one output change. Although accuracy changes are usually small, 11 evaluations incur accuracy drops greater than 50%. In the most severe case, Gemma-4-E4B's accuracy on MMLU falls from 67.0% to 5.5%. We then conduct 6,928 controlled perturbation evaluations to examine how numerical discrepancies affect model behavior. The effects depend on numerical precision, operator, and dataset. For Gemma-4-12B on MMLU in FP16, perturbations of the same magnitude change outputs for 73.6% of model inputs when applied to post_attention_rmsnorm, but cause no output changes when applied to lm_head. Our findings show that passing kernel-level tests does not prevent substantial and varied changes in model behavior. We hope our research findings can inspire the community to further explore correctness criteria in future kernel benchmarks and optimization agents.
