Skip to content

Implement linalg lowering of diag_embed torch op - #2885

Merged
newling merged 12 commits into
llvm:mainfrom
schnkmwt:sachink.implement_diag_embed_op
Mar 22, 2024
Merged

Implement linalg lowering of diag_embed torch op#2885
newling merged 12 commits into
llvm:mainfrom
schnkmwt:sachink.implement_diag_embed_op

Conversation

@schnkmwt

@schnkmwt schnkmwt commented Feb 7, 2024

Copy link
Copy Markdown
Contributor

This PR adds lowering of diag_embed to linalg dilect.
Tracked in nod-ai/AMD-SHARK-ModelDev#288

@ramiro050 ramiro050 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! Looks mostly good, I just have a few comments

Comment thread include/torch-mlir/Conversion/Utils/Utils.h Outdated
Comment thread lib/Conversion/Utils/Utils.cpp Outdated
Comment thread lib/Conversion/Utils/Utils.cpp Outdated
Comment thread lib/Conversion/Utils/Utils.cpp Outdated
@kumardeepakamd
kumardeepakamd self-requested a review February 8, 2024 05:35

@newling newling left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm still trying to understand how the indexing works. Test coverage looks good, and the comments are useful. Nice one!

Comment thread lib/Conversion/TorchToLinalg/DataMovement.cpp Outdated
Comment thread lib/Conversion/TorchToLinalg/DataMovement.cpp
@ramiro050

Copy link
Copy Markdown
Collaborator

Not sure if you're manually making the lint fixes, but you can use git clang-format to automatically format the changes.

git clang-format main

formats your entire branch. If you don't have git clang-format, you should be able to do inside torch-mlir/

./externals/llvm-project/clang/tools/clang-format/git-clang-format main

@schnkmwt

Copy link
Copy Markdown
Contributor Author

Not sure if you're manually making the lint fixes, but you can use git clang-format to automatically format the changes.

git clang-format main

formats your entire branch. If you don't have git clang-format, you should be able to do inside torch-mlir/

./externals/llvm-project/clang/tools/clang-format/git-clang-format main

For some reason git clang-format main did not work for me. I guess it only works on most recent commit. But the git-clang-format under ./externals worked like a charm! Thanks for the suggestion.

@ramiro050 ramiro050 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, I think you need to XFAIL your tests on the ONNX backend

@schnkmwt

Copy link
Copy Markdown
Contributor Author

LGTM, I think you need to XFAIL your tests on the ONNX backend

Yes just pushed that. Got help from discord!

@schnkmwt
schnkmwt requested a review from newling March 22, 2024 02:10
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