-
Notifications
You must be signed in to change notification settings - Fork 82
Fix rewriter and CI tests for the latest onnx-ir version #2554
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
Conversation
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2554 +/- ##
==========================================
- Coverage 70.34% 70.21% -0.13%
==========================================
Files 218 218
Lines 26424 26426 +2
Branches 2647 2648 +1
==========================================
- Hits 18587 18556 -31
- Misses 6934 6968 +34
+ Partials 903 902 -1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
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 PR updates the rewriter to work with the latest onnx-ir version by addressing API changes. The main change is replacing deprecated function calls and fixing attribute handling compatibility issues.
Key Changes
- Replace deprecated
_check_shape
function withcheck_shape_bool
throughout fusion modules - Fix attribute comparison issues for sequence types in pattern matching
- Correct assertion order in test files for better readability
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
onnxscript/rewriter/ort_fusions/skip_normalization.py |
Updates function call from deprecated _check_shape to check_shape_bool |
onnxscript/rewriter/ort_fusions/mha_bias.py |
Updates function call from deprecated _check_shape to check_shape_bool |
onnxscript/rewriter/ort_fusions/mha.py |
Updates function call from deprecated _check_shape to check_shape_bool |
onnxscript/rewriter/ort_fusions/gqa_packed_qkv.py |
Updates function call from deprecated _check_shape to check_shape_bool |
onnxscript/rewriter/ort_fusions/gqa.py |
Updates function call from deprecated _check_shape to check_shape_bool |
onnxscript/rewriter/ort_fusions/attention.py |
Updates function call from deprecated _check_shape to check_shape_bool |
onnxscript/rewriter/ort_fusions/fused_matmul_rule_sets_test.py |
Reorders assertion parameters for better readability |
onnxscript/rewriter/ort_fusions/fused_matmul_rule_sets.py |
Fixes attribute type handling and comparison issues |
onnxscript/rewriter/_rewrite_rule.py |
Fixes attribute comparison by converting to list |
onnxscript/rewriter/_pattern_ir.py |
Improves attribute pattern matching for sequence types |
onnxscript/rewriter/_fusion_utils.py |
Renames deprecated function and adds new wrapper function |
Signed-off-by: Justin Chu <[email protected]>
ir.AttributeType.STRINGS, | ||
}: | ||
# Since the type of attr.value is Sequence, we need to convert to the same type for comparison. | ||
return tuple(attr.value) == tuple(self._value) |
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.
should we cast every value in the tuple?
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.
Discussed offline. Will do when needed
Fix rewriter CI tests for the latest onnx-ir version (currently in main). Since the latest onnx-ir is now returning tuples for repeated attributes, we need to update the comparison logic to account for that.