Skip to content

Commit aaaf75b

Browse files
committed
fix: try to make PETSc converge
1 parent 7b59b31 commit aaaf75b

File tree

4 files changed

+19
-64
lines changed

4 files changed

+19
-64
lines changed

benchmarks/NonlinearProblem/Manifest.toml

Lines changed: 9 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.10.9"
44
manifest_format = "2.0"
5-
project_hash = "238e056c90e16c6986cf34996338ab112f980178"
5+
project_hash = "aa4307464817aa623e6c9e668c5d811fc2e377cc"
66

77
[[deps.ADTypes]]
88
git-tree-sha1 = "e2478490447631aedba0823d4d7a80b2cc8cdb32"
@@ -104,12 +104,6 @@ version = "0.4.2"
104104
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
105105
version = "1.1.1"
106106

107-
[[deps.ArnoldiMethod]]
108-
deps = ["LinearAlgebra", "Random", "StaticArrays"]
109-
git-tree-sha1 = "d57bd3762d308bded22c3b82d033bff85f6195c6"
110-
uuid = "ec485272-7323-5ecc-a04f-4719b315124d"
111-
version = "0.4.0"
112-
113107
[[deps.ArrayInterface]]
114108
deps = ["Adapt", "LinearAlgebra"]
115109
git-tree-sha1 = "017fcb757f8e921fb44ee063a7aafe5f89b86dd1"
@@ -960,12 +954,6 @@ git-tree-sha1 = "8a6dbda1fd736d60cc477d99f2e7a042acfa46e8"
960954
uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472"
961955
version = "1.3.15+0"
962956

963-
[[deps.Graphs]]
964-
deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"]
965-
git-tree-sha1 = "3169fd3440a02f35e549728b0890904cfd4ae58a"
966-
uuid = "86223c79-3864-5bf0-83f7-82e725a168b6"
967-
version = "1.12.1"
968-
969957
[[deps.GridLayoutBase]]
970958
deps = ["GeometryBasics", "InteractiveUtils", "Observables"]
971959
git-tree-sha1 = "dc6bed05c15523624909b3953686c5f5ffa10adc"
@@ -1212,9 +1200,9 @@ version = "0.6.9"
12121200

12131201
[[deps.Krylov]]
12141202
deps = ["LinearAlgebra", "Printf", "SparseArrays"]
1215-
git-tree-sha1 = "b29d37ce30fa401a4563b18880ab91f979a29734"
1203+
git-tree-sha1 = "efadd12a94e5e73b7652479c2693cd394d684f95"
12161204
uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
1217-
version = "0.9.10"
1205+
version = "0.10.0"
12181206

12191207
[[deps.LAME_jll]]
12201208
deps = ["Artifacts", "JLLWrappers", "Libdl"]
@@ -1352,9 +1340,9 @@ version = "3.2.2+2"
13521340

13531341
[[deps.Libglvnd_jll]]
13541342
deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libX11_jll", "Xorg_libXext_jll"]
1355-
git-tree-sha1 = "36c4b9df1d1bac2fadb77b27959512ba6c541d91"
1343+
git-tree-sha1 = "d36c21b9e7c172a44a10484125024495e2625ac0"
13561344
uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29"
1357-
version = "1.7.1+0"
1345+
version = "1.7.1+1"
13581346

13591347
[[deps.Libiconv_jll]]
13601348
deps = ["Artifacts", "JLLWrappers", "Libdl"]
@@ -1402,9 +1390,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
14021390

14031391
[[deps.LinearSolve]]
14041392
deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "GPUArraysCore", "InteractiveUtils", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "StaticArraysCore", "UnPack"]
1405-
git-tree-sha1 = "2bbbdcce6d80a4aed929365d0d97b15b264bb9e7"
1393+
git-tree-sha1 = "7507995b62a97d428723e5b97a940838d9ecb376"
14061394
uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
1407-
version = "3.7.2"
1395+
version = "3.8.0"
14081396

14091397
[deps.LinearSolve.extensions]
14101398
LinearSolveBandedMatricesExt = "BandedMatrices"
@@ -1901,12 +1889,6 @@ git-tree-sha1 = "cf181f0b1e6a18dfeb0ee8acc4a9d1672499626c"
19011889
uuid = "f57f5aa1-a3ce-4bc8-8ab9-96f992907883"
19021890
version = "0.4.4"
19031891

