-
Notifications
You must be signed in to change notification settings - Fork 21
Tessera pass draft #1441
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?
Tessera pass draft #1441
Conversation
…meAD/Enzyme-JaX into jac-tessera
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
Benchmark suite | Current: c4d10eb | Previous: 7f88655 | Ratio |
---|---|---|---|
scatter_sum / JaX / cpu / Primal |
0.000004314978991169483 s |
0.000004144166014157235 s |
1.04 |
scatter_sum / JaXPipe / cpu / Primal |
0.000004397982999216765 s |
0.000004226277908310294 s |
1.04 |
scatter_sum / JaX / tpu / Primal |
0.0001386552981915 s |
0.0001389866188168 s |
1.00 |
scatter_sum / JaXPipe / tpu / Primal |
0.0001493743569939 s |
0.0001376257929019 s |
1.09 |
This comment was automatically generated by workflow using github-action-benchmark.
PatternRewriter &rewriter) const override { | ||
FunctionType fnType = funcOp.getFunctionType(); | ||
|
||
if (fnType.getNumResults() > 1) |
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.
not sure this is required?
LogicalResult | ||
matchAndRewrite(func::ReturnOp returnOp, | ||
PatternRewriter &rewriter) const override { | ||
|
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.
we should first check whether our parent op is a tessera defineop and only then do the replacement
matchAndRewrite(func::FuncOp funcOp, | ||
PatternRewriter &rewriter) const override { | ||
FunctionType fnType = funcOp.getFunctionType(); | ||
|
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.
eventually we will want to do some check if funcOp.hasAttr("tessera.convert") then do this conversion, otherwise leave the funcop alone
matchAndRewrite(func::CallOp callOp, | ||
PatternRewriter &rewriter) const override { | ||
|
||
rewriter.replaceOpWithNewOp<tessera::CallOp>(callOp, callOp.getResultTypes(), |
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.
we need to get the symbol we're calling into, and only if that symbol is a tessera.define do we do the call conversion
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.
add some tests (and the checks) otherwise looks good!
Look at "Draft of Func to Tessera Pass" commit.
Not yet tested.