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

Fix ttnn.reallocate when unaligned RM tensors are used #16192

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

esmalTT
Copy link
Contributor

@esmalTT esmalTT commented Dec 19, 2024

Ticket

Problem description

Padding added in unaligned row-major tensors sizes was not being considered in the ttnn.move op, which is the underlying implementation for ttnn.reallocate.

This was causing issues in Stable Diffusion, since it uses unaligned RM tensors.

What's changed

  • Used aligned page size and shard buffer size
  • Refactor and re-enable tests that were previously disabled. Seems like they are working again.
  • Add new tests to cover RM tensors that have padding due to alignment

Checklist

@@ -18,7 +18,7 @@ void kernel_main() {
constexpr uint32_t src_cb_id = get_compile_time_arg_val(0);
constexpr uint32_t dst_cb_id = get_compile_time_arg_val(1);

uint32_t src_cb_base_addr = get_write_ptr(src_cb_id); // TODO change to read
uint32_t src_cb_base_addr = get_read_ptr(src_cb_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

love seeing TODOs being removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seemed like a low hanging one 🥲

Copy link
Contributor

@sjameelTT sjameelTT left a comment

Choose a reason for hiding this comment

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

Thanks a bunch Evan!

@esmalTT esmalTT force-pushed the esmal/fix-realloc-unaligned branch from 493a8c1 to 1f47b62 Compare December 19, 2024 20:01
@esmalTT esmalTT merged commit 936cac3 into main Dec 20, 2024
180 of 184 checks passed
@esmalTT esmalTT deleted the esmal/fix-realloc-unaligned branch December 20, 2024 00:05
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.

4 participants