A shared number model clarifies when rounding can be reused
In plain words
The paper develops a shared way to describe many number formats, including fixed-point and floating-point. The authors use it to check when rounding in two steps gives the same answer as rounding directly, and to rewrite calculations so they can run with available arithmetic operations.
They show that some rounding-mode pairings are safe under stated conditions, while others can fail even with a very wide intermediate format. In one sampled dot-product setup, a plain FP32 version disagreed with the specification on about 5.2% of inputs.
The research
When software simulates specialized arithmetic, can it use a wider calculation and round afterward without changing the specified answer? Existing libraries support limited formats, and the correctness of rounding twice depends on the formats and rounding modes involved. The paper develops a way to determine when that shortcut is justified.
The authors unify number formats and derive checks that show when intermediate rounding can preserve a direct result.
They model formats using precision, a minimum representable step when one exists, and maximum value, then check containment from those parameters.
Their rules identify conditions for six rounding-mode pairings; counterexamples show that simply widening the intermediate format cannot make the other ten pairings generally safe.
In one MX dot-product setup, a plain FP32 implementation disagreed with the specification on about 5.2% of one million sampled block pairs. This shows why a simulation may need to preserve the specified rounding steps.
The guarantees cover the paper’s abstract formats and apply to double rounding only when direct rounding to the target does not overflow.
The practical results cover the specific operations, formats, inputs, and implementations tested; special values and dynamically bounded loops are outside the stated analysis.
Analysis
Deep
- Authors
- Brett Saiki, Bill Zorn, Cynthia Richey, Zachary Tatlock
- License
- CC BY 4.0