-
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
Fix issue #798 - Constant OP conversion doesn't convert scalar values #802
Conversation
auto outputType = mlir::cast<RankedTensorType>( | ||
getTypeConverter()->convertType(srcOp.getResult().getType())); | ||
|
||
mlir::ElementsAttr valueAttr = srcOp.getValue(); | ||
if (valueAttr.getShapedType().getShape().empty()) { |
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.
Should this be an assertion? What happens if it's not a splat?
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.
If it's not splat then we will assert in TTIR->TTNN conversion for constant op (see here). I didn't want to assert here because it is not limitation of StableHLO->TTIR conversion and will be common for all third party dialects, it is TTNN limitation.
5c9667a
to
567b666
Compare
Hey Marko! I am writing tt-xla tests for gather and I think I am hitting a constant op related failure. I would appreciate if you could take a look: tenstorrent/tt-xla#40 |
@ddilbazTT, did you update tt-xla to include this PR? |
@AleksKnezevic I rebased tt-mlir today and updated tt-mlir commit hash in CMakeLists.txt |
@AleksKnezevic @mrakitaTT @ddilbazTT I had a similar issue with the constant for my experimentation. Currently, we are not handling boolean types for stablehlo.constant conversion. I have implemented a fix for handling boolean tensors. However Defne's graph contains scalar constant; I'll handle this case as well and will submit PR. |
Fixes #798
Fixes tenstorrent/tt-xla#5