Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
DynamicPPL = "0.36"
DynamicPPL = "0.37"
Turing = "0.40"
28 changes: 13 additions & 15 deletions main.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DynamicPPL: DynamicPPL, VarInfo
using DynamicPPL.TestUtils.AD: run_ad, ADResult, ADIncorrectException
using DynamicPPL.TestUtils.AD: run_ad, ADResult, ADIncorrectException, WithBackend
using ADTypes
using Random: Xoshiro

Expand All @@ -12,13 +12,14 @@ import Zygote

# AD backends to test.
ADTYPES = Dict(
"FiniteDifferences" => AutoFiniteDifferences(; fdm = central_fdm(5, 1)),
"FiniteDifferences" => AutoFiniteDifferences(; fdm=central_fdm(5, 1)),
"ForwardDiff" => AutoForwardDiff(),
"ReverseDiff" => AutoReverseDiff(; compile = false),
"ReverseDiffCompiled" => AutoReverseDiff(; compile = true),
"Mooncake" => AutoMooncake(; config = nothing),
"EnzymeForward" => AutoEnzyme(; mode = set_runtime_activity(Forward, true)),
"EnzymeReverse" => AutoEnzyme(; mode = set_runtime_activity(Reverse, true)),
"ReverseDiff" => AutoReverseDiff(; compile=false),
"ReverseDiffCompiled" => AutoReverseDiff(; compile=true),
"MooncakeReverse" => AutoMooncake(),
"MooncakeForward" => AutoMooncakeForward(),
"EnzymeForward" => AutoEnzyme(; mode=set_runtime_activity(Forward, true)),
"EnzymeReverse" => AutoEnzyme(; mode=set_runtime_activity(Reverse, true)),
"Zygote" => AutoZygote(),
)

Expand Down Expand Up @@ -132,21 +133,18 @@ elseif length(ARGS) == 3 && ARGS[1] == "--run"
# https://github.com/TuringLang/ADTests/issues/4
vi = DynamicPPL.unflatten(VarInfo(model), [0.5, -0.5])
params = [-0.5, 0.5]
result = run_ad(model, adtype; varinfo = vi, params = params, benchmark = true)
result = run_ad(model, adtype; varinfo=vi, params=params, test=WithBackend(ADTYPES["FiniteDifferences"]), benchmark=true)
else
vi = VarInfo(Xoshiro(468), model)
linked_vi = DynamicPPL.link!!(vi, model)
params = linked_vi[:]
result = run_ad(
model,
adtype;
params = params,
reference_adtype = ADTYPES["FiniteDifferences"],
benchmark = true,
rng=Xoshiro(468),
test=WithBackend(ADTYPES["FiniteDifferences"]),
benchmark=true,
)
end
# If reached here - nothing went wrong
println(result.time_vs_primal)
println(result.grad_time / result.primal_time)
catch e
@show e
if e isa ADIncorrectException
Expand Down
11 changes: 11 additions & 0 deletions web/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@
>Download the raw data (JSON)</a
>
</p>

<p>
<b>Note about Enzyme:</b> Enzyme does not work with DynamicPPL 0.37
/ Turing 0.40 because of
<a
href="https://github.com/EnzymeAD/Enzyme.jl/issues/2429"
target="_blank">this issue</a
>. If you want to use Enzyme with Turing, please use an older
version of Turing / DynamicPPL.
</p>

{#each categorisedData.entries() as [category, modelData]}
<h3>{category}</h3>
<ResultsTable data={modelData} {modelDefinitions} />
Expand Down
Loading