-
Notifications
You must be signed in to change notification settings - Fork 14
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
[Metal Direct] Added support for ttir.exp op #743
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kmitrovicTT
requested review from
tapspatel,
sdjordjevicTT,
mrakitaTT,
nobradovictt and
rjakovljevicTT
as code owners
September 18, 2024 11:06
nsmithtt
reviewed
Sep 18, 2024
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.
Overall looks great! Couple of minor things inline.
pjanevskiTT
reviewed
Sep 19, 2024
pjanevskiTT
approved these changes
Sep 20, 2024
nsmithtt
approved these changes
Sep 20, 2024
kmitrovicTT
force-pushed
the
kmitrovic/ttmetal_direct_eltwise_exp
branch
from
September 23, 2024 09:43
4e3717e
to
899fd45
Compare
rpavlovicTT
approved these changes
Sep 23, 2024
kmitrovicTT
force-pushed
the
kmitrovic/ttmetal_direct_eltwise_exp
branch
4 times, most recently
from
September 24, 2024 09:15
f050f1b
to
0b3a37a
Compare
…. Handled lowering to ttkernel. - Refactored TTIRToTTMetalDispatchRewriter to include common building steps as well as some separate steps for unary and binary ops - Deprecated AcquireDstOp and ReleaseDstOp in favor of up-to-date metal tile_regs_* API: acquire, commit, wait, release
kmitrovicTT
force-pushed
the
kmitrovic/ttmetal_direct_eltwise_exp
branch
from
September 24, 2024 09:41
0b3a37a
to
eb6da07
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #534.
Added TTIR_GenericElementwiseUnaryOp. Made TTIR_ExpOp inherit from it. Handled lowering to ttkernel.
Example:
Running
ttmlir-opt
onproduces (only actual compute kernel shown)
which resembles already existing form for binary ops like
even though it is different from original
tt_metal/kernels/compute/eltwise_sfpu.cpp
form, because this way made more sense logically (like executingtile_regs_wait
aftertile_regs_commit
, not aftertile_regs_acquire
, like moving unary-op-specific init function before for loops, not right before unary op itself, etc).Running this through
ttrt
produces kernelCollecting generated input and output tensor and passing them through python script (PR here #760) comparing
golden = numpy.exp(input)
with device generated output givesTrue
fornp.allclose(output_tile, golden_tile, rtol=1e-1, atol=1e-1)
for each tile in tensor.