Skip to content

Commit be5d7b2

Browse files
authored
Revert "Revert "Adapt to pending Enzyme breaking change"" (#94)
* Revert "Revert "Adapt to pending Enzyme breaking change (#92)" (#93)" This reverts commit 5e9b84b. * fix errors, bump Enzyme compat in test and run formatter * remove Enzyme compat bound in tests like Tapir
1 parent 5e9b84b commit be5d7b2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ChainRulesCore = "1.16"
4444
DiffResults = "1"
4545
Distributions = "0.25.111"
4646
DocStringExtensions = "0.8, 0.9"
47-
Enzyme = "0.12.32"
47+
Enzyme = "0.13"
4848
FillArrays = "1.3"
4949
ForwardDiff = "0.10.36"
5050
Functors = "0.4"

ext/AdvancedVIEnzymeExt.jl

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ end
1818
function AdvancedVI.value_and_gradient!(
1919
::ADTypes.AutoEnzyme, f, x::AbstractVector{<:Real}, out::DiffResults.MutableDiffResult
2020
)
21-
Enzyme.API.runtimeActivity!(true)
2221
∇x = DiffResults.gradient(out)
2322
fill!(∇x, zero(eltype(∇x)))
2423
_, y = Enzyme.autodiff(
25-
Enzyme.ReverseWithPrimal, Enzyme.Const(f), Enzyme.Active, Enzyme.Duplicated(x, ∇x)
24+
Enzyme.set_runtime_activity(Enzyme.ReverseWithPrimal, true),
25+
Enzyme.Const(f),
26+
Enzyme.Active,
27+
Enzyme.Duplicated(x, ∇x),
2628
)
2729
DiffResults.value!(out, y)
2830
return out
@@ -35,11 +37,10 @@ function AdvancedVI.value_and_gradient!(
3537
aux,
3638
out::DiffResults.MutableDiffResult,
3739
)
38-
Enzyme.API.runtimeActivity!(true)
3940
∇x = DiffResults.gradient(out)
4041
fill!(∇x, zero(eltype(∇x)))
4142
_, y = Enzyme.autodiff(
42-
Enzyme.ReverseWithPrimal,
43+
Enzyme.set_runtime_activity(Enzyme.ReverseWithPrimal, true),
4344
Enzyme.Const(f),
4445
Enzyme.Active,
4546
Enzyme.Duplicated(x, ∇x),

test/Project.toml

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Bijectors = "0.13"
2929
DiffResults = "1.0"
3030
Distributions = "0.25.111"
3131
DistributionsAD = "0.6.45"
32-
Enzyme = "0.12.32"
3332
FillArrays = "1.6.1"
3433
ForwardDiff = "0.10.36"
3534
Functors = "0.4.5"

0 commit comments

Comments
 (0)