Repository navigation
Leave the scenarios that crash Enzyme forward out of the benchmark grid - #1073
Open
seabbs-bot wants to merge 3 commits into
Open
seabbs-bot wants to merge 3 commits into
seabbs-bot wants to merge 3 commits into
Conversation
…enario The scenario's repeated Enzyme forward gradients segfault in the benchmark grid (#1054), while one gradient, as the tests take, is right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repeated batched Enzyme forward gradients of the scenario segfault in the garbage collector (EnzymeAD/Enzyme.jl#3698), which stopped the whole Enzyme forward cell of the AD benchmark grid (#1054). A benchmark-only list keeps the scenario in the tests, which take one gradient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The grid next crashed on the NoAdjoint twin of the ragged views scenario, then on the scenario with Bool and Int modifier fields, which also segfaults on its own in three of three runs. Both are the same Enzyme bug (EnzymeAD/Enzyme.jl#3698), which any copy of a view of the parameters can reach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Contributor
Benchmark comparison vs baseMinimum time per call. Buckets are PR time as a % of base, so lower is faster (🟢 faster, ⚪ within 5%, 🔴 slower). Counts of benchmarks per bucket:
Evaluation — 24 benchmarks (by time change)
AD gradients — 63 benchmarks (by time change)
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1054.
The Enzyme forward cell of the AD benchmark grid segfaulted because of an Enzyme bug in batched forward mode (EnzymeAD/Enzyme.jl#3698), not package code.
This leaves the scenarios that crashed it out of that cell only, so the rest of the grid runs, while the tests still run them.
Needs your decision: the bug can hit any scenario that copies a view of its parameters, which
_unpackgives nearly all of them, so another scenario may crash the cell on a later day. The list holds the two that crashed it here (with their twins). The alternatives are to time Enzyme forward one tangent at a time (chunk = Val(1), which does not crash but changes what the cell measures) or to wait for the upstream fix (EnzymeAD/Enzyme.jl#3723, which needs a rebase).Opus 5.5
The crash
All three failing daily runs (46401458397, 46710682400, 47252385949) segfaulted on the first scenario of the grid,
Convolution ragged kernel of views into the parameters, ingc_try_claim_and_pushduring a garbage collection while the scenario'scollectof its vector of views allocated, underfwddiffe…(Enzyme forward), Julia 1.13.4.Reproduced locally (Enzyme 0.13.221, EnzymeCore 0.8.28, Enzyme_jll 0.0.310+0, DifferentiationInterface 0.7.22):
DI.gradientwith the benchmarks' Enzyme forward backend, looped for 60 s, one thread: segfault in 2 of 2 runs on Julia 1.13.4, same trace as CI.BENCHMARK_TIER=full BENCHMARK_BACKENDS="Enzyme forward" BENCHMARK_MATRIX=false julia --project=benchmark benchmark/run.jl, as CI runs it) on Julia 1.13.4:NoAdjointtwin;Recurrence modifier with Bool and Int fields beside floats, which also segfaults on its own in 3 of 3 runs;Root cause: Enzyme, not the package
A reproducer with only Enzyme, batched forward over a vector of views of the argument passed to a non-inlined function:
GC error (probable corruption)1 of 3Duplicated)The pattern of #321,
sink(exp.(reshape(view(θ, …), 3, 12))), also segfaults on the release (2 of 2) and runs clean with the ported fix (2 of 2).So this is EnzymeAD/Enzyme.jl#3698: in forward mode Enzyme allocates the shadows of a new
Memorybefore its header is written, and a collection in between reads a garbage length.I posted the reproducer and these results on that issue (EnzymeAD/Enzyme.jl#3698 (comment)) rather than opening a duplicate.
The open fix PR there, EnzymeAD/Enzyme.jl#3723, predates the
julia.gc_alloc_zeroinitfix of #4065, so as it stands it aborts on this reproducer; ported onto 0.13.221 it fixes it.The AD test job passes because it takes one gradient per scenario, while the benchmark loop takes thousands, so a collection lands in the window.
There is no inlining or activity issue in the package to fix: the trigger is a copy of a view of the active argument, which the scenarios' losses make.
The change
test/ADFixtures/src/registry.jl: a benchmark-only list,benchmark_crashes(), read byexclusion_reason, holding the two scenarios and their twins forEnzyme forward, with the upstream issue in its docstring.It is separate from
backend_skip_scenarios, which the tests also read and whichtest/ad/scenarios.jlrequires to be empty, so the AD tests still run these scenarios.test/ad/scenarios.jl: the list is checked to name real scenarios and backends, as the other lists are, and the ragged views scenario and its twin are checked to be left out of the Enzyme forward benchmark.Checks
AD fixtures need only features this version has…test item passes (39 of 39).:qualitystandards items and pre-commit pass.This was opened by a bot. Please ping @seabbs for any questions.