Repository navigation
Optimizer: keep SplitToSequence folding valid before opset 18 - #3218
Open
Sharven Rane (SharvenRane) wants to merge 1 commit into
Open
Sharven Rane (SharvenRane) wants to merge 1 commit into
Sharven Rane (SharvenRane) wants to merge 1 commit into
Conversation
The SplitToSequence evaluator lowers a constant scalar split that divides the axis evenly to `Split(num_outputs=n)`. Split only has `num_outputs` from opset 18, so for opsets 13 to 17 the folded model fails `onnx.checker` and ONNX Runtime. Before opset 13 every lowering is invalid, because Split and Squeeze take `split` and `axes` as attributes there while the evaluator passes them as inputs. Use explicit split sizes before opset 18, as the uneven split case already does, and register the evaluator only from opset 13. Added a test over opsets 11 to 18 that fails on main for five of its six cases and passes with the fix.
|
Sharven Rane (@SharvenRane) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
The SplitToSequence evaluator lowers a constant scalar split that divides
the axis evenly to
Split(num_outputs=n). Split only hasnum_outputsfrom opset 18, so for opsets 13 to 17 the folded model fails
onnx.checkerand ONNX Runtime. Before opset 13 every lowering isinvalid, because Split and Squeeze take
splitandaxesas attributesthere while the evaluator passes them as inputs.
Use explicit split sizes before opset 18, as the uneven split case
already does, and register the evaluator only from opset 13. Added a
test over opsets 11 to 18 that fails on main for five of its six cases
and passes with the fix.
Tests: 519 passed on main, 525 here.