FPRev: Revealing the Order of Floating-Point Summation by Numerical Testing

Peichen Xie,Yanjie Gao,Jilong Xue
2024-11-01
Abstract:The order of floating-point summation is a key factor in numerical reproducibility. However, this critical information is generally unspecified and unknown for most summation-based functions in numerical libraries, making it challenging to migrate them to new environments reproducibly. This paper presents novel, non-intrusive, testing-based algorithms that can reveal the order of floating-point summation by treating functions as callable black boxes. By constructing well-designed input that can cause the swamping phenomenon of floating-point addition, we can infer the order of summation from the output. We introduce FPRev, a tool that implements these algorithms, and validate its efficiency through extensive experiments with popular numerical libraries on various CPUs and GPUs (including those with Tensor Cores). FPRev reveals the varying summation orders across different libraries and devices, and outperforms other methods in terms of time complexity. The source code of FPRev is at \url{<a class="link-external link-https" href="https://github.com/microsoft/RepDL/tree/main/tools/FPRev" rel="external noopener nofollow">this https URL</a>}.
Numerical Analysis,Software Engineering
What problem does this paper attempt to address?