Summary
Several tests that use Zygote for outer differentiation cause segfaults on Julia 1.12+. These tests have been temporarily skipped on Julia 1.12+ until upstream fixes are available.
Affected Test Files
1. test/ensembles.jl
- Uses
AutoZygote() with Optimization.jl
- Causes segfault during ensemble solve differentiation on Julia 1.12+
- Workaround: Using Mooncake instead of Zygote on Julia 1.12+
2. test/parameter_initialization.jl
- Uses
Zygote.gradient() and Zygote.ignore()
- Uses
ZygoteVJP() for sensitivity algorithms
- Tests gradient computation through parameter initialization
- Workaround: Tests skipped on Julia 1.12+
3. test/mtk.jl
- Uses
Zygote.gradient() and Zygote.ChainRules.ChainRulesCore.ignore_derivatives()
- Uses
ZygoteVJP() for sensitivity algorithms
- Tests MTK integration with gradient computation
- Workaround: Tests skipped on Julia 1.12+
MWEs
Ensemble Segfault (Julia 1.12+, works on Julia 1.11)
using SciMLSensitivity, OrdinaryDiffEq, Optimization, OptimizationOptimisers
using Zygote
function prob_func(prob, i, repeat)
remake(prob, u0 = 0.5 .+ i / 100 .* prob.u0)
end
function model(p)
prob = ODEProblem((u, p, t) -> 1.01u .* p, p[1:1], (0.0, 1.0), p[2:2])
ensemble_prob = EnsembleProblem(prob, prob_func = prob_func)
sim = solve(ensemble_prob, Tsit5(), EnsembleSerial(), saveat = 0.1, trajectories = 100)
return sim
end
loss = (p, _) -> sum(abs2, 1.0 .- Array(model(p)))
# This causes segfault on Julia 1.12+
solve(
OptimizationProblem(
OptimizationFunction(loss, AutoZygote()),
[1.0, 3.0]
),
Adam(0.1); maxiters = 10
)
Related Issues
Current Status
Tests are temporarily skipped on Julia 1.12+ with @test_skip. Once upstream fixes are available (either in Zygote or by switching to alternative AD backends like Mooncake), these tests should be re-enabled.
Summary
Several tests that use Zygote for outer differentiation cause segfaults on Julia 1.12+. These tests have been temporarily skipped on Julia 1.12+ until upstream fixes are available.
Affected Test Files
1.
test/ensembles.jlAutoZygote()with Optimization.jl2.
test/parameter_initialization.jlZygote.gradient()andZygote.ignore()ZygoteVJP()for sensitivity algorithms3.
test/mtk.jlZygote.gradient()andZygote.ChainRules.ChainRulesCore.ignore_derivatives()ZygoteVJP()for sensitivity algorithmsMWEs
Ensemble Segfault (Julia 1.12+, works on Julia 1.11)
Related Issues
Current Status
Tests are temporarily skipped on Julia 1.12+ with
@test_skip. Once upstream fixes are available (either in Zygote or by switching to alternative AD backends like Mooncake), these tests should be re-enabled.