Skip to content
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

Revert embedding dataformat cast #59

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions python/tvm/relay/frontend/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2700,10 +2700,7 @@ def embedding(self, inputs, input_types):
# exposes a few bugs in tt-mlir https://github.com/tenstorrent/tt-mlir/issues/1215
logger.warning("Casting input indices of embedding op from {} to int32", indicies_dtype)
indices = tvm.relay.cast(indices, "int32")
# cast the weight to bfloat16 if it is float32
if weight.type_annotation.dtype == "float32":
weight = tvm.relay.cast(weight, "bfloat16")
return tvm.relay.cast(_op.embedding(weight, indices, axis=0), "float32")
return _op.embedding(weight, indices, axis=0)

def embedding_bag(self, inputs, input_types):

Expand Down