diff --git a/.dep-versions b/.dep-versions index afe00502e..2195172d1 100644 --- a/.dep-versions +++ b/.dep-versions @@ -2,7 +2,7 @@ jax=0.4.23 mhlo=4611968a5f6818e6bdfb82217b9e836e0400bba9 llvm=cd9a641613eddf25d4b25eaa96b2c393d401d42c -enzyme=1beb98b51442d50652eaa3ffb9574f4720d611f1 +enzyme=v0.0.130 # Always remove custom PL/LQ versions before release. pennylane=d90137dd8f6af46699653deda5f839c27701769f diff --git a/doc/changelog.md b/doc/changelog.md index 6d67cd5da..a2d620085 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -4,6 +4,9 @@

Improvements

+* Catalyst is now compatible with Enzyme `v0.0.130` + [(#898)](https://github.com/PennyLaneAI/catalyst/pull/898) + * Added support for the jax.numpy.argsort function so it works when compiled with qjit. [(#901)](https://github.com/PennyLaneAI/catalyst/pull/901) @@ -18,6 +21,9 @@ * The function `inactive_callback` was renamed `__catalyst_inactive_callback`. [(#899)](https://github.com/PennyLaneAI/catalyst/pull/899) +* The function `__catalyst_inactive_callback` has the nofree attribute. + [(#898)](https://github.com/PennyLaneAI/catalyst/pull/898) +

Contributors

This release contains contributions from (in alphabetical order): diff --git a/mlir/Enzyme b/mlir/Enzyme index 1beb98b51..b53704d21 160000 --- a/mlir/Enzyme +++ b/mlir/Enzyme @@ -1 +1 @@ -Subproject commit 1beb98b51442d50652eaa3ffb9574f4720d611f1 +Subproject commit b53704d21839b1e1e0af54d65471afc11cb6b9ee diff --git a/mlir/lib/Catalyst/Transforms/catalyst_to_llvm.cpp b/mlir/lib/Catalyst/Transforms/catalyst_to_llvm.cpp index 2b0ab6f63..3479be8fa 100644 --- a/mlir/lib/Catalyst/Transforms/catalyst_to_llvm.cpp +++ b/mlir/lib/Catalyst/Transforms/catalyst_to_llvm.cpp @@ -461,7 +461,10 @@ struct DefineCallbackOpPattern : public OpConversionPattern { LLVM::LLVMFuncOp customCallFnOp = mlir::LLVM::lookupOrCreateFn( mod, "__catalyst_inactive_callback", {/*args=*/i64, i64, i64}, /*ret_type=*/voidType, isVarArg); - + SmallVector passthroughs; + auto keyAttr = StringAttr::get(ctx, "nofree"); + passthroughs.push_back(keyAttr); + customCallFnOp.setPassthroughAttr(ArrayAttr::get(ctx, passthroughs)); // TODO: remove redundant alloca+store since ultimately we'll receive struct* for (auto arg : op.getArguments()) { Type structTy = typeConverter->convertType(arg.getType()); diff --git a/mlir/test/Catalyst/ConversionTest.mlir b/mlir/test/Catalyst/ConversionTest.mlir index 01c0c4d5e..975d4da59 100644 --- a/mlir/test/Catalyst/ConversionTest.mlir +++ b/mlir/test/Catalyst/ConversionTest.mlir @@ -134,6 +134,7 @@ module @test0 { // CHECK-LABEL: @test1 module @test1 { catalyst.callback @callback_1(memref, memref) attributes {argc = 1 : i64, id = 1 : i64, resc = 1 : i64} + // CHECK: __catalyst_inactive_callback(i64, i64, i64, ...) attributes {passthrough = ["nofree"]} // CHECK-LABEL: func.func private @foo( // CHECK-SAME: [[arg0:%.+]]: tensor // CHECK-SAME:)