-
Notifications
You must be signed in to change notification settings - Fork 71
Move gemm_to_matmul_add rule to ort fusion rules #2398
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 <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
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 moves the gemm_to_matmul_add
rewrite rule out of the default optimization pipeline and into the ORT-specific fusion rules, ensuring it’s only applied when running optimize_for_ort
.
- Removed
gemm_to_matmul_add
from the default rewrites inonnxscript/rewriter/__init__.py
. - Imported and applied
gemm_to_matmul_add.rule
inoptimize_for_ort
withinonnxscript/rewriter/ort_fusions/_core.py
. - Cleaned up the optimize tutorial docs, simplified the table format, and removed the default rule list.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
onnxscript/rewriter/ort_fusions/_core.py | Imported gemm_to_matmul_add , applied its rule in optimize_for_ort . |
onnxscript/rewriter/init.py | Removed gemm_to_matmul_add from default rewrite rules. |
docs/tutorial/optimizer/optimize.md | Reformatted optimization table and removed the list of default patterns. |
Comments suppressed due to low confidence (1)
docs/tutorial/optimizer/optimize.md:28
- [nitpick] The docs no longer mention that
gemm_to_matmul_add
has been removed from the default optimization pipeline. Consider adding a note under the API section to explain that this rule now only runs in ORT-specific optimizations.
| Optimization | Description |
❌ 10 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Stop decomposing gemm to matmul add by default because it is a more compact representation. Move the ort fusion rules so it keeps functioning for ort.