Repository navigation
[Fix][Relax][ONNX] Keep anonymous dimensions independent - #20988
Open
DiadkoShmek wants to merge 1 commit into
Open
DiadkoShmek wants to merge 1 commit into
DiadkoShmek wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Fixes #20867.
When an ONNX input dimension has neither a concrete extent nor a symbolic name, the importer must give that occurrence an independent variable. The existing dimension parser cached the empty name, making unrelated extents compare equal at the Relax VM boundary. It also treated an explicit zero extent as though the field were unset.
Read the protobuf field presence, preserve concrete values including zero, and allocate a fresh variable for each anonymous dimension. Keep the graph-wide map for named dimensions. The regression runs an LLVM-compiled ONNX model with different anonymous extents within and across inputs. It checks that the named batch extent is shared and that zero remains static.
Local validation on
23a6dbe, Linux x86-64, ONNX 1.22.0 and LLVM from TIRx 0.1.0.Rangediscrepancy against ONNX Runtime 1.29.0 also fails on the base.Codex assisted with the patch and validation.