-
Notifications
You must be signed in to change notification settings - Fork 64
Handle empty rewrite rules in rewrite function #2164
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
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.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
onnxscript/rewriter/pattern.py:1667
- [nitpick] Consider clarifying the error message to indicate that providing an empty list of rewrite rules is invalid in this context. If cleanup-only behavior is desired, ensure RewriteRuleSet is not instantiated with empty rules.
if not rules:
onnxscript/rewriter/init.py:29
- [nitpick] For consistency with RewriteRuleSet, consider aligning the error message and validation logic for empty rule sets in RewritePass. This adjustment can help avoid confusion for users when no rewrite rules are provided.
if not pattern_rewrite_rules:
❌ 15 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
In #2149 the logic for skipping rewrite when no rules are provided was removed. This PR adds the logic back and hardens input checks. Now if no rules are provided to
rewrite()
, it will only run cleanup passes.