Replace onnxruntime.tools.symbolic_shape_infer with onnx-shape-inference#2562
Draft
justinchuby with Copilot wants to merge 3 commits into
Draft
Replace onnxruntime.tools.symbolic_shape_infer with onnx-shape-inference#2562justinchuby with Copilot wants to merge 3 commits into
justinchuby with Copilot wants to merge 3 commits into
Conversation
Copilot
AI
changed the title
[WIP] Replace onnxruntime.tools.symbolic_shape_infer with onnx-shape-inference
Replace onnxruntime.tools.symbolic_shape_infer with onnx-shape-inference
Jul 6, 2026
justinchuby
reviewed
Jul 6, 2026
Contributor
|
@copilot rebase from main then operate directly on the ir |
…untime-symbolic-shape-infer # Conflicts: # olive/passes/onnx/split.py
Contributor
Author
Done in dbbd9f1. Merged latest main (#2558) and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Swaps
onnxruntime.tools.symbolic_shape_infer.SymbolicShapeInferencefor theonnx-shape-inferencepackage — a port and improvement of the onnxruntime symbolic shape inference engine (as used by mobius) that operates on ONNX IR without serialization overhead.Following review feedback, the branch was brought up to date with main (#2558, which migrated
OnnxDAGusage toonnx_ir) and the helper now operates directly on the IR.run_symbolic_shape_inference(ir_model)inolive/passes/onnx/common.py, which takes and returns anir.Modeland callsinfer_symbolic_shapesdirectly on the IR.SplitModel(split.py) runs inference directly on the IR (no proto round-trip)._fix_output_shapes(common.py) andscripts/transform_dla_model.pyremain proto-oriented and adapt at the proto boundary viair.from_proto/ir.to_proto.onnx-shape-inference; bumpedonnx_irto>=0.2.0(its minimum).mixed_precision.pyuses a different engine (onnxruntime.transformers.shape_infer_helper), left unchanged.Checklist before requesting a review
lintrunner -a(Optional) Issue link