Skip to content

Commit

Permalink
Skip segfaulting model
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Feb 16, 2025
1 parent cdbde76 commit 570b493
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/ad.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using DynamicPPL: LogDensityFunction
using Enzyme: Enzyme
using EnzymeCore: set_runtime_activity, Forward, Reverse
using EnzymeCore: set_runtime_activity, Forward, Reverse, ReverseMode

@testset verbose = true "Automatic differentiation" begin
@testset "Unsupported backends" begin
Expand Down Expand Up @@ -35,10 +35,13 @@ using EnzymeCore: set_runtime_activity, Forward, Reverse

# Put predicates here to avoid long lines
is_mooncake = adtype isa AutoMooncake
is_enzyme_reverse = adtype isa AutoEnzyme && adtype.mode isa ReverseMode
is_1_10 = v"1.10" <= VERSION < v"1.11"
is_1_11 = v"1.11" <= VERSION < v"1.12"
is_svi_vnv = varinfo isa SimpleVarInfo{<:DynamicPPL.VarNamedVector}
is_svi_od = varinfo isa SimpleVarInfo{<:OrderedDict}
is_svi_od_ref = varinfo isa SimpleVarInfo{<:OrderedDict,<:Ref}
is_svi_od_not_ref = is_svi_od && !is_svi_od_ref

# Mooncake doesn't work with several combinations of SimpleVarInfo.
if is_mooncake && is_1_11 && is_svi_vnv
Expand All @@ -52,6 +55,12 @@ using EnzymeCore: set_runtime_activity, Forward, Reverse
@test_throws Mooncake.MooncakeRuleCompilationError DynamicPPL.setadtype(
ref_ldf, adtype
)
elseif string(m.f) == "demo_dot_assume_dot_observe" &&
is_enzyme_reverse &&
is_svi_od_not_ref &&
is_1_11
# TODO: report upstream, this segfaults
@test_broken false
else
ldf = DynamicPPL.setadtype(ref_ldf, adtype)
logp, grad = LogDensityProblems.logdensity_and_gradient(ldf, x)
Expand Down

0 comments on commit 570b493

Please sign in to comment.