tenstorrent / tt-metal

:metal: TT-NN operator library, and TT-Metalium low level kernel programming model.
Apache License 2.0
475 stars 75 forks source link

2D -> 1D Reshape fails with ttnn::Reshape, but works by directly calling tensor.reshape #13159

Closed jnie-TT closed 1 month ago

jnie-TT commented 1 month ago

Describe the bug ttnn::Reshape doesn't work when squeezing the last dim of a 2D row major device tensor - getting error Unable to reshape given tensor!. However, directly calling tensor.reshape works.

To Reproduce This fails:

std::array<int32_t, 1> newShape = {32};
// Here tensor is a 32x1 row major single-device tensor
ttnn::reshape(tensor, newShape);

This works:

std::array<int32_t, 1> newShape = {32};
// Here tensor is a 32x1 row major single-device tensor
tensor.reshape(newShape);

cc: @AleksKnezevic @mrakitaTT

ntarafdar commented 1 month ago

solved here: https://github.com/tenstorrent/tt-metal/pull/13022 will merge soon

AleksKnezevic commented 1 month ago

Thanks for the quick fix @ntarafdar!!!

ntarafdar commented 1 month ago

merged in, I'm closing issue for now, feel free to re-open if main isn't still working for your case.