1
1
using DynamicPPL: LogDensityFunction
2
2
using Enzyme: Enzyme
3
- using EnzymeCore: set_runtime_activity, Forward, Reverse
3
+ using EnzymeCore: set_runtime_activity, Forward, Reverse, ReverseMode
4
4
5
5
@testset verbose = true " Automatic differentiation" begin
6
6
@testset " Unsupported backends" begin
@@ -35,10 +35,13 @@ using EnzymeCore: set_runtime_activity, Forward, Reverse
35
35
36
36
# Put predicates here to avoid long lines
37
37
is_mooncake = adtype isa AutoMooncake
38
+ is_enzyme_reverse = adtype isa AutoEnzyme && adtype. mode isa ReverseMode
38
39
is_1_10 = v " 1.10" <= VERSION < v " 1.11"
39
40
is_1_11 = v " 1.11" <= VERSION < v " 1.12"
40
41
is_svi_vnv = varinfo isa SimpleVarInfo{<: DynamicPPL.VarNamedVector }
41
42
is_svi_od = varinfo isa SimpleVarInfo{<: OrderedDict }
43
+ is_svi_od_ref = varinfo isa SimpleVarInfo{<: OrderedDict ,<: Ref }
44
+ is_svi_od_not_ref = is_svi_od && ! is_svi_od_ref
42
45
43
46
# Mooncake doesn't work with several combinations of SimpleVarInfo.
44
47
if is_mooncake && is_1_11 && is_svi_vnv
@@ -52,6 +55,12 @@ using EnzymeCore: set_runtime_activity, Forward, Reverse
52
55
@test_throws Mooncake. MooncakeRuleCompilationError DynamicPPL. setadtype (
53
56
ref_ldf, adtype
54
57
)
58
+ elseif string (m. f) == " demo_dot_assume_dot_observe" &&
59
+ is_enzyme_reverse &&
60
+ is_svi_od_not_ref &&
61
+ is_1_11
62
+ # TODO : report upstream, this segfaults
63
+ @test_broken false
55
64
else
56
65
ldf = DynamicPPL. setadtype (ref_ldf, adtype)
57
66
logp, grad = LogDensityProblems. logdensity_and_gradient (ldf, x)
0 commit comments