In this article
GPU fused multiply-add changes the rounding path; comparing fused and separate expressions requires a stated numerical contract, not an assumption of identical bits.
Fused multiply-add computes a product and a sum as one arithmetic operation with a single final rounding. Separate multiplication and addition round at different points. This small change in the expression’s execution can change its result, especially when intermediate values are large or later terms cancel them.
Rounding belongs to the execution path
In a separate expression, the product is rounded before it becomes an input to addition. A fused operation retains the combined computation until its final rounding under the supported arithmetic contract. The algebraic formula can look identical while the intermediate representational decisions differ. This is a property of floating-point computation, not evidence that one processor randomly changed the mathematical task. Compiler transformations can expose that difference in ordinary-looking source expressions.
Primary reference: Floating Point and IEEE 754 Compliance for NVIDIA GPUs.
Cancellation can reveal the intermediate loss
Imagine a product that is close to the negation of the value added afterward. Rounding the product first can discard information that would matter after cancellation. A fused path can retain a different residual. This illustrates why a tiny final result does not imply that all intermediate quantities were small. The example motivates carefully chosen numerical inputs rather than a claim that fused computation always returns the application’s preferred answer.
Primary reference: CUDA Programming Guide: Writing SIMT Kernels.
Compiler options affect comparison
A compiler may contract suitable multiply-add expressions according to its options and language rules. Reading only the source does not prove whether the generated path is fused. Preserve the relevant build settings and inspect generated instructions when the distinction matters. A CPU reference can also use contraction or wider intermediates, so it should not be treated as an unquestioned specification merely because it runs on another processor.
Primary reference: CUDA C++ Best Practices Guide.
Accuracy and reproducibility are different questions
A path can be closer to a high-precision reference while differing from an older implementation’s bits. Conversely, reproducing old bits does not establish that they are the most accurate approximation. Define whether the goal is numerical closeness, deterministic repetition within a configuration or compatibility with an existing output. These goals may lead to different accepted settings. A single maximum-difference number cannot express all of them without the surrounding contract.
Build a targeted numerical comparison
Use inputs that exercise cancellation, large and small magnitudes and ordinary operating values. Compare the intended fused and separate paths with an explicitly described reference. Keep operation order and format visible in the record. The result can explain a particular discrepancy and guide a build choice. It should not turn into a blanket rule to disable or enable contraction everywhere, because the surrounding algorithm determines the practical consequences.
Related reading: A GPU inference benchmark you can trust; Reproducible inference stacks: preserving a GPU pilot’s result.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.