-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add embedding backward workaround #1756
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.
Great change, thanks @pmarkovicTT! Can you change a silicon test to use f32 instead of bf16, so we can test the workaround on silicon as well?
9a639d9
to
ddd511b
Compare
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.
Thanks!
Changed the test and it passed tests ( |
We don't need explicit embedding dataformat cast in tvm (from float32 to bf16) as dataformat workaround for this case is implemented in mlir. PRs for reference: - [TVM cast workaround](#55) - [Embedding Op workaround](tenstorrent/tt-mlir#1583) - [EmbeddingBackward Op workaround](tenstorrent/tt-mlir#1756) Related to this issue tenstorrent/tt-forge-fe#1112
#1111) ### Ticket Close #1112 ### Problem description We don't need explicit embedding dataformat cast in tvm (from float32 to bf16) as dataformat workaround for this case is implemented in mlir. PRs for reference: - [TVM change](tenstorrent/tt-tvm#59) - [Embedding Op workaround](tenstorrent/tt-mlir#1583) - [EmbeddingBackward Op workaround](tenstorrent/tt-mlir#1756) ### What's changed Removed explicit cast to bfloat16 if dataformat for embedding weights is float32. Updated llama backward test to reflect new forge api for training (setting training argument). ### Checklist - [x] Remove explicit cast in third_party/tvm/python/tvm/relay/frontend/pytorch.py - [x] Update test_llama_backward.py --------- Co-authored-by: Vladimir Milosevic <157983820+vmilosevic@users.noreply.github.com>
This PR introduces workaround for embedding backward op. Due to TTNN constraint to accept only BF16 and BF8 data types, this workaround casts F32 to BF16 and back. This is follow up to #1583
Closes #1503