Adding ttnn.to_dtype op in TTNN dialect #2055
Open
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.
In this pull request (PR), I am introducing the
ttnn.to_dtype
operation for data type casting on the host within the TTNN dialect.The existing
ttnn.typecast
function only supports data type casting on a device, which has led to failures when casting on the host. To address this, I have also restructured theTTNNDecomposeLayouts.cpp
file to accommodate these changes. Additionally, I have included compiler and silicon tests for scenarios where the inputs are located on the host.Since we are now managing this behavior within the compiler, there is no longer a need for runtime workarounds. As a result, I have removed those workarounds in this PR.
This improvement will benefit
emitC
, which previously lacked a runtime workaround and caused several tests to fail. Now, with these changes, we can ensure better compatibility and functionality.I created tests for Silicon from the transform pass. Please review it, and if anyone has a better method for running this on Silicon, your input would be greatly appreciated. Comments are welcome! :)
With this change, we are fixing a couple of bugs noticed:
Closes #1938
Closes #1733
Closes #1658