When Double Rounding is Correct

📅 2026-10-06
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the challenges of simulating specialized numerical formats for modern machine learning accelerators and the high costs associated with extending traditional libraries. It proposes a unified numerical format abstraction alongside a dual-rounding correctness theory based on format inclusion. By introducing an automatic format inference algorithm, the approach enables high-precision kernel reuse, while formal verification is conducted using Lean 4 to ensure rigorous correctness. These techniques are integrated into MPFX, an efficient multi-precision numerical library developed in this work. Experimental results demonstrate that MPFX achieves up to an 11-fold speedup over MPFR in computational performance and a 13.5-fold improvement in hardware simulation efficiency, successfully combining strict mathematical correctness with superior execution performance.
📝 Abstract
Number libraries, which implement number formats and their arithmetic in software, are used to simulate hardware, making hardware behavior reproducible and thus verifiable and easier to design. However, modern machine learning accelerators are difficult to simulate, as they increasingly use specialized number formats that existing number libraries do not support. It is costly to extend these libraries using traditional methods: each combination of operation, format, and rounding mode typically requires a bespoke implementation. An easier way is to double round---compute at higher precision, then re-round---so that one high-precision kernel serves many formats, but double rounding is only known to be correct in select cases. We give a precise, efficiently checkable characterization of when double rounding is correct across many formats and rounding modes. Our result rests on a novel abstract number format that unifies fixed- and floating-point representations, reducing the correctness of double rounding to format containment: whether every value of one format is representable in another. We mechanized these results in Lean 4. In addition, we introduce a format inference algorithm that, given a sequence of operations, bounds each expression by a number format guaranteed to contain its result. We apply these insights in two ways. First, we present MPFX, a correctly-rounded, multi-precision number library that exploits correct double rounding to efficiently simulate many number formats. MPFX's correctly-rounded operations are up to 11x (mean: 6.05x) faster than MPFR's, and competitive with SoftFloat's---between 0.46x and 1.63x as fast (mean: 0.94x)---at the same precision. Second, in a case study, we implement a software simulation of a hardware specification using both SoftFloat and MPFX's primitives; the MPFX version is up to 13.5x faster.
Problem

Research questions and friction points this paper is trying to address.

double rounding
number formats
numerical libraries
machine learning accelerators
correctness
Innovation

Methods, ideas, or system contributions that make the work stand out.

Double Rounding
Abstract Number Format
Format Inference
Mechanized Verification
Multi-precision Library
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
B
Brett Saiki
University of Washington and Intel, USA
B
Bill Zorn
Intel, USA
C
Cynthia Richey
University of Pennsylvania, USA
Zachary Tatlock
Zachary Tatlock
University of Washington
CompilersVerificationProgram SynthesisComputational Fabrication