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

[TorchToLinalg] Use linalg.transpose instead of generic in permuteTensor #3872

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

CoTinker
Copy link
Contributor

This PR changes the lowering to use linalg.transpose instead of linalg.generic in torch_to_linalg::permuteTensor.

…teTensor``

This PR changes the lowering to use `linalg.transpose` instead of `linalg.generic` in `torch_to_linalg::permuteTensor`.
@CoTinker CoTinker changed the title [TorchToLinalg] Use linalg.transpose instead of generic in permuteTensor` [TorchToLinalg] Use linalg.transpose instead of generic in permuteTensor Nov 14, 2024
Copy link
Member

@ubfx ubfx left a comment

Choose a reason for hiding this comment

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

I think this makes sense, but there seems to be a problem with 0D-tensors in the e2e tests?

@CoTinker
Copy link
Contributor Author

I'll take a look at it.

Copy link
Collaborator

@vivekkhandelwal1 vivekkhandelwal1 left a comment

Choose a reason for hiding this comment

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

You need to add a check for the zero-ranked input. Rest all looks fine.

@CoTinker
Copy link
Contributor Author

I wonder if we should add a folder for aten.permute with 0-D input.

@vivekkhandelwal1
Copy link
Collaborator

I wonder if we should add a folder for aten.permute with 0-D input.

Yeah, that's a nice thing to do. You may do it in the same PR or in another one as you wish.

Copy link
Collaborator

@vivekkhandelwal1 vivekkhandelwal1 left a comment

Choose a reason for hiding this comment

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

LGTM

@CoTinker
Copy link
Contributor Author

Thanks, I think it's better to open another PR for the folder.

@CoTinker CoTinker merged commit 0a607a4 into llvm:main Nov 15, 2024
3 checks passed
@CoTinker CoTinker deleted the permute branch November 15, 2024 09:13
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.

3 participants