Skip to content

Commit 01a6ebf

Browse files
Move Enzyme AD tests to their own group and environment (#1261)
Enzyme v0.13.182 fails to differentiate through the BLAS `dot` lowering introduced in Julia 1.13 ("No augmented forward pass found for ijl_lazy_load_and_lookup"), breaking the Core CI job on the `pre` channel. The upstream fix (Enzyme 23ff630) is not yet in a registered release. Split the Enzyme-dependent AD tests into their own `AD` test group, folder, and environment: - test/ADtests.jl and test/AD_performance_regression.jl move to test/AD/. - The AD group gets its own env (test/AD/Project.toml), so its Enzyme-family dependencies (Enzyme, Tracker, Mooncake, BenchmarkTools, Ipopt, OptimizationMOI, OptimizationLBFGSB) live only there and are removed from the main test target, simplifying the main [extras]/[targets]/[compat]. - test_groups.toml declares the AD group with versions = ["lts", "1"] so CI runs it on stable releases but excludes it from the `pre` channel until a fixed Enzyme is registered. Verified locally: `GROUP=AD` resolves/instantiates the new env and passes (AD Tests 123/123, AD Performance Regression 3/3) on Julia 1.12.4; the main test env also builds without the moved dependencies. See #1260. Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
1 parent d7c95a3 commit 01a6ebf

6 files changed

Lines changed: 69 additions & 23 deletions

File tree

Project.toml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
2020
[sources.OptimizationBase]
2121
path = "lib/OptimizationBase"
2222

23-
[sources.OptimizationLBFGSB]
24-
path = "lib/OptimizationLBFGSB"
25-
26-
[sources.OptimizationMOI]
27-
path = "lib/OptimizationMOI"
28-
2923
[sources.OptimizationOptimJL]
3024
path = "lib/OptimizationOptimJL"
3125

@@ -35,17 +29,14 @@ path = "lib/OptimizationOptimisers"
3529
[compat]
3630
ADTypes = "1.18"
3731
ArrayInterface = "7.10"
38-
BenchmarkTools = "1"
3932
Boltz = "1"
4033
ComponentArrays = ">= 0.13.9"
4134
ConsoleProgressMonitor = "0.1.1"
4235
DiffEqFlux = "2, 3, 4"
4336
DocStringExtensions = "0.9.5"
44-
Enzyme = "0.13"
4537
FiniteDiff = "2"
4638
Flux = "0.13, 0.14, 0.15, 0.16"
4739
ForwardDiff = "0.10, 1"
48-
Ipopt = "1"
4940
IterTools = "1.3"
5041
LinearAlgebra = "1.10"
5142
LinearSolve = "3.64.0"
@@ -54,12 +45,9 @@ LoggingExtras = "0.4, 1"
5445
Lux = "1.12.4"
5546
MLUtils = "0.4"
5647
ModelingToolkit = "11"
57-
Mooncake = "0.4.138, 0.5"
5848
Optim = ">= 1.4.1"
5949
Optimisers = ">= 0.2.5"
6050
OptimizationBase = "5"
61-
OptimizationLBFGSB = "1.2"
62-
OptimizationMOI = "1"
6351
OptimizationOptimJL = "0.4.10"
6452
OptimizationOptimisers = "0.3.16"
6553
OrdinaryDiffEqTsit5 = "1, 2"
@@ -77,30 +65,23 @@ SparseArrays = "1.10"
7765
Symbolics = "7"
7866
TerminalLoggers = "0.1"
7967
Test = "1.10"
80-
Tracker = "0.2"
8168
Zygote = "0.6, 0.7"
8269
julia = "1.10"
8370

8471
[extras]
85-
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
8672
Boltz = "4544d5e4-abc5-4dea-817f-29e4c205d9c8"
8773
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
8874
DiffEqFlux = "aae7a2af-3d4f-5e19-a356-7da93b79d9d0"
89-
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
9075
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
9176
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
9277
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
93-
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
9478
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
9579
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
9680
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
9781
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
9882
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
99-
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
10083
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
10184
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
102-
OptimizationLBFGSB = "22f7324a-a79d-40f2-bebe-3af60c77bd15"
103-
OptimizationMOI = "fd9f6733-72f4-499f-8506-86b2bdd0dea1"
10485
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
10586
OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1"
10687
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
@@ -114,8 +95,7 @@ SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
11495
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
11596
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
11697
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
117-
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
11898
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
11999

120100
[targets]
121-
test = ["BenchmarkTools", "Boltz", "ComponentArrays", "DiffEqFlux", "Enzyme", "FiniteDiff", "Flux", "ForwardDiff", "Ipopt", "IterTools", "LinearSolve", "Lux", "MLUtils", "ModelingToolkit", "Optim", "OptimizationLBFGSB", "OptimizationMOI", "OptimizationOptimJL", "OptimizationOptimisers", "OrdinaryDiffEqTsit5", "Pkg", "Random", "ReverseDiff", "SafeTestsets", "SciMLSensitivity", "SciMLTesting", "SparseArrays", "Symbolics", "Test", "Tracker", "Zygote", "Mooncake", "SciMLLogging"]
101+
test = ["Boltz", "ComponentArrays", "DiffEqFlux", "FiniteDiff", "Flux", "ForwardDiff", "IterTools", "LinearSolve", "Lux", "MLUtils", "ModelingToolkit", "Optim", "OptimizationOptimJL", "OptimizationOptimisers", "OrdinaryDiffEqTsit5", "Pkg", "Random", "ReverseDiff", "SafeTestsets", "SciMLSensitivity", "SciMLTesting", "SparseArrays", "Symbolics", "Test", "Zygote", "SciMLLogging"]
File renamed without changes.

test/AD/Project.toml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[deps]
2+
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
3+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
4+
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
5+
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
6+
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
7+
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
8+
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
9+
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
10+
OptimizationBase = "bca83a33-5cc9-4baa-983d-23429ab6bcbb"
11+
OptimizationLBFGSB = "22f7324a-a79d-40f2-bebe-3af60c77bd15"
12+
OptimizationMOI = "fd9f6733-72f4-499f-8506-86b2bdd0dea1"
13+
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
14+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
15+
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
16+
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
17+
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
18+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
19+
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
20+
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
21+
22+
[sources]
23+
Optimization = {path = "../.."}
24+
OptimizationBase = {path = "../../lib/OptimizationBase"}
25+
OptimizationLBFGSB = {path = "../../lib/OptimizationLBFGSB"}
26+
OptimizationMOI = {path = "../../lib/OptimizationMOI"}
27+
OptimizationOptimJL = {path = "../../lib/OptimizationOptimJL"}
28+
29+
[compat]
30+
ADTypes = "1.18"
31+
BenchmarkTools = "1"
32+
Enzyme = "0.13"
33+
FiniteDiff = "2"
34+
ForwardDiff = "0.10, 1"
35+
Ipopt = "1"
36+
Mooncake = "0.4.138, 0.5"
37+
Optimization = "5"
38+
OptimizationBase = "5"
39+
OptimizationLBFGSB = "1.2"
40+
OptimizationMOI = "1"
41+
OptimizationOptimJL = "0.4.10"
42+
Random = "1.10"
43+
ReverseDiff = "1"
44+
SafeTestsets = "0.1"
45+
SciMLTesting = "2.1"
46+
Test = "1.10"
47+
Tracker = "0.2"
48+
Zygote = "0.6, 0.7"
49+
julia = "1.10"

test/runtests.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ const LIB_DIR = joinpath(dirname(@__DIR__), "lib")
5959
core = function ()
6060
@safetestset "Utils Tests" include("utils.jl")
6161
@safetestset "Verbosity Tests" include("verbosity.jl")
62-
@safetestset "AD Tests" include("ADtests.jl")
63-
@safetestset "AD Performance Regression Tests" include("AD_performance_regression.jl")
6462
@safetestset "Optimization" include("native.jl")
6563
@safetestset "Mini batching" include("minibatch.jl")
6664
# DiffEqFlux test temporarily skipped due to ForwardDiff gradient dispatch
@@ -70,6 +68,19 @@ const LIB_DIR = joinpath(dirname(@__DIR__), "lib")
7068
@safetestset "Sense Handling" include("sense_tests.jl")
7169
end,
7270
groups = Dict(
71+
# The AD tests are their own group with their own environment
72+
# (test/AD/Project.toml) so their Enzyme-family dependencies stay out
73+
# of the main test env, and so the group can be excluded from the Julia
74+
# `pre` channel in test_groups.toml: Enzyme is expected to fail on
75+
# prereleases until a fixed Enzyme release lands.
76+
# See https://github.com/SciML/Optimization.jl/issues/1260.
77+
"AD" => (;
78+
env = joinpath(@__DIR__, "AD"),
79+
body = function ()
80+
@safetestset "AD Tests" include("AD/ADtests.jl")
81+
@safetestset "AD Performance Regression Tests" include("AD/AD_performance_regression.jl")
82+
end,
83+
),
7384
"GPU" => (;
7485
env = joinpath(@__DIR__, "downstream"),
7586
body = function ()

test/test_groups.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
[Core]
22
versions = ["lts", "1", "pre"]
33

4+
# Enzyme is expected to fail on Julia prereleases (see
5+
# https://github.com/SciML/Optimization.jl/issues/1260), so the Enzyme-dependent
6+
# AD tests run their own group and are excluded from the "pre" channel.
7+
[AD]
8+
versions = ["lts", "1"]
9+
410
[QA]
511
versions = ["lts", "1"]

0 commit comments

Comments
 (0)