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

[MLIR][TORCH] Add torch-onnx-to-torch-backend pipeline #3801

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

vivekkhandelwal1
Copy link
Collaborator

@vivekkhandelwal1 vivekkhandelwal1 commented Oct 17, 2024

This commit adds the torch-onnx-to-torch-backend pipeline which
converts the Torch Onnx IR to Torch Backend IR.

This commit also moves the ScalarizeShapes pass from the
torch-backend-to-linalg-on-tensors-backend-pipeline to the
torch-onnx-to-torch-backend pipeline since the primary goal of
this pass is to scalarize the shapes in the IR coming from the
Onnx models.

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.

Like we were discussing in the sync, I think since scalarize shapes is really onnx specific right now, we should only perform this pass in the onnx-to-torch pipeline.

lib/Dialect/Torch/Transforms/Passes.cpp Outdated Show resolved Hide resolved
@vivekkhandelwal1 vivekkhandelwal1 marked this pull request as ready for review October 18, 2024 13:05
@vivekkhandelwal1 vivekkhandelwal1 changed the title [WIP][MLIR][TORCH] Add torch-onnx-to-torch-backend pipeline [MLIR][TORCH] Add torch-onnx-to-torch-backend pipeline Oct 18, 2024
This commit adds the torch-onnx-to-torch-backend pipeline which
converts the Torch Onnx IR to Torch Backend IR.

This commit also moves the `ScalarizeShapes` pass from the
`torch-backend-to-linalg-on-tensors-backend-pipeline` to the
`torch-onnx-to-torch-backend` pipeline since the primary goal of
this pass is to scalarize the shapes in the IR coming from the
Onnx models.

Signed-Off By: Vivek Khandelwal <vivekkhandelwal1424@gmail.com>
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.

Nice, a few changes and I think we should be good to go.

lib/Dialect/Torch/Transforms/Passes.cpp Outdated Show resolved Hide resolved
lib/Dialect/Torch/Transforms/Passes.cpp Show resolved Hide resolved
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.

One last quick change (sorry for the back and forth), then I think this is good to go. Glad to see the CI green on this change.

lib/Dialect/Torch/Transforms/Passes.cpp Show resolved Hide resolved
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 think this is a good starting point. Let's get this in and iterate on the pipeline as the need arises.

@zjgarvey zjgarvey merged commit fa4794d into llvm:main Oct 21, 2024
3 checks passed
@vivekkhandelwal1 vivekkhandelwal1 deleted the onnx-torch-pipeline branch October 22, 2024 05:15
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.

2 participants