-
Notifications
You must be signed in to change notification settings - Fork 99
Support metadata_prop merge and version 25 in version converter #2782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support metadata_prop merge and version 25 in version converter #2782
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances the ONNX version converter by adding metadata preservation during version conversions and expanding support to ONNX opset version 25. The changes ensure that custom metadata attached to nodes is properly carried over when nodes are replaced or modified during version upgrades.
Changes:
- Increased maximum supported ONNX opset version from 23 to 25
- Integrated metadata merger utility to copy node metadata during version conversions
- Added comprehensive tests to verify metadata preservation for single and multiple replacement nodes
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| onnxscript/version_converter/_version_converter.py | Updated SUPPORTED_MAX_ONNX_OPSET to 25, added metadata_merger import and integration to copy metadata from original nodes to replacement nodes during conversion |
| onnxscript/version_converter/_version_converter_test.py | Added VersionConverterMetadataMergeTest class with two tests verifying metadata copying behavior, updated boundary test class to reflect new maximum version |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2782 +/- ##
==========================================
+ Coverage 70.46% 70.50% +0.03%
==========================================
Files 228 228
Lines 27258 27292 +34
Branches 2761 2763 +2
==========================================
+ Hits 19208 19241 +33
Misses 7100 7100
- Partials 950 951 +1 ☔ View full report in Codecov by Sentry. |
justinchuby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
| for new_node in replacement.new_nodes: | ||
| # TODO: control-flow | ||
| new_node.version = to_version | ||
| _default_metadata_merger.copy_merged_metadata([node], replacement.new_nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a global variable?
Fix pytorch/pytorch#172784
This pull request adds support for ONNX opset version 25 in the version converter and introduces a new mechanism to copy node metadata during version conversions. It also includes comprehensive tests to ensure that metadata is properly transferred to new or replacement nodes created by adapters during the conversion process.
Version converter improvements:
SUPPORTED_MAX_ONNX_OPSETwithinonnxscript/version_converter/_version_converter.py.metadata_mergerutility and implemented a default metadata merger to ensure node metadata is copied during version conversion. Metadata is now merged from original nodes to all replacement nodes in the conversion process. [1] [2]Testing and validation:
VersionConverterMetadataMergeTestclass inonnxscript/version_converter/_version_converter_test.pyto verify that metadata is copied correctly to replacement nodes and to all nodes created by adapters during conversion.