GPU Kernels That Passed the Tolerance Check Still Changed Model Outputs in 55% of Swaps

Researchers swapped 1,160 published optimized GPU kernels, all passing KernelBench-style tolerance tests, into 13 real models. 55.28% of swaps changed at least one output. Most changes were tiny, but one cut Gemma-4-E4B's MMLU accuracy from 67.0% to 5.5%.

Share
Abstract grid of small blue tiles between two dashed rails, with bands of amber and orange tiles spreading toward the right edge.

Benchmarks for AI-written GPU kernels judge correctness with a tolerance check. Run the optimized kernel and the PyTorch reference on the same test inputs, call torch.allclose, and accept the kernel if every element lands inside the threshold. KernelBench set those thresholds at 0.0001 for FP32 and 0.01 for FP16 and BF16, and much of the field adopted them. A new preprint asks the follow-up question: once a kernel passes, does the model it gets dropped into still give the same answers?

The paper is Understanding the Impact of Tolerance Threshold in Automated GPU Kernel Optimization (arXiv:2611.40607, submitted 30 Nov 2026) by Zirui Wang, Yunbo Ni, Jinjie Liu, Chijin Zhou and Shaohua Li, from The Chinese University of Hong Kong and East China Normal University. In more than half of their kernel swaps, at least one of the model's outputs moved.

The setup

The authors took 1,160 published optimized kernels from the CUDA-L1 artifacts and the public KernelBench leaderboard. A kernel was used only if it passed the standard tolerance test at the precision being run. Each one then replaced the operator it implements at every call in the forward pass of a real model. The 13 open models cover text, vision and speech, from Qwen3 and Gemma-4 to ConvNeXT and Whisper, each run in FP32, FP16 and BF16. Weights, preprocessing, decoding and the sampled inputs stayed fixed, so each of the 2,739 replacement evaluations differs from its reference run in one kernel only.

For each evaluation they count output changes (the final answer differs from the reference run), negative flips (the reference answer was right and the new one is wrong) and the change in accuracy.

What passing the test bought

55.28% of the evaluations changed at least one final output, and 41.66% turned at least one correct answer into a wrong one. Most of that damage is small. The median output-change rate is 0.07%, less than one input in a 1,000-input set, and accuracy stayed within half a point in 94.7% of evaluations. Averaged over all 2,739, accuracy moved by -0.44 points.

Then there is the tail. 24 evaluations changed outputs for more than half of their inputs, and 11 cost more than 50 points of accuracy. The worst was Gemma-4-E4B on MMLU in BF16, which fell from 67.0% to 5.5% after a swap that had passed the check. The big losses cluster: 35 of the 64 evaluations that lost more than a point replaced either ConvNeXT's linear layer or Gemma's lm_head.

Horizontal bar chart, per model, of the share of kernel swaps that changed at least one output and that turned at least one correct output wrong. All models: 55.28% and 41.66%.
Share of kernel swaps, using kernels that passed the tolerance test, that changed at least one model output or turned a correct output wrong. Redrawn from Table 3 of Wang, Ni, Liu, Zhou and Li, arXiv:2611.40607.

The chart's per-model rates hide how uneven the effect is. Only 25.93% of ConvNeXT swaps changed anything, the second-lowest share, yet its 90th-percentile output-change rate is 68.67%. When a ConvNeXT swap did change something, it often changed a lot.

Three kernels, one model, two outcomes

The ConvNeXT case is the most useful part of the paper. Three linear kernels pass the test. On ImageNet-V2, two of them change 68.47% to 68.67% of predictions and cost about 52 points of accuracy, in all three precisions. The third changes essentially nothing. The two bad kernels leave the final logits about 0.80 away from the reference on average. In the source, all three compute the same dot product and write to the same output location. The main visible difference is which CUDA axis maps to output rows and which to columns. An instrumented run found the outputs differing at 66 of the 72 linear calls in a forward pass, starting at the second linear operation of the first block with a mean absolute difference of 1.54 × 10⁻⁷. The paper does not pin down a mechanism beyond that.

Gemma-4-E4B's lm_head on MMLU in FP16 shows the same split. Two of three passing kernels changed 87.2% of answers and cost 59.5 points. In each of those runs, 840 of the 1,000 inputs had at least one non-finite option score and so produced an invalid prediction. The third kernel changed no answers.

Noise the test would allow

The second half of the study skips real kernels and adds random noise to the reference kernel's output, with each element's error drawn between ε/10 and ε and given a random sign. There are 6,928 of these evaluations. At ε = 0.01, the same number as the FP16 tolerance, the result depends heavily on which operator gets the noise. For Gemma-4-12B on MMLU in FP16, noise on post_attention_rmsnorm changed 73.6% of answers and cut accuracy by 47.0 points. The same noise on attention_softmax changed 26.3% and cost 7.9 points, on linear 3.7% and 1.2 points, and on lm_head nothing at all. One threshold per precision treats all of those operators the same. The response is also not always monotone: in 670 of the 1,299 configurations, a larger ε at some step produced fewer output changes.

A random forest trained on the perturbation results, which the authors call KIP, flagged real replacements that broke an output-change or flip budget with F1 between 80.78% and 88.29%. It was trained and tested within the same 1,299 configurations, and the authors do not present it as a deployable tool.

Limits

All of this ran on one NVIDIA RTX PRO 6000 Blackwell GPU and one software stack, with kernels from two sources and sampled subsets of each dataset. Evaluations share configurations and inputs, and the headline rates depend on how many accepted kernels each configuration contributed. The paper does not propose a safe threshold or test what changing the thresholds would do.

What to do with it

If you take kernels from an optimization agent or a leaderboard, the pass flag only covers the probe inputs. The authors recommend judging a tolerance by output-change rate, negative-flip rate and accuracy change in the target configuration. In practice that means running the model with the new kernel and the reference kernel on your own eval set and diffing the final answers, per operator, at the precision you serve in. A kernel that costs one answer in a thousand may be fine for you. The Gemma lm_head kernels that produced non-finite scores on 840 of 1,000 inputs would have shown up in the first diff.

For kernel benchmark builders, the ConvNeXT and Gemma cases make the argument for a model-level check. The tolerance test passed all three kernels in each, and only running the model told them apart.

0 subscribers
0 average monthly readers