Skip to content

Commit 405fdff

Browse files
committed
More test fixes
1 parent 0286756 commit 405fdff

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

ext/DynamicPPLEnzymeCoreExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using EnzymeCore
99
nothing
1010
# Likewise for get_range_and_linked.
1111
@inline EnzymeCore.EnzymeRules.inactive(
12-
::typeof(DynamicPPL.get_range_and_linked), args...
12+
::typeof(DynamicPPL.Experimental.get_range_and_linked), args...
1313
) = nothing
1414

1515
end

ext/DynamicPPLMooncakeExt.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
module DynamicPPLMooncakeExt
22

3-
using DynamicPPL: DynamicPPL, is_transformed, get_range_and_linked
3+
using DynamicPPL: DynamicPPL, is_transformed
44
using Mooncake: Mooncake
55

66
# This is purely an optimisation.
77
Mooncake.@zero_derivative Mooncake.DefaultCtx Tuple{typeof(is_transformed),Vararg}
8-
Mooncake.@zero_derivative Mooncake.DefaultCtx Tuple{typeof(get_range_and_linked),Vararg}
8+
Mooncake.@zero_derivative Mooncake.DefaultCtx Tuple{
9+
typeof(DynamicPPL.Experimental.get_range_and_linked),Vararg
10+
}
911

1012
end # module

test/fasteval.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,23 @@ using Distributions
55
using DistributionsAD: filldist
66
using ADTypes
77
using DynamicPPL.Experimental: FastLDF
8+
using DynamicPPL.TestUtils.AD: run_ad, WithExpectedResult, NoTest
9+
using Test
10+
11+
using ForwardDiff: ForwardDiff
12+
using ReverseDiff: ReverseDiff
13+
# Need to include this block here in case we run this test file standalone
14+
@static if VERSION < v"1.12"
15+
using Pkg
16+
Pkg.add("Mooncake")
17+
using Mooncake: Mooncake
18+
end
819

920
@testset "Automatic differentiation" begin
1021
# Used as the ground truth that others are compared against.
1122
ref_adtype = AutoForwardDiff()
1223

13-
test_adtypes = if MOONCAKE_SUPPORTED
24+
test_adtypes = @static if VERSION < v"1.12"
1425
[
1526
AutoReverseDiff(; compile=false),
1627
AutoReverseDiff(; compile=true),
@@ -20,11 +31,6 @@ using DynamicPPL.Experimental: FastLDF
2031
[AutoReverseDiff(; compile=false), AutoReverseDiff(; compile=true)]
2132
end
2233

23-
@testset "Unsupported backends" begin
24-
@model demo() = x ~ Normal()
25-
@test_logs (:warn, r"not officially supported") FastLDF(demo(); adtype=AutoZygote())
26-
end
27-
2834
@testset "Correctness" begin
2935
@testset "$(m.f)" for m in DynamicPPL.TestUtils.DEMO_MODELS
3036
varinfo = VarInfo(m)

0 commit comments

Comments
 (0)