Skip to content

Conversation

@paul0403
Copy link
Member

@paul0403 paul0403 commented Jul 17, 2025

Context:
Update llvm, mhlo and enzyme, 2025 Q3.
The latest pair of good versions, indicated by mhlo, is tensorflow/mlir-hlo@1dd2e71

mhlo=1dd2e71331014ae0373f6bf900ce6be393357190
llvm=f8cb7987c64dcffb72414a40560055cb717dbf74

For Enzyme, we go to the latest release https://github.com/EnzymeAD/Enzyme/releases/tag/v0.0.186

enzyme=v0.0.186

with commit 8c1a596158f6194f10e8ffd56a1660a61c54337e

Description of the Change:
Miscellaneous:

  1. GreedyRewriteConfig.stuff = blah -> GreedyRewriteConfig.setStuff(blah) [mlir] add a fluent API to GreedyRewriterConfig llvm/llvm-project#137122
  2. llvm gep op inbounds attribute is subsumed under a gep sign wrap enum flag [mlir][llvm] Support nusw and nuw in GEP llvm/llvm-project#137272
  3. arith::Constant[Int, Float]Op builders now have the same argument order as other ops (output type first, then arguments) switch type and value ordering for arith Constant[XX]Op llvm/llvm-project#144636 (note that Enzyme also noticed this Update to newer llvm EnzymeAD/Enzyme#2379 😆 )
  4. The lookupOrCreateFn functions now take in a builder instead of instantiating a new one [mlir][LLVM] Add OpBuilder & to lookupOrCreateFn functions llvm/llvm-project#136421
  5. getStridedElementPtr now takes in rewriter as the first argument (instead of the last), like all the other utils emit inbounds and nuw attributes in memref. llvm/llvm-project#138984
  6. The following functions now return a LogicalResult, and will be caught by warnings as errors as -Wunused-result:

Things related to transform.apply_registered_pass op:

  1. It now takes in a dynamic_options [MLIR][Transform] Allow ApplyRegisteredPassOp to take options as a param llvm/llvm-project#142683. We don't need to use this as all our pass options are static.
  2. The options it takes in are now dictionaries instead of strings [MLIR][Transform] apply_registered_pass op's options as a dict llvm/llvm-project#143159

Bufferization:

  1. bufferization.to_memref op is renamed to bufferization.to_buffer [mlir][bufferization][NFC] Rename to_memref to to_buffer llvm/llvm-project#137180
  2. bufferization.to_tensor op's builder now needs the result type to be explicit [mlir][bufferization] Support custom types (1/N) llvm/llvm-project#142986. This is also needed by a patched mhlo pass.
  3. The getBuffer() methods take in a new arg for BufferizationState [MLIR] Add bufferization state class to OneShotBufferization pass llvm/llvm-project#141019, [MLIR] Add bufferization state to getBufferType and resolveConflicts interface methods llvm/llvm-project#141466
  4. UnknownTypeConverterFn in bufferization options now takes in just a type instead of a full value [mlir][bufferization] Use Type instead of Value in unknown conversion llvm/llvm-project#144658

Related GitHub Issues:
[sc-95176]
[sc-95664]

@paul0403 paul0403 marked this pull request as ready for review July 17, 2025 20:55
@paul0403

This comment was marked as outdated.

@paul0403 paul0403 mentioned this pull request Jul 22, 2025
@paul0403

This comment was marked as outdated.

@paul0403 paul0403 added reviewer:require-wheels Pull Requests will need wheel building job successful before being merged author:build-wheels Run the wheel building workflows on this Pull Request labels Jul 26, 2025
@paul0403 paul0403 removed reviewer:require-wheels Pull Requests will need wheel building job successful before being merged author:build-wheels Run the wheel building workflows on this Pull Request labels Jul 26, 2025
@paul0403
Copy link
Member Author

@mehrdad2m @dime10 this is now completely ready

@paul0403 paul0403 added author:build-wheels Run the wheel building workflows on this Pull Request reviewer:require-wheels Pull Requests will need wheel building job successful before being merged labels Jul 28, 2025
@paul0403 paul0403 removed reviewer:require-wheels Pull Requests will need wheel building job successful before being merged author:build-wheels Run the wheel building workflows on this Pull Request labels Jul 28, 2025
Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Thanks @paul0403, just two points:

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

🚀

@paul0403 paul0403 merged commit 22824b6 into main Jul 28, 2025
42 checks passed
@paul0403 paul0403 deleted the llvm_update_2025Q3 branch July 28, 2025 20:08
github-merge-queue bot pushed a commit to PennyLaneAI/pennylane that referenced this pull request Aug 15, 2025
**Context:** Catalyst is updating LLVM, which includes a redefinition of
this operation in the transform dialect.
Note:
Only merge after PennyLaneAI/catalyst#1916

**Description of the Change:** Redefine the ApplyRegisteredPass in the
transform dialect to support Catalyst's generic format.

**Benefits:** 

**Possible Drawbacks:**

**Related GitHub Issues:**

[sc-96972]

---------

Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Mehrdad Malekmohammadi <[email protected]>
Co-authored-by: Mehrdad Malek <[email protected]>
github-merge-queue bot pushed a commit to PennyLaneAI/pennylane that referenced this pull request Aug 15, 2025
**Context:** Catalyst is updating LLVM, which includes a redefinition of
this operation in the transform dialect.
Note:
Only merge after PennyLaneAI/catalyst#1916

**Description of the Change:** Redefine the ApplyRegisteredPass in the
transform dialect to support Catalyst's generic format.

**Benefits:** 

**Possible Drawbacks:**

**Related GitHub Issues:**

[sc-96972]

---------

Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Mehrdad Malekmohammadi <[email protected]>
Co-authored-by: Mehrdad Malek <[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.

5 participants