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

Convert aten.reshape to ttnn.reshape #190

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Convert aten.reshape to ttnn.reshape #190

wants to merge 2 commits into from

Conversation

jdh8
Copy link
Collaborator

@jdh8 jdh8 commented Sep 12, 2024

Ticket

Problem description

Successfully convert aten.reshape to ttnn.reshape

This PR paves the way for #148, too.

What's changed

  • Convert aten.reshape to ttnn.reshape
  • Convert aten.view to ttnn.reshape
  • Test conversion from torch.reshape to ttnn.reshape

@ayerofieiev-tt
Copy link
Member

@ayerofieiev-tt
Copy link
Member

Fails during models test

path passed error xfailed subtotal
models/perceiver_io/test_perceiver_io.py 🟢 🔴 2
models/resnet/test_resnet.py 🟢 🔴 2
models/resnet50/test_resnet50.py 🟢 🔴 2
models/roberta/test_roberta.py 🟢 🔴 2
TOTAL 4 1 3 8

@jdh8
Copy link
Collaborator Author

jdh8 commented Sep 12, 2024

I just ran pytest tests/models/resnet/test_resnet.py locally and got one error as well. However, the error message was rather wordy. Is there a way to extract failing input variations?

@ayerofieiev-tt
Copy link
Member

@jdh8 can you check this?
Tensor<[1, 512, 1, 1]> self = ?, List[int]<> size = [1, 512]

@ayerofieiev-tt
Copy link
Member

Keep in mind that right now compiler Tilizes tensors before most TT-NN operations.
After the op is tilized you can't reshape it to random shape - two last dims have to be divisible by tile size (32x32).
If it is divisible - you can proceed with it, but else you have to move to RowMajor and then reshape

@pytest.mark.parametrize(
"input_shape, new_shape",
[((3 * 5, 7), (7 * 3, 5))],
(((3 * 5, 7), (7 * 3, 5)), ((1, 512, 1, 1), (1, 512))),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This case passes on its own. Maybe we need to check the next op or the synergy between reshape and the next op?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aten.view not converted?
2 participants