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,14 @@ 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_ref = varinfo isa SimpleVarInfo{<: Any ,<: Ref }
44
+ is_svi_od_not_ref = is_svi_od && ! is_svi_ref
45
+ is_svi_vnv_not_ref = is_svi_vnv && ! is_svi_ref
42
46
43
47
# Mooncake doesn't work with several combinations of SimpleVarInfo.
44
48
if is_mooncake && is_1_11 && is_svi_vnv
@@ -52,6 +56,12 @@ using EnzymeCore: set_runtime_activity, Forward, Reverse
52
56
@test_throws Mooncake. MooncakeRuleCompilationError DynamicPPL. setadtype (
53
57
ref_ldf, adtype
54
58
)
59
+ elseif string (m. f) == " demo_dot_assume_dot_observe" &&
60
+ is_enzyme_reverse &&
61
+ (is_svi_od || is_svi_vnv_not_ref) &&
62
+ is_1_11
63
+ # TODO : report upstream, this segfaults
64
+ @test_broken false
55
65
else
56
66
ldf = DynamicPPL. setadtype (ref_ldf, adtype)
57
67
logp, grad = LogDensityProblems. logdensity_and_gradient (ldf, x)
0 commit comments