1904-
[[deps.PackageExtensionCompat]]
1905-
git-tree-sha1 = "fb28e33b8a95c4cee25ce296c817d89cc2e53518"
1906-
uuid = "65ce6f38-6b18-4e1d-a461-8949797d7930"
1907-
version = "1.0.2"
1908-
weakdeps = ["Requires", "TOML"]
1909-
19101892
[[deps.Packing]]
19111893
deps = ["GeometryBasics"]
19121894
git-tree-sha1 = "bc5bf2ea3d5351edf285a06b0016788a121ce92c"
@@ -2326,9 +2308,9 @@ version = "1.2.0"
23262308

23272309
[[deps.SimpleNonlinearSolve]]
23282310
deps = ["ADTypes", "ArrayInterface", "BracketingNonlinearSolve", "CommonSolve", "ConcreteStructs", "DifferentiationInterface", "FastClosures", "FiniteDiff", "ForwardDiff", "LineSearch", "LinearAlgebra", "MaybeInplace", "NonlinearSolveBase", "PrecompileTools", "Reexport", "SciMLBase", "Setfield", "StaticArraysCore"]
2329-
git-tree-sha1 = "a65e81385d9c45c6abe49d7676d71b07b5b6bbc1"
2311+
git-tree-sha1 = "0e08e4b2a1b0ffe7e4e16f1a63b49e32d8ce65b4"
23302312
uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7"
2331-
version = "2.2.1"
2313+
version = "2.2.2"
23322314

23332315
[deps.SimpleNonlinearSolve.extensions]
23342316
SimpleNonlinearSolveChainRulesCoreExt = "ChainRulesCore"
@@ -2394,26 +2376,6 @@ version = "0.6.17"
23942376
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
23952377
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
23962378

2397-
[[deps.SparseDiffTools]]
2398-
deps = ["ADTypes", "Adapt", "ArrayInterface", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "Graphs", "LinearAlgebra", "PackageExtensionCompat", "Random", "Reexport", "SciMLOperators", "Setfield", "SparseArrays", "StaticArrayInterface", "StaticArrays", "UnPack", "VertexSafeGraphs"]
2399-
git-tree-sha1 = "59bad850b1fc622051bf80a2be86c95b487e0243"
2400-
uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
2401-
version = "2.24.0"
2402-
2403-
[deps.SparseDiffTools.extensions]
2404-
SparseDiffToolsEnzymeExt = "Enzyme"
2405-
SparseDiffToolsPolyesterExt = "Polyester"
2406-
SparseDiffToolsPolyesterForwardDiffExt = "PolyesterForwardDiff"
2407-
SparseDiffToolsSymbolicsExt = "Symbolics"
2408-
SparseDiffToolsZygoteExt = "Zygote"
2409-
2410-
[deps.SparseDiffTools.weakdeps]
2411-
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
2412-
Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588"
2413-
PolyesterForwardDiff = "98d1487c-24ca-40b6-b7ab-df2af84e126b"
2414-
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2415-
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2416-
24172379
[[deps.SparseMatrixColorings]]
24182380
deps = ["ADTypes", "DocStringExtensions", "LinearAlgebra", "Random", "SparseArrays"]
24192381
git-tree-sha1 = "0582fd1410a01a667a2a2a79cdc98a7c478d11d8"
@@ -2769,12 +2731,6 @@ git-tree-sha1 = "58d6e80b4ee071f5efd07fda82cb9fbe17200868"
27692731
uuid = "81def892-9a0e-5fdd-b105-ffc91e053289"
27702732
version = "1.3.0"
27712733

2772-
[[deps.VertexSafeGraphs]]
2773-
deps = ["Graphs"]
2774-
git-tree-sha1 = "8351f8d73d7e880bfc042a8b6922684ebeafb35c"
2775-
uuid = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f"
2776-
version = "0.2.0"
2777-
27782734
[[deps.Weave]]
27792735
deps = ["Base64", "Dates", "Highlights", "JSON", "Markdown", "Mustache", "Pkg", "Printf", "REPL", "RelocatableFolders", "Requires", "Serialization", "YAML"]
27802736
git-tree-sha1 = "092217eb5443926d200ae9325f103906efbb68b1"

benchmarks/NonlinearProblem/Project.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ SciMLBenchmarks = "31c91b34-3c75-11e9-0341-95557aab0344"
2222
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2323
SimpleNonlinearSolve = "727e6d20-b764-4bd8-a329-72de5adea6c7"
2424
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
25-
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
2625
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
2726
SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412"
2827
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
2928
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
3029
Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4"
3130
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
32-
cminpack_jll = "b792d7bf-f512-5dba-8a02-6d8084434f1d"
3331

3432
[compat]
3533
AlgebraicMultigrid = "0.6, 1"
@@ -55,7 +53,6 @@ SciMLBenchmarks = "0.1"
5553
Setfield = "1"
5654
SimpleNonlinearSolve = "2"
5755
SparseConnectivityTracer = "0.6"
58-
SparseDiffTools = "2"
5956
SpeedMapping = "0.3"
6057
StableRNGs = "1"
6158
StaticArrays = "1"

benchmarks/NonlinearProblem/bruss.jmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ priority: 1000000
99
Fetch required packages
1010

1111
```julia
12-
using NonlinearSolve, SparseDiffTools, LinearAlgebra, SparseArrays, DiffEqDevTools,
12+
using NonlinearSolve, LinearAlgebra, SparseArrays, DiffEqDevTools,
1313
CairoMakie, Symbolics, BenchmarkTools, PolyesterForwardDiff, LinearSolve, Sundials,
1414
Enzyme, SparseConnectivityTracer, DifferentiationInterface, SparseMatrixColorings
1515
import NLsolve, MINPACK, PETSc, RecursiveFactorization

benchmarks/NonlinearProblem/bruss_krylov.jmd

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ priority: 10000000
99
Fetch required packages
1010

1111
```julia
12-
using NonlinearSolve, SparseDiffTools, LinearAlgebra, SparseArrays, DiffEqDevTools,
12+
using NonlinearSolve, LinearAlgebra, SparseArrays, DiffEqDevTools,
1313
CairoMakie, Symbolics, BenchmarkTools, PolyesterForwardDiff, LinearSolve, Sundials,
1414
Enzyme, SparseConnectivityTracer, DifferentiationInterface, SparseMatrixColorings
1515
import NLsolve, MINPACK, PETSc, RecursiveFactorization
@@ -203,13 +203,15 @@ for (j, solver) in enumerate(solvers_scaling_jacobian_free)
203203
termination_condition = (alg isa PETScSNES || alg isa KINSOL) ?
204204
nothing :
205205
NonlinearSolveBase.AbsNormTerminationMode(Base.Fix1(maximum, abs))
206-
sol = solve(prob, alg; abstol=1e-4, reltol=1e-4,
207-
linsolve_kwargs = (; abstol = 1e-6, reltol = 1e-6),
206+
# PETSc doesn't converge properly
207+
tol = alg isa PETScSNES ? 1e-6 : 1e-4
208+
sol = solve(prob, alg; abstol=tol, reltol=tol,
209+
linsolve_kwargs = (; abstol = 1e-8, reltol = 1e-8),
208210
termination_condition)
209-
if SciMLBase.successful_retcode(sol) || norm(sol.resid, Inf) ≤ 1e-3
210-
runtimes_scaling[j, i] = @belapsed solve($prob, $alg; abstol=1e-4,
211-
reltol=1e-4,
212-
linsolve_kwargs = (; abstol = 1e-6, reltol = 1e-6),
211+
if SciMLBase.successful_retcode(sol) || norm(sol.resid, Inf) ≤ 1e-4
212+
runtimes_scaling[j, i] = @belapsed solve($prob, $alg;
213+
abstol=tol, reltol=tol,
214+
linsolve_kwargs = (; abstol = 1e-8, reltol = 1e-8),
213215
termination_condition=$termination_condition)
214216
else
215217
runtimes_scaling[j, i] = NaN

0 commit comments

Comments
 (0)