Skip to content

Commit 409fc3b

Browse files
committed
Skip segfaulting model
1 parent cdbde76 commit 409fc3b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/ad.jl

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using DynamicPPL: LogDensityFunction
22
using Enzyme: Enzyme
3-
using EnzymeCore: set_runtime_activity, Forward, Reverse
3+
using EnzymeCore: set_runtime_activity, Forward, Reverse, ReverseMode
44

55
@testset verbose = true "Automatic differentiation" begin
66
@testset "Unsupported backends" begin
@@ -35,10 +35,14 @@ using EnzymeCore: set_runtime_activity, Forward, Reverse
3535

3636
# Put predicates here to avoid long lines
3737
is_mooncake = adtype isa AutoMooncake
38+
is_enzyme_reverse = adtype isa AutoEnzyme && adtype.mode isa ReverseMode
3839
is_1_10 = v"1.10" <= VERSION < v"1.11"
3940
is_1_11 = v"1.11" <= VERSION < v"1.12"
4041
is_svi_vnv = varinfo isa SimpleVarInfo{<:DynamicPPL.VarNamedVector}
4142
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
4246

4347
# Mooncake doesn't work with several combinations of SimpleVarInfo.
4448
if is_mooncake && is_1_11 && is_svi_vnv
@@ -52,6 +56,12 @@ using EnzymeCore: set_runtime_activity, Forward, Reverse
5256
@test_throws Mooncake.MooncakeRuleCompilationError DynamicPPL.setadtype(
5357
ref_ldf, adtype
5458
)
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
5565
else
5666
ldf = DynamicPPL.setadtype(ref_ldf, adtype)
5767
logp, grad = LogDensityProblems.logdensity_and_gradient(ldf, x)

0 commit comments

Comments
 (0)