Skip to content

fuse_pad_into_conv optimization incorrectly fuses when 'pads' contain negative values #2838

@bas-aarts

Description

@bas-aarts

converting the attached ONNX model with the following script:

from onnxscript import ir
from onnxscript.optimizer import optimize

ir_model = ir.load("input.onnx")
optimized_model = optimize(ir_model)
ir.save(optimized_model, "output.onnx")

results in the following output model:

Image

The Conv layer has negative pad values, which is not allowed per spec. This optimization should check for negative pad values.

input.onnx.zip

versions of relevant packages:

ml_dtypes         0.5.4
onnx              1.20.1
onnx-ir           0.1.16
onnxscript        0.6.2

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions