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

Handle torch.none type in tosa.clamp op #2739

Merged
merged 3 commits into from
Jan 11, 2024
Merged

Conversation

zezhang
Copy link
Collaborator

@zezhang zezhang commented Jan 9, 2024

This PR updates the torch-to-tosa conversion with following changes:

  • Support torch.none as min/max input argument for tosa.clamp op
  • Support negative value as start index for tosa.slice op
  • Add tosa.logical_or lowering support

e2e test:
python -m e2e_testing.main --config=tosa

LIT tests:
cmake --build build --target tools/torch-mlir/all

@zezhang zezhang requested a review from navahgar January 10, 2024 00:03
Copy link
Collaborator

@navahgar navahgar left a comment

Choose a reason for hiding this comment

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

Mostly LGTM. One comment regarding refactoring below.

lib/Conversion/TorchToTosa/TorchToTosa.cpp Outdated Show resolved Hide resolved
@navahgar
Copy link
Collaborator

Can you also update the PR title to be more clear? You can even make the title just about handling none in clamp, since that is the biggest change. Then, you can add the other two in the PR description.

@zezhang zezhang changed the title Torch-To-Tosa Misc. Update Handle torch.none type in tosa.clamp op Jan 10, 2024
@zezhang zezhang requested a review from navahgar January 10, 2024 21:25
@navahgar navahgar requested a review from ramiro050 January 10, 2024 23:32
Copy link
Collaborator

@navahgar navahgar left a comment

Choose a reason for hiding this comment

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

LGTM.

@ramiro050, @sjarus - in case you have any other comments here.

@navahgar navahgar requested a review from sjarus January 10, 2024 23:34
lib/Conversion/TorchToTosa/TorchToTosa.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToTosa/TorchToTosa.cpp Show resolved Hide resolved
lib/Conversion/TorchToTosa/TorchToTosa.cpp Outdated Show resolved Hide resolved
@zezhang zezhang requested a review from ramiro050 January 11, 2024 04:56
Copy link
Collaborator

@ramiro050 ramiro050 left a comment

Choose a reason for hiding this comment

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

Thanks!

@zezhang zezhang merged commit 670a99a into llvm:main Jan 11, 2024
5 checks passed
@zezhang zezhang deleted the zezhang/tosa_misc branch January 11, 2024 18:36
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