File tree Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
19
19
LogDensityProblems = " 6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
20
20
MCMCChains = " c7f686f2-ff18-58e9-bc7b-31028e88f75d"
21
21
MacroTools = " 1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
22
- Mooncake = " da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
23
22
OrderedCollections = " bac558e1-5e72-5ebc-8fee-abe8a469f55d"
24
23
Pkg = " 44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
25
24
Random = " 9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -29,6 +28,9 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
29
28
Test = " 8dfed614-e22c-5e08-85e1-65c5234f0b40"
30
29
Zygote = " e88e6eb3-aa80-5325-afca-941959d7151f"
31
30
31
+ [weakdeps ]
32
+ Mooncake = " da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
33
+
32
34
[compat ]
33
35
ADTypes = " 1"
34
36
AbstractMCMC = " 5"
Original file line number Diff line number Diff line change @@ -3,11 +3,16 @@ using DynamicPPL: LogDensityFunction
3
3
@testset " Automatic differentiation" begin
4
4
# Used as the ground truth that others are compared against.
5
5
ref_adtype = AutoForwardDiff ()
6
- test_adtypes = [
7
- AutoReverseDiff (; compile= false ),
8
- AutoReverseDiff (; compile= true ),
9
- AutoMooncake (; config= nothing ),
10
- ]
6
+
7
+ test_adtypes = if IS_PRERELEASE
8
+ [AutoReverseDiff (; compile= false ), AutoReverseDiff (; compile= true )]
9
+ else
10
+ [
11
+ AutoReverseDiff (; compile= false ),
12
+ AutoReverseDiff (; compile= true ),
13
+ AutoMooncake (; config= nothing ),
14
+ ]
15
+ end
11
16
12
17
@testset " Unsupported backends" begin
13
18
@model demo () = x ~ Normal ()
@@ -16,7 +21,7 @@ using DynamicPPL: LogDensityFunction
16
21
)
17
22
end
18
23
19
- @testset " Correctness: ForwardDiff, ReverseDiff, and Mooncake " begin
24
+ @testset " Correctness" begin
20
25
@testset " $(m. f) " for m in DynamicPPL. TestUtils. DEMO_MODELS
21
26
rand_param_values = DynamicPPL. TestUtils. rand_prior_true (m)
22
27
vns = DynamicPPL. TestUtils. varnames (m)
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ using ForwardDiff
12
12
using LogDensityProblems
13
13
using MacroTools
14
14
using MCMCChains
15
- using Mooncake: Mooncake
16
15
using StableRNGs
17
16
using ReverseDiff
18
17
using Zygote
@@ -40,6 +39,15 @@ Random.seed!(100)
40
39
41
40
include (" test_util.jl" )
42
41
42
+ # Don't attempt to import Mooncake on 1.12
43
+ # https://github.com/chalk-lab/Mooncake.jl/pull/545
44
+ IS_PRERELEASE = VERSION >= v " 1.12"
45
+
46
+ if ! IS_PRERELEASE
47
+ Pkg. add (" Mooncake" )
48
+ using Mooncake: Mooncake
49
+ end
50
+
43
51
@testset verbose = true " DynamicPPL.jl" begin
44
52
# The tests are split into two groups so that CI can run in parallel. The
45
53
# groups are chosen to make both groups take roughly the same amount of
@@ -80,7 +88,9 @@ include("test_util.jl")
80
88
end
81
89
@testset " ad" begin
82
90
include (" ext/DynamicPPLForwardDiffExt.jl" )
83
- include (" ext/DynamicPPLMooncakeExt.jl" )
91
+ if ! IS_PRERELEASE
92
+ include (" ext/DynamicPPLMooncakeExt.jl" )
93
+ end
84
94
include (" ad.jl" )
85
95
end
86
96
@testset " prob and logprob macro" begin
You can’t perform that action at this time.
0 commit comments