In this article
The 1.32 DOUBLE-constant guards retain operations when target float attributes lose information; constant folding still needs parameter precision checks.
ONNX Runtime 1.32.0 includes guards for graph fusions that would narrow DOUBLE constants into float attributes. The linked PR preserves explicit operations when that conversion is lossy. A constant’s presence at compile time does not make changing its value harmless; fusion equivalence includes the precision of parameters embedded in the target operator.
A target attribute has its own type
A source initializer can carry a wider value than the fused operator’s attribute representation. The PR identifies scales and normalization epsilon as affected examples. The rewrite must account for that representation change, not merely the algebraic identity with ideal real numbers. A proposed test chooses a DOUBLE value that cannot return unchanged after float conversion, alongside an exactly representable control that should remain eligible.
Exactness is different from a generous tolerance
An end-to-end tolerance can hide a changed constant on one convenient input. The guard instead asks whether the required round trip preserves the parameter. These are different questions. Keep a parameter-level assertion as well as output comparisons, and use inputs sensitive to the scale or epsilon. A test with zeros everywhere can make a lossy scale conversion invisible while still appearing to validate the fusion.
Skipping retains the original precision path
Upstream leaves a lossy scale as an explicit operation and declines affected normalization folds. That can preserve more nodes while protecting the original function. Report the surviving graph accurately rather than calling every missed fusion an optimizer failure. Exactly representable DOUBLE values can still be admitted, so coverage should verify both outcomes. A blanket dtype ban would test a different policy from the one introduced by the repair.
Performance follows equivalence
Only compare speed after establishing that the two routes preserve the required numerical contract. An apparent gain from silently narrowing epsilon is not a valid optimization result for the original model. This article reports a release guard and proposed regression inputs, without claiming new accuracy measurements or asserting that all FLOAT attributes are inadequate. The issue is a lossy transition from a wider source value into a narrower target representation.
Sources
Related reading
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.