Skip to content

Disable the constant folding output-size limit by default - #32150

Closed
pragyam32 wants to merge 1 commit into
microsoft:mainfrom
pragyam32:fix/constant-folding-size-limit-default-off
Closed

Disable the constant folding output-size limit by default#32150
pragyam32 wants to merge 1 commit into
microsoft:mainfrom
pragyam32:fix/constant-folding-size-limit-default-off

Conversation

@pragyam32

Copy link
Copy Markdown

The output-size guard added in #28055 skips any node whose output size cannot be estimated before execution. Ops that have no ONNX shape inference function, such as the GreaterOrEqual and LessOrEqual functions below opset 16, reach the guard with no inferred output shape, so since 1.27 they are never constant folded and the entire downstream constant chain stops folding with them. No positive cap value avoids this because the bail is inside the guard.

Default the cap to 0 so folding behaves as it did in 1.26, and make the mitigation opt-in through
optimization.constant_folding_max_output_size_in_bytes.

Fixes #32130

The output-size guard added in microsoft#28055 skips any node whose output size
cannot be estimated before execution. Ops that have no ONNX shape
inference function, such as the GreaterOrEqual and LessOrEqual functions
below opset 16, reach the guard with no inferred output shape, so since
1.27 they are never constant folded and the entire downstream constant
chain stops folding with them. No positive cap value avoids this because
the bail is inside the guard.

Default the cap to 0 so folding behaves as it did in 1.26, and make the
mitigation opt-in through
optimization.constant_folding_max_output_size_in_bytes.

Fixes microsoft#32130

Co-authored-by: Cursor <cursoragent@cursor.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Constant folding silently disabled for GreaterOrEqual / LessOrEqual below opset 16 in 1.27 (regression from the new output-size guard)

1 participant