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

Adding bf16 data type workaround for max_pool2d op and fixing embedding workaround tests #1657

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

sdjordjevicTT
Copy link
Contributor

Applying bf16 data type workaround on max_pool2d op.

With this change, I rewrote the workaround test, silicon, and compiler test.

Closes #1389

@sdjordjevicTT sdjordjevicTT force-pushed the sdjordjevic/max_pool_2d_bf16_workaround branch from ee54049 to f3ec40c Compare December 23, 2024 16:58
@sdjordjevicTT
Copy link
Contributor Author

Created the following issue to track the runtime workaround:
#1658

@sdjordjevicTT sdjordjevicTT force-pushed the sdjordjevic/max_pool_2d_bf16_workaround branch from f3ec40c to f88de78 Compare December 23, 2024 17:28
private:
constexpr Env(bool maxpool2dPreshard, bool swapBinaryOperands,
bool readUpdateIndexFromDeviceForKVCache)
bool readUpdateIndexFromDeviceForKVCache, bool typecastOnHost)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe name this as toDtypeOnHost or something so that it's explicit that we're using to_dtype when typcasting on host.

Also please add a ttrt command line option to toggle this in runtime/tools/python/ttrt/common/run.py, the procedure will be the same as the other workaround flags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed typecastOnHost to toDtypeOnHost. I added an option in run.py; please double-check if I implemented it correctly.

@sdjordjevicTT sdjordjevicTT force-pushed the sdjordjevic/max_pool_2d_bf16_workaround branch from f88de78 to e320d04 Compare December 23, 2024 18:26
Copy link
Contributor

@jnie-TT jnie-TT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runtime changes look good, thanks Stefan!

Copy link
Contributor

@jserbedzijaTT jserbedzijaTT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks stefi!

lib/Dialect/TTNN/IR/TTNNWorkarounds.cpp Outdated Show resolved Hide resolved
@sdjordjevicTT sdjordjevicTT changed the title Adding bf16 data type workaround for max_pool2d op Adding bf16 data type workaround for max_pool2d op and fixing embedding workaround tests Dec 25, 2024
@sdjordjevicTT sdjordjevicTT force-pushed the sdjordjevic/max_pool_2d_bf16_workaround branch from e320d04 to 5ba32ac Compare December 26, 2024 09:57
@sdjordjevicTT sdjordjevicTT merged commit cfc6f53 into main Dec 26, 2024
21 checks passed
@sdjordjevicTT sdjordjevicTT deleted the sdjordjevic/max_pool_2d_bf16_workaround branch December 26, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle max_pool2d input dataformat float32
5 participants