diff --git a/HISTORY.md b/HISTORY.md index 9c85674c3..d946a12d2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # DynamicPPL Changelog +## 0.37.5 + +A minor optimisation for Enzyme AD on DynamicPPL models. + ## 0.37.4 An extension for MarginalLogDensities.jl has been added. diff --git a/Project.toml b/Project.toml index 51028b831..e636199a1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DynamicPPL" uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8" -version = "0.37.4" +version = "0.37.5" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/src/logdensityfunction.jl b/src/logdensityfunction.jl index 3b790576a..e5e6a6dae 100644 --- a/src/logdensityfunction.jl +++ b/src/logdensityfunction.jl @@ -350,6 +350,7 @@ closure approach will be used. By default, this function returns `false`, i.e. the constant approach will be used. """ use_closure(::ADTypes.AbstractADType) = true +use_closure(::ADTypes.AutoEnzyme) = false """ getmodel(f) diff --git a/test/integration/enzyme/main.jl b/test/integration/enzyme/main.jl index ea4ec497d..b40bbeb8f 100644 --- a/test/integration/enzyme/main.jl +++ b/test/integration/enzyme/main.jl @@ -6,10 +6,8 @@ import Enzyme: set_runtime_activity, Forward, Reverse, Const using ForwardDiff: ForwardDiff # run_ad uses FD for correctness test ADTYPES = Dict( - "EnzymeForward" => - AutoEnzyme(; mode=set_runtime_activity(Forward), function_annotation=Const), - "EnzymeReverse" => - AutoEnzyme(; mode=set_runtime_activity(Reverse), function_annotation=Const), + "EnzymeForward" => AutoEnzyme(; mode=set_runtime_activity(Forward)), + "EnzymeReverse" => AutoEnzyme(; mode=set_runtime_activity(Reverse)), ) @testset "$ad_key" for (ad_key, ad_type) in ADTYPES