Evaluating Numerical Accuracy in Mixed-Precision Computing by Dual-Delta Testing
Peichen Xie
TL;DR
Dual-Delta Testing addresses the challenge of validating numerical accuracy in mixed-precision computing by replacing a single error delta with two error distributions $\Delta_1$ and $\Delta_2$ relative to a high-precision oracle $f_\Omega$. The method formalizes a mathematical framework, presents an algorithm to compute and compare the distributions, and offers statistical tools (descriptive statistics, visualizations, and hypothesis tests) to determine equivalence or superiority of implementations. Through matrix-multiplication case studies, the approach detects both equivalent accuracy and latent numerical issues, and it validates fixes by restoring distributional parity with the oracle. This methodology provides a robust, generalizable protocol for rigorously assessing numerical accuracy across mixed-precision implementations and hardware platforms.
Abstract
Mixed-precision computing has become increasingly important in modern high-performance computing and machine learning applications. When implementing custom mixed-precision functions -- such as fused operators, optimized GPU kernels, or quantized inference paths -- it is critical to verify their numerical accuracy. Traditional approaches typically compare the custom implementation against a reference using a single error metric. However, this single-delta approach provides limited insight into whether the observed errors are inherent to the precision level or specific to the implementation. This paper introduces \textit{Dual-Delta Testing}, a systematic methodology that evaluates two error distributions against a high-precision oracle, enabling rigorous comparison between a custom implementation and a baseline reference. We present the mathematical framework, algorithmic formulation, statistical analysis techniques, and practical examples demonstrating the methodology's effectiveness in evaluating numerical accuracy.
