Skip to content

Commit 5e9b84b

Browse files
authored
Revert "Adapt to pending Enzyme breaking change (#92)" (#93)
This reverts commit 9a2ae80.
1 parent 9a2ae80 commit 5e9b84b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
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.13"
47+
Enzyme = "0.12.32"
4848
FillArrays = "1.3"
4949
ForwardDiff = "0.10.36"
5050
Functors = "0.4"

ext/AdvancedVIEnzymeExt.jl

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ end
1818
function AdvancedVI.value_and_gradient!(
1919
::ADTypes.AutoEnzyme, f, x::AbstractVector{<:Real}, out::DiffResults.MutableDiffResult
2020
)
21+
Enzyme.API.runtimeActivity!(true)
2122
∇x = DiffResults.gradient(out)
2223
fill!(∇x, zero(eltype(∇x)))
2324
_, y = Enzyme.autodiff(
24-
Enzyme.set_runtime_activity(Enzyme.ReverseWithPrimal, true), Enzyme.Const(f), Enzyme.Active, Enzyme.Duplicated(x, ∇x)
25+
Enzyme.ReverseWithPrimal, Enzyme.Const(f), Enzyme.Active, Enzyme.Duplicated(x, ∇x)
2526
)
2627
DiffResults.value!(out, y)
2728
return out
@@ -34,10 +35,11 @@ function AdvancedVI.value_and_gradient!(
3435
aux,
3536
out::DiffResults.MutableDiffResult,
3637
)
38+
Enzyme.API.runtimeActivity!(true)
3739
∇x = DiffResults.gradient(out)
3840
fill!(∇x, zero(eltype(∇x)))
3941
_, y = Enzyme.autodiff(
40-
Enzyme.set_runtime_activity(Enzyme.ReverseWithPrimal, true)
42+
Enzyme.ReverseWithPrimal,
4143
Enzyme.Const(f),
4244
Enzyme.Active,
4345
Enzyme.Duplicated(x, ∇x),

0 commit comments

Comments
 (0)