Skip to content

Commit 7bc4411

Browse files
committed
Parallel Testing
1 parent f3b0b1b commit 7bc4411

File tree

18 files changed

+253
-392
lines changed

18 files changed

+253
-392
lines changed

.buildkite/pipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ steps:
44
- JuliaCI/julia#v1:
55
version: "1"
66
- JuliaCI/julia-test#v1:
7-
coverage: false # 1000x slowdown
7+
coverage: true
88
agents:
99
queue: "juliagpu"
1010
cuda: "*"
11-
timeout_in_minutes: 30
11+
timeout_in_minutes: 60
1212
# Don't run Buildkite if the commit message includes the text [skip tests]
1313
if: build.message !~ /\[skip tests\]/
1414

1515
env:
1616
GROUP: GPU
1717
JULIA_PKG_SERVER: "" # it often struggles with our large artifacts
18-
# SECRET_CODECOV_TOKEN: "..."
18+
SECRET_CODECOV_TOKEN: "HC7K/ymhi62KUQ5OLU4DOl+11gaQt4JhXX/2nfTGlTsBB8mEMxQ8R+sHIp/2HjEup5eSXAN2IWQDQ7RDBuQvVp0T1UVtr2e4YNZFztKnsJXrFO15hXxYShJodI//X/8DzhlQd/lyTDOAOJu3eznsc3sC2CUgJzXZxLUtQN9YaZ1i3a+NoN1mO5UpkkHVhXigwF5gjy+0tei8fCdcP+SIhG0EanS5yd9q/SurtCpMHsHyUG97+ZVPglSKgdaqr31+PdmiPJ+ynp4+Hnc/esosxUSHSIL+ryRTO+28RNwPTiNf99J51RJLQmz1knWTR1ky6tiYIZ5218O6wvNil0SqNw==;U2FsdGVkX18nBY3t4LZYlEIz3EVKjpqCd994JNeJGt006up+sAjXEssI0tgCVXnfXsenVsP3NCCEoOS1GXc44g=="

.github/workflows/CI.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
group:
21-
- RootFinding
22-
- NLLSSolvers
23-
- 23TestProblems
24-
- Wrappers
25-
- Miscellaneous
21+
- Core
2622
version:
27-
- '1.10'
23+
- '1'
2824
os:
2925
- ubuntu-latest
3026
- macos-latest
@@ -48,7 +44,7 @@ jobs:
4844
- uses: julia-actions/julia-runtest@v1
4945
env:
5046
GROUP: ${{ matrix.group }}
51-
JULIA_NUM_THREADS: 11
47+
JULIA_NUM_THREADS: 8
5248
- uses: julia-actions/julia-processcoverage@v1
5349
with:
5450
directories: src,ext

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Symbolics = "5.13"
101101
Test = "1.10"
102102
TimerOutputs = "0.5.23"
103103
Zygote = "0.6.67"
104+
XUnit = "1.1"
104105
julia = "1.10"
105106

106107
[extras]
@@ -131,7 +132,8 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
131132
Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4"
132133
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
133134
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
135+
XUnit = "3e3c03f2-1a94-11e9-2981-050a4ca824ab"
134136
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
135137

136138
[targets]
137-
test = ["Aqua", "Enzyme", "BenchmarkTools", "SafeTestsets", "Pkg", "Test", "ForwardDiff", "StaticArrays", "Symbolics", "LinearSolve", "Random", "LinearAlgebra", "Zygote", "SparseDiffTools", "NonlinearProblemLibrary", "LeastSquaresOptim", "FastLevenbergMarquardt", "NaNMath", "BandedMatrices", "DiffEqBase", "StableRNGs", "MINPACK", "NLsolve", "OrdinaryDiffEq", "SpeedMapping", "FixedPointAcceleration", "SIAMFANLEquations", "Sundials"]
139+
test = ["Aqua", "Enzyme", "BenchmarkTools", "SafeTestsets", "Pkg", "Test", "ForwardDiff", "StaticArrays", "Symbolics", "LinearSolve", "Random", "LinearAlgebra", "Zygote", "SparseDiffTools", "NonlinearProblemLibrary", "LeastSquaresOptim", "FastLevenbergMarquardt", "NaNMath", "BandedMatrices", "DiffEqBase", "StableRNGs", "MINPACK", "NLsolve", "OrdinaryDiffEq", "SpeedMapping", "FixedPointAcceleration", "SIAMFANLEquations", "Sundials", "XUnit"]

test/core/23_test_problems.jl

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using NonlinearSolve, LinearAlgebra, LinearSolve, NonlinearProblemLibrary, Test
1+
using NonlinearSolve, LinearAlgebra, LinearSolve, NonlinearProblemLibrary, XUnit
22

33
problems = NonlinearProblemLibrary.problems
44
dicts = NonlinearProblemLibrary.dicts
@@ -36,7 +36,7 @@ function test_on_library(problems, dicts, alg_ops, broken_tests, ϵ = 1e-4;
3636
end
3737
end
3838

39-
@testset "NewtonRaphson 23 Test Problems" begin
39+
@testcase "NewtonRaphson 23 Test Problems" begin
4040
alg_ops = (NewtonRaphson(),)
4141

4242
broken_tests = Dict(alg => Int[] for alg in alg_ops)
@@ -45,26 +45,26 @@ end
4545
test_on_library(problems, dicts, alg_ops, broken_tests)
4646
end
4747

48-
# @testset "TrustRegion 23 Test Problems" begin
49-
# alg_ops = (TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Simple),
50-
# TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Fan),
51-
# TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Hei),
52-
# TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Yuan),
53-
# TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Bastin),
54-
# TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.NLsolve))
55-
56-
# broken_tests = Dict(alg => Int[] for alg in alg_ops)
57-
# broken_tests[alg_ops[1]] = [11, 21]
58-
# broken_tests[alg_ops[2]] = [11, 21]
59-
# broken_tests[alg_ops[3]] = [11, 21]
60-
# broken_tests[alg_ops[4]] = [11, 21]
61-
# broken_tests[alg_ops[5]] = [21]
62-
# broken_tests[alg_ops[6]] = [21]
63-
64-
# test_on_library(problems, dicts, alg_ops, broken_tests)
65-
# end
66-
67-
@testset "LevenbergMarquardt 23 Test Problems" begin
48+
@testcase "TrustRegion 23 Test Problems" begin
49+
alg_ops = (TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Simple),
50+
TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Fan),
51+
TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Hei),
52+
TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Yuan),
53+
TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Bastin),
54+
TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.NLsolve))
55+
56+
broken_tests = Dict(alg => Int[] for alg in alg_ops)
57+
broken_tests[alg_ops[1]] = [11, 21]
58+
broken_tests[alg_ops[2]] = [11, 21]
59+
broken_tests[alg_ops[3]] = [11, 21]
60+
broken_tests[alg_ops[4]] = [8, 11, 21]
61+
broken_tests[alg_ops[5]] = [21]
62+
broken_tests[alg_ops[6]] = [11, 21]
63+
64+
test_on_library(problems, dicts, alg_ops, broken_tests)
65+
end
66+
67+
@testcase "LevenbergMarquardt 23 Test Problems" begin
6868
alg_ops = (LevenbergMarquardt(),
6969
LevenbergMarquardt(; α_geodesic = 0.1),
7070
LevenbergMarquardt(; linsolve = CholeskyFactorization()))
@@ -77,7 +77,7 @@ end
7777
test_on_library(problems, dicts, alg_ops, broken_tests)
7878
end
7979

80-
@testset "DFSane 23 Test Problems" begin
80+
@testcase "DFSane 23 Test Problems" begin
8181
alg_ops = (DFSane(),)
8282

8383
broken_tests = Dict(alg => Int[] for alg in alg_ops)
@@ -86,7 +86,7 @@ end
8686
test_on_library(problems, dicts, alg_ops, broken_tests)
8787
end
8888

89-
@testset "Broyden 23 Test Problems" begin
89+
@testcase "Broyden 23 Test Problems" begin
9090
alg_ops = (Broyden(),
9191
Broyden(; init_jacobian = Val(:true_jacobian)),
9292
Broyden(; update_rule = Val(:bad_broyden)),
@@ -101,7 +101,7 @@ end
101101
test_on_library(problems, dicts, alg_ops, broken_tests)
102102
end
103103

104-
@testset "Klement 23 Test Problems" begin
104+
@testcase "Klement 23 Test Problems" begin
105105
alg_ops = (Klement(), Klement(; init_jacobian = Val(:true_jacobian_diagonal)))
106106

107107
broken_tests = Dict(alg => Int[] for alg in alg_ops)
@@ -111,7 +111,7 @@ end
111111
test_on_library(problems, dicts, alg_ops, broken_tests)
112112
end
113113

114-
@testset "PseudoTransient 23 Test Problems" begin
114+
@testcase "PseudoTransient 23 Test Problems" begin
115115
# PT relies on the root being a stable equilibrium for convergence, so it won't work on
116116
# most problems
117117
alg_ops = (PseudoTransient(),)

test/core/forward_ad.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using ForwardDiff,
2-
NonlinearSolve, MINPACK, NLsolve, StaticArrays, Sundials, Test, LinearAlgebra
2+
NonlinearSolve, MINPACK, NLsolve, StaticArrays, Sundials, XUnit, LinearAlgebra
33

44
test_f!(du, u, p) = (@. du = u^2 - p)
55
test_f(u, p) = (@. u^2 - p)
@@ -58,9 +58,10 @@ __compatible(::NLsolveJL, ::Val{:oop_cache}) = false
5858
__compatible(::KINSOL, ::Val{:iip_cache}) = false
5959
__compatible(::KINSOL, ::Val{:oop_cache}) = false
6060

61-
@testset "ForwardDiff.jl Integration: $(alg)" for alg in (NewtonRaphson(), TrustRegion(),
61+
@testcase "ForwardDiff.jl Integration: $(alg)" for alg in (NewtonRaphson(), TrustRegion(),
6262
LevenbergMarquardt(), PseudoTransient(; alpha_initial = 10.0), Broyden(), Klement(),
63-
DFSane(), nothing, NLsolveJL(), CMINPACK(), KINSOL())
63+
DFSane(), nothing, NLsolveJL(), CMINPACK(),
64+
KINSOL(; globalization_strategy = :LineSearch))
6465
us = (2.0, @SVector[1.0, 1.0], [1.0, 1.0], ones(2, 2), @SArray ones(2, 2))
6566

6667
@testset "Scalar AD" begin

test/core/nlls.jl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using NonlinearSolve,
2-
LinearSolve, LinearAlgebra, Test, StableRNGs, Random, ForwardDiff, Zygote
2+
LinearSolve, LinearAlgebra, XUnit, StableRNGs, Random, ForwardDiff, Zygote
33

44
true_function(x, θ) = @. θ[1] * exp(θ[2] * x) * cos(θ[3] * x + θ[4])
55
true_function(y, x, θ) = (@. y = θ[1] * exp(θ[2] * x) * cos(θ[3] * x + θ[4]))
@@ -52,10 +52,12 @@ for radius_update_scheme in [RadiusUpdateSchemes.Simple, RadiusUpdateSchemes.Noc
5252
push!(solvers, TrustRegion(; radius_update_scheme))
5353
end
5454

55-
for prob in nlls_problems, solver in solvers
56-
@time sol = solve(prob, solver; maxiters = 10000, abstol = 1e-8)
57-
@test SciMLBase.successful_retcode(sol)
58-
@test maximum(abs, sol.resid) < 1e-6
55+
@testcase "General NLLS Solvers" begin
56+
for prob in nlls_problems, solver in solvers
57+
sol = solve(prob, solver; maxiters = 10000, abstol = 1e-8)
58+
@test SciMLBase.successful_retcode(sol)
59+
@test maximum(abs, sol.resid) < 1e-6
60+
end
5961
end
6062

6163
# This is just for testing that we can use vjp provided by the user
@@ -79,7 +81,9 @@ probs = [
7981
resid_prototype = zero(y_target), vjp = vjp), θ_init, x),
8082
]
8183

82-
for prob in probs, solver in solvers
83-
sol = solve(prob, solver; maxiters = 10000, abstol = 1e-8)
84-
@test maximum(abs, sol.resid) < 1e-6
84+
@testcase "Custom VJP" begin
85+
for prob in probs, solver in solvers
86+
sol = solve(prob, solver; maxiters = 10000, abstol = 1e-8)
87+
@test maximum(abs, sol.resid) < 1e-6
88+
end
8589
end

0 commit comments

Comments
 (0)