Commit a78f433
Add the TuringLang/ADTests AD benchmark suite (#1624)
* AutomaticDifferentiationTuring: port the TuringLang/ADTests AD benchmark
Adds benchmarks/AutomaticDifferentiationTuring, a port of
https://github.com/TuringLang/ADTests (results published at
https://turinglang.org/ADTests/) into the SciMLBenchmarks suite.
The benchmark differentiates the log density of 62 Turing.jl models with all
8 AD backends Turing supports, checking each gradient against FiniteDifferences
and reporting the gradient/primal time ratio. The models cover base Julia
control flow and threading, the corners of the @model DSL, individual
distributions, the DynamicPPL arXiv paper models, PosteriorDB posteriors, and
models calling into OrdinaryDiffEq, DelayDiffEq, Lux, and AbstractGPs, so it
exercises far more of the Julia language than the existing AD benchmarks do.
Each model is benchmarked in its own worker process. Enzyme can segfault on
some of these models, and a crash must not lose the results already collected,
so the parent restarts the worker with the backends that have not run yet and
records the offending one as a crash.
This lives in its own folder rather than in AutomaticDifferentiation because
the Turing stack pins DynamicPPL/Turing tightly enough that sharing a Manifest
with the existing AD benchmarks risks constraining them.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8qBZzvd4yxfDYs7v8WDqE
* Flush stderr after each progress message
Julia buffers stderr when it is a file, while the worker subprocesses write to
the inherited descriptor directly, so the progress log arrived hours after the
worker output it was meant to label.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8qBZzvd4yxfDYs7v8WDqE
* Show AD cost against model dimension instead of a coverage bar chart
The coverage bars were all between 55 and 62 out of 62, so the chart carried no
information the status table did not already give. Replace it with relative
gradient time against model dimension, which shows the forward/reverse crossover
directly. Also widen the heatmap margin so the longer model names are not
clipped.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8qBZzvd4yxfDYs7v8WDqE
* Seed the global RNG before loading each model
Several models synthesise their data at load time from the global RNG. Two
independent full runs disagreed on six status cells because of it: control_flow
took a different branch, so ReverseDiffCompiled's tape was wrong in one run and
right in the other, and dppl_hmm_semisup drew state sequences that different
backends could and could not handle.
Upstream ADTests leaves this unseeded. For a benchmark whose output is published
and compared across versions, a status that flips run to run is worse than
useless, so seed it. Verified by running control_flow and dppl_hmm_semisup twice
each: identical statuses across runs.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8qBZzvd4yxfDYs7v8WDqE
---------
Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 8cb51bd commit a78f433
71 files changed
Lines changed: 9153 additions & 0 deletions
File tree
- .github
- benchmarks/AutomaticDifferentiationTuring
- data
- models
- docs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments