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

Integrate LLVM at e2402615a5a76d46a433dfcc1de10b38a1263c9d #3982

Merged
merged 8 commits into from
Jan 28, 2025

Conversation

vivekkhandelwal1
Copy link
Collaborator

@vivekkhandelwal1 vivekkhandelwal1 commented Jan 24, 2025

Update LLVM to
llvm/llvm-project@e240261
Update StableHlo to
openxla/stablehlo@8cd9444

Updates API calls from:

  1. applyPatternsAndFoldGreedily -> applyPatternsGreedily
  2. applyOpPatternsAndFold -> applyOpPatternsGreedily

This commit also inlines the BufferizeTypeConverter in Torch-MLIR
which has been removed from the LLVM project here:
llvm/llvm-project@2ff2e87.

This commit also updates the AdjustCallingConventions pass in order to
align with the changes made for TypeConverter upstream. Some of the
tests from the adjust-calling-conventions.mlir are disabled for the
time being since they are not supported even after making changes in the
pass. We will enable them once the AdjustCallingConventions pass is
fully functional in a seperate PR. The fix will be tracked by
#3983.

TOSA Updates Summary:

Update Torch to TOSA legalizations with TOSA 1.0 ops' forms from LLVM
hash 64edde66. Changes include:

TOSA Pad op's new shape requirement
TOSA Convolution ops' new acc_type
TOSA Tile with multiples as a !tosa.shape input


Signed-off-by: Vivek Khandelwal [email protected]
Co-authored-by: Justin Ngo [email protected]

vivekkhandelwal1 and others added 7 commits January 24, 2025 19:42
Integrate LLVM at e2402615a5a76d46a433dfcc1de10b38a1263c9d
Integrate StabelHLO at 8cd9444b78ccec3e42a4b21105a5a547c021e823
* TOSA 1.0 spec has a new pad shape for tosa.pad:
  https://www.mlplatform.org/tosa/tosa_spec.html#_pad
* Update Torch to TOSA legalization for aten.constant_pad_nd according
  to the new shape in TOSA spec
* Add new LIT test

Signed-off-by: Justin Ngo <[email protected]>
Change-Id: Id92eb342b7fbdb67c564acddb92c01eaf2e7b95a
* TOSA conv ops have a new acc_type attribute in TOSA 1.0 spec:
  https://www.mlplatform.org/tosa/tosa_spec.html#_conv2d
* Add this new acc_type attribute to TOSA conv ops for aten.convolution
  legalization from Torch to TOSA
* Add new LIT tests

Signed-off-by: Justin Ngo <[email protected]>
Change-Id: Ie32b4879d1e6070a9fd20b0aa04a54d79c025018
* Update tosa.tile with 'multiples' as an input of !tosa.shape instead
  of as an attribute. This is in alignment with TOSA 1.0 spec:
  https://www.mlplatform.org/tosa/tosa_spec.html#_tile
* Add a temporary getTosaConstShape() function in TosaLegalizeUtils.h.
  This function will be removed when the permanent getTosaConstShape()
function is available in mlir/include/mlir/Dialect/Tosa/Utils/ConversionUtils.h
in a future LLVM bump in Torch-MLIR.
* Update LIT tests

Signed-off-by: Justin Ngo <[email protected]>
Change-Id: I8c45160331d79e29b3df68cd74ad3bbd1b5a8042
nirvedhmeshram pushed a commit to iree-org/torch-mlir that referenced this pull request Jan 24, 2025
nirvedhmeshram added a commit to iree-org/iree that referenced this pull request Jan 25, 2025
There are no llvm reverts/cherry-picks.

Bump llvm to
llvm/llvm-project@95d993a

Bumps stablehlo to
openxla/stablehlo@c27ba67

torch-mlir carries forward fixes from
llvm/torch-mlir#3982
Additional forward fixes at
iree-org/torch-mlir@fd34bc5

Some C++ API changes to `getStridesAndOffset` from
llvm/llvm-project#123465

---------

Signed-off-by: Nirvedh Meshram <[email protected]>
@vivekkhandelwal1 vivekkhandelwal1 marked this pull request as ready for review January 27, 2025 15:16
Copy link
Collaborator

@nirvedhmeshram nirvedhmeshram left a comment

Choose a reason for hiding this comment

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

LGTM

@nirvedhmeshram nirvedhmeshram changed the title [WIP] Integrate LLVM at e2402615a5a76d46a433dfcc1de10b38a1263c9d Integrate LLVM at e2402615a5a76d46a433dfcc1de10b38a1263c9d Jan 27, 2025
Copy link
Collaborator

@sjarus sjarus left a comment

Choose a reason for hiding this comment

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

Thanks so much for the collaboration on this LLVM integration!

@vivekkhandelwal1 vivekkhandelwal1 merged commit 1225073 into llvm:main Jan 28, 2025
3 checks passed
@vivekkhandelwal1 vivekkhandelwal1 deleted the bump-llvm branch January 28, 2025 05:03
ita9naiwa pushed a commit to ita9naiwa/iree that referenced this pull request Feb 4, 2025
There are no llvm reverts/cherry-picks.

Bump llvm to
llvm/llvm-project@95d993a

Bumps stablehlo to
openxla/stablehlo@c27ba67

torch-mlir carries forward fixes from
llvm/torch-mlir#3982
Additional forward fixes at
iree-org/torch-mlir@fd34bc5

Some C++ API changes to `getStridesAndOffset` from
llvm/llvm-project#123465

---------

Signed-off-by: Nirvedh Meshram <[email protected]>
Signed-off-by: Hyunsung Lee <[email protected]>
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.

4 participants