Calibrated Tolerances Boost Tensor Kernel Bug Detection

Dipankar Sarkar· July 21, 2026 View original

Summary

This research proposes a method to calibrate mixed-precision tolerances for tensor kernel correctness tests by mining element-wise error distributions from cloud GPU runs. This approach significantly tightens tolerances compared to hand-picked values, leading to a substantial increase in bug detection recall for LLM-style buggy variants.

Ensuring the correctness of tensor kernels, especially in mixed-precision environments, is critical for reliable AI model deployment. Current testing practices often rely on fixed, manually chosen absolute and relative tolerances, which are frequently too loose and fail to catch subtle errors. This study introduces a data-driven approach to calibrate these tolerances. By analyzing the element-wise error distributions from thousands of cloud GPU runs across various tensor kernels and data types, the researchers determined the optimal absolute tolerance justified by correct implementations. This empirical calibration resulted in significantly tighter tolerances, with some cases showing over a 2000x improvement. Applying these calibrated tolerances to LLM-style buggy variants dramatically increased bug detection recall by 9.3 percentage points, from 73.2% to 82.4%, with only a minor increase in false positives. This highlights the importance of operator-aware, data-driven tolerance calibration for robust tensor kernel testing.

Why it matters

Tighter and more accurate correctness testing for tensor kernels is essential for the reliability and performance of AI hardware and software, particularly in the context of large language models and mixed-precision computing. This method can significantly improve bug detection.

How to implement this in your domain

  1. 1Automate the mining of element-wise error distributions from GPU test runs for all critical tensor kernels.
  2. 2Develop a system to dynamically calibrate absolute and relative tolerances based on observed correct implementation behavior.
  3. 3Integrate these calibrated tolerances into your continuous integration/continuous deployment (CI/CD) pipelines for tensor kernel testing.
  4. 4Retest existing tensor kernel implementations with the new, tighter tolerances to uncover previously missed bugs.

Who benefits

AI/ML DevelopmentSemiconductorCloud ComputingHigh-Performance Computing

Key takeaways

  • Hand-picked tolerances for tensor kernel tests are often too loose, missing bugs.
  • Empirically calibrating tolerances based on error distributions significantly tightens them.
  • Tighter tolerances lead to a substantial increase in bug detection recall for LLM-style variants.
  • Operator-aware calibration is crucial for robust mixed-precision tensor kernel correctness testing.

Original post by Dipankar Sarkar

"arXiv:2607.16228v1 Announce Type: new Abstract: Most tensor-kernel correctness tests go through a fixed-shape all close-style check with hand-picked absolute and relative tolerances. The thresholds are copied across the corpus and rarely revisited. We mine the element-wise error…"

View on X

Originally posted by Dipankar Sarkar on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses