TECHNOLOGY

ONNX Runtime 1.32 PadFusion: explicit zero can beat every negative pooling input

In this article
THE QUICK TAKE

The 1.32 PadFusion repair preserves MaxPool zero-padding semantics; negative boundary windows are a stronger regression case than positive-only inputs.

ONNX Runtime 1.32.0 includes a PadFusion correction for MaxPool with negative inputs. The linked PR explains the semantic mismatch: explicit zero padding participates in the maximum, while implicit pooling padding is excluded. Removing a Pad node is therefore not automatically equivalent to increasing MaxPool padding by the same amount.

Equal shapes can hide different functions

Both graphs can produce an output with the expected dimensions while disagreeing at a boundary window. A zero introduced as data can win over negative values; an excluded position cannot. This difference is numerical, not merely a layout detail. A proposed minimal test should isolate a boundary window with negative valid elements and compare optimized and unoptimized graphs, rather than checking only output shape or successful model initialization.

Data range belongs in the proof

The PR restricts the affected fusion to a datatype where zero is the minimum representable value. That is a proof condition, not a claim that the operator is generally safe whenever observed calibration data happens to be positive. A runtime transformation must respect values allowed by the model contract. Tests should include signed and unsigned cases, with a Cast path where relevant, to prevent datatype assumptions from leaking across graph nodes.

Padding geometry still needs checks

Upstream also guards invalid merged padding and shape effects involving ceil mode. Correct boundary values are only one part of equivalence; output extent must remain the same too. A useful regression matrix separates value cases from geometric cases, so a failure points to the violated condition. Include an unfused reference for each, rather than treating a surviving optimization node count as the principal acceptance criterion.

A skipped fusion can be the correct optimization result

After the fix, some graphs should deliberately retain Pad. That is correctness-preserving behaviour, not evidence that optimization stopped working. Measure any performance tradeoff only after the result matches the source graph. The release reports this targeted semantic repair; this article adds no independent throughput result and does not infer that every Pad-to-Pool combination was previously wrong or is now eligible for fusion.

Sources

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.

Explore GPU hosting
← All articles