Fix rewriter and CI tests for the latest onnx-ir version#2554
Fix rewriter and CI tests for the latest onnx-ir version#2554justinchuby merged 9 commits intomainfrom
Conversation
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
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 <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
There was a problem hiding this comment.
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_shapefunction withcheck_shape_boolthroughout 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 <justinchuby@users.noreply.github.com>
| 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.
should we cast every value in the tuple?
There was a problem hiding this comment.
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.