-
Notifications
You must be signed in to change notification settings - Fork 97
Cleanup uses of onnxscript.rewriter.pattern - export symbols from main module #2437
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
Co-authored-by: gramalingam <10075881+gramalingam@users.noreply.github.com>
…rnal modules Co-authored-by: gramalingam <10075881+gramalingam@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
❌ 6 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
@copilot , can you run "lintrunner -a" to handle the formatting issues reported? |
Co-authored-by: gramalingam <10075881+gramalingam@users.noreply.github.com>
Ran |
This PR cleans up the usage of
onnxscript.rewriter.patternmodule as requested in the issue. Thepattern.pyfile is a legacy module maintained for backward compatibility, and this change reduces internal dependencies on it.Changes Made
(a) Export symbols from
onnxscript.rewriterAdded exports for the following symbols from the main
onnxscript.rewritermodule:RewriteRule,RewriteRuleClassBase,RewriteRuleSet(from_rewrite_rule.py)MatchingTracer,MatchResult,MatchStatus(from_basics.py)RewriterContext(from_rewrite_rule.py)(b) Update internal imports
Updated 17 internal files to import symbols from appropriate locations:
Files updated to use direct imports from defining modules (to avoid circular dependencies):
onnxscript/rewriter/no_op.pyonnxscript/rewriter/broadcast_to_matmul.pyonnxscript/rewriter/cast_constant_of_shape.pyonnxscript/rewriter/collapse_slices.pyonnxscript/rewriter/fuse_relus_clips.pyonnxscript/rewriter/_fusion_utils.pyonnxscript/rewriter/basic_rules.pyonnxscript/rewriter/redundant_scatter_nd.pyonnxscript/rewriter/fuse_batchnorm.pyonnxscript/rewriter/matmul_add_to_gemm.pyonnxscript/rewriter/gemm_to_matmul_add.pyBackward Compatibility
The
onnxscript.rewriter.patternmodule continues to work exactly as before, ensuring no breaking changes for existing external code.Example Usage
Testing
Fixes #2436.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.