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 when lowering aten.T #3660

Merged
merged 2 commits into from
Sep 7, 2024

Conversation

ubfx
Copy link
Member

@ubfx ubfx commented Aug 22, 2024

The lowering pattern for aten.T uses transposition implemented via linalg.generic. For downstream passes it is advantageous to use named ops wherever possible, so this patch changes the lowering to use linalg.transpose instead.

The lowering pattern for `aten.T` uses transposition implemented via
`linalg.generic`. For downstream passes it is advantageous to use named
ops wherever possible, so this patch changes the lowering to use
`linalg.transpose` instead.
@ubfx ubfx requested review from silvasean and renxida August 22, 2024 16:13
@ubfx ubfx changed the title [TorchToLinalg] Use named transpose Op instead of generic [TorchToLinalg] Use linalg.transpose instead of generic when lowering aten.T Aug 22, 2024
@ubfx ubfx requested a review from zjgarvey August 26, 2024 18:18
@CoTinker
Copy link
Contributor

Can you add some testcases.

Copy link
Collaborator

@zjgarvey zjgarvey left a comment

Choose a reason for hiding this comment

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

I'm not sure why we weren't using the named op to begin with. Thanks!

A lit test might be nice to add like the other person mentioned, but it passes e2e tests, so I'll give the approval and leave it up to you whether to add it or not.

@ubfx ubfx merged commit df6098e into llvm:main Sep 7, 2024
3 checks passed
@ubfx ubfx deleted the transpose-linalg-named branch September 8, 2024 18:46
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