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

[Tcp] Add lowering from Torch to Tcp for tanh, add, and broadcast ops + Enable e2e tests for Tcp #1695

Merged
merged 6 commits into from
Dec 12, 2022

Conversation

navahgar
Copy link
Collaborator

@navahgar navahgar commented Dec 8, 2022

This PR is a follow up to #1595. It adds the following:

  • Updates parallel iterator types to use the new enum in TcpToLinalg
  • Adds Torch to Tcp pass
  • Enables Tcp to Linalg conversion pass when TORCH_MLIR_ENABLE_TCP is set
  • Adds Torch backend to Tcp backend conversion pipeline
  • Adds e2e test for Tcp
  • Updates docker script to enable Tcp and its e2e tests.

Each of the above are added as separate commits for easy reviewing.

@silvasean silvasean requested review from sjarus and removed request for silvasean December 8, 2022 12:13
@silvasean
Copy link
Contributor

Hey folks, I don't really have the bandwidth to participate in detailed code design or review, so I will let you folks iterate on the branch. Let me know if you need any help with Torch-MLIR integration/etc.

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.

LGTM! I just have minor comments

lib/Conversion/TorchToTcp/Elementwise.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToTcp/Elementwise.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToTcp/Elementwise.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToTcp/Elementwise.cpp Show resolved Hide resolved
lib/Conversion/TorchToTcp/Elementwise.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToTcp/Utils.cpp Outdated Show resolved Hide resolved
lib/Dialect/TorchConversion/Transforms/Passes.cpp Outdated Show resolved Hide resolved
lib/Dialect/TorchConversion/Transforms/Passes.cpp Outdated Show resolved Hide resolved
Comment on lines +21 to +24
"""Base class for TestConfig's that are implemented with linalg-on-tensors.

This class handles all the common lowering that torch-mlir does before
reaching the linalg-on-tensors abstraction level.
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think linalg-on-tensors should be tcp

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure what you are referring to here. This is very similar to MhloBackendTestConfig and TosaBackendTestConfig IIUC.

test/Conversion/TorchToTcp/elementwise.mlir Outdated Show resolved Hide resolved
@navahgar
Copy link
Collaborator Author

LGTM! I just have minor comments

Thanks a lot for the review. That is very helpful.

@navahgar navahgar merged commit 34fa4e0 into llvm:mlir-tcp Dec 12, 2022
@navahgar navahgar deleted the torch-tcp-elementwise branch December 12, 2022 22:18
navahgar added a commit that referenced this pull request Dec 12, 2022
… + Enable e2e tests for Tcp (#1695)

* [Tcp] Update parallel iterator types to use the new enum in TcpToLinalg

* [Tcp] Add torch-to-tcp pass

* [Tcp] Enable Tcp to Linalg conversion pass when TORCH_MLIR_ENABLE_TCP is set

* [Tcp] Add torch backend to tcp backend conversion pipeline

* [Tcp] Add e2e test for TCP

* [Tcp] Update docker script to enable TCP and its e2e tests
navahgar added a commit that referenced this pull request Jan 5, 2023
… + Enable e2e tests for Tcp (#1695)

* [Tcp] Update parallel iterator types to use the new enum in TcpToLinalg

* [Tcp] Add torch-to-tcp pass

* [Tcp] Enable Tcp to Linalg conversion pass when TORCH_MLIR_ENABLE_TCP is set

* [Tcp] Add torch backend to tcp backend conversion pipeline

* [Tcp] Add e2e test for TCP

* [Tcp] Update docker script to enable TCP and its e2e tests
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