Remove function value error in version converter#2791
Open
titaiwangms wants to merge 6 commits intomicrosoft:mainfrom
Open
Remove function value error in version converter#2791titaiwangms wants to merge 6 commits intomicrosoft:mainfrom
titaiwangms wants to merge 6 commits intomicrosoft:mainfrom
Conversation
justinchuby
reviewed
Feb 4, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2791 +/- ##
==========================================
+ Coverage 70.45% 70.50% +0.05%
==========================================
Files 228 228
Lines 27177 27211 +34
Branches 2734 2737 +3
==========================================
+ Hits 19148 19186 +38
+ Misses 7092 7090 -2
+ Partials 937 935 -2 ☔ View full report in Codecov by Sentry. |
justinchuby
approved these changes
Feb 4, 2026
Contributor
Author
|
TODO: support function within version converter |
titaiwangms
commented
Feb 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request enables version conversion support for ONNX models containing functions, addressing issue #2790 where models with functions caused the version converter to fail after upstream changes in onnx-ir.
Changes:
- Removed the automatic inlining of functions before version conversion
- Added support for converting nodes inside function definitions directly
- Removed the error that prevented processing models with functions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| onnxscript/version_converter/init.py | Removed InlinePass from the conversion pipeline and the ValueError check for models with functions |
| onnxscript/version_converter/_version_converter.py | Added visit_function method to handle version conversion of nodes inside functions and integrated it into the model visitor |
| onnxscript/version_converter/_version_converter_test.py | Added test case verifying that nodes inside model functions are correctly version-converted |
justinchuby
reviewed
Feb 6, 2026
justinchuby
reviewed
Feb 6, 2026
justinchuby
approved these changes
Feb 7, 2026
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.
Fix #2790
This pull request makes a targeted change to the version converter in
onnxscript. The main update removes the restriction that prevented models containing functions from being processed by the version conversion pass.Version conversion support update:
onnxscript/version_converter/__init__.py)