Skip to content

Commit 5cab7dd

Browse files
committed
Don't test Mooncake on 1.12
1 parent b0ff259 commit 5cab7dd

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

test/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1919
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
2020
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d"
2121
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
22-
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
2322
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
2423
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
2524
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -29,6 +28,9 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
2928
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3029
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
3130

31+
[weakdeps]
32+
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
33+
3234
[compat]
3335
ADTypes = "1"
3436
AbstractMCMC = "5"

test/ad.jl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ using DynamicPPL: LogDensityFunction
33
@testset "Automatic differentiation" begin
44
# Used as the ground truth that others are compared against.
55
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
1116

1217
@testset "Unsupported backends" begin
1318
@model demo() = x ~ Normal()
@@ -16,7 +21,7 @@ using DynamicPPL: LogDensityFunction
1621
)
1722
end
1823

19-
@testset "Correctness: ForwardDiff, ReverseDiff, and Mooncake" begin
24+
@testset "Correctness" begin
2025
@testset "$(m.f)" for m in DynamicPPL.TestUtils.DEMO_MODELS
2126
rand_param_values = DynamicPPL.TestUtils.rand_prior_true(m)
2227
vns = DynamicPPL.TestUtils.varnames(m)

test/runtests.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ using ForwardDiff
1212
using LogDensityProblems
1313
using MacroTools
1414
using MCMCChains
15-
using Mooncake: Mooncake
1615
using StableRNGs
1716
using ReverseDiff
1817
using Zygote
@@ -40,6 +39,15 @@ Random.seed!(100)
4039

4140
include("test_util.jl")
4241

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+
4351
@testset verbose = true "DynamicPPL.jl" begin
4452
# The tests are split into two groups so that CI can run in parallel. The
4553
# groups are chosen to make both groups take roughly the same amount of
@@ -81,7 +89,9 @@ include("test_util.jl")
8189
end
8290
@testset "ad" begin
8391
include("ext/DynamicPPLForwardDiffExt.jl")
84-
include("ext/DynamicPPLMooncakeExt.jl")
92+
if !IS_PRERELEASE
93+
include("ext/DynamicPPLMooncakeExt.jl")
94+
end
8595
include("ad.jl")
8696
end
8797
@testset "prob and logprob macro" begin

0 commit comments

Comments
 (0)