-
Notifications
You must be signed in to change notification settings - Fork 25
Symm lowering #1659
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
base: main
Are you sure you want to change the base?
Symm lowering #1659
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.
EnzymeJAX Benchmarks
Details
| Benchmark suite | Current: 90f15e0 | Previous: f603104 | Ratio |
|---|---|---|---|
scatter_sum / JaX / cpu / Primal |
0.000004296115000033751 s |
0.000004260189699562034 s |
1.01 |
scatter_sum / JaXPipe / cpu / Primal |
0.000004192633999628015 s |
0.000004406429699884029 s |
0.95 |
scatter_sum / JaX / tpu / Primal |
0.0001415956161996 s |
0.0001248841227003 s |
1.13 |
scatter_sum / JaXPipe / tpu / Primal |
0.0001420597381998 s |
0.0001351668211995 s |
1.05 |
This comment was automatically generated by workflow using github-action-benchmark.
| struct FuseMulIntoSymm | ||
| : public CheckedOpRewritePattern<stablehlo::MulOp, FuseMulIntoSymm> { | ||
| using CheckedOpRewritePattern<stablehlo::MulOp, | ||
| FuseMulIntoSymm>::CheckedOpRewritePattern; |
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.
Make the original fusemul into a templated struct and specialize those
| struct FuseAddIntoSymm | ||
| : public CheckedOpRewritePattern<stablehlo::AddOp, | ||
| FuseAddIntoSymm>::CheckedOpRewritePattern { | ||
| using CheckedOpRewritePattern<stablehlo::AddOp, | ||
| FuseAddIntoSymm>::CheckedOpRewritePattern; |
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.
same here
| return rewriter.notifyMatchFailure(op, "Unknown backend: \"" + backend + | ||
| "\""); |
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.
write a fallback implementation
| auto result = callOp.getResult(0); | ||
|
|
||
| rewriter.replaceAllUsesWith(op.getResult(), result); | ||
| // rewriter.eraseOp(op); // remove? |
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.
replaceAllUsesWith should remove the op automatically
No description provided.