Route the structured-sparse default LU to SupernodalLUFactorization (stacked on #1102)#1109
Merged
ChrisRackauckas merged 1 commit intoJul 25, 2026
Conversation
ChrisRackauckas-Claude
force-pushed
the
supernodal-lu-default
branch
from
July 25, 2026 08:24
d9e24db to
ba85e3f
Compare
Member
Author
|
Rebased onto merged main (#1102 is in), so this PR's diff is now exactly the defaults change: |
Renames the DefaultAlgorithmChoice enum entry UMFPACKFactorization -> SupernodalLUFactorization (and the matching DefaultLinearSolverInit cacheval field), so the structured-sparse slot of the default polyalgorithm is the pure-Julia supernodal left-right-looking LU. Explicit UMFPACKFactorization() requests are unchanged; the enum entry is not public API (users select algorithms by type, not by enum), so this is not a breaking change. Both sparse LU default slots now resolve to pure-Julia solvers, so the LU side of the sparse default no longer depends on Base.USE_GPL_LIBS; previously the non-GPL build sent structured systems to the scalar KLU path (131-195s on poisson3d_48 vs 3.8s here). The QR side keeps its SPQR gating. Benchmark basis (SciMLBenchmarks SparsePDE fdmatrix sweep 1D/2D/3D to n~164k, plus 18 SuiteSparse-collection matrices, accuracy-aware with res <= 1e-6 required to count as a win): UMFPACK won 0 of 45 PDE-sweep rows and 1 of 18 collection matrices (bayer01: fully unsymmetric pattern, numerically tame - the one regime where COLAMD-style unsymmetric ordering beats pattern symmetrization; SupernodalLU still won its refactorization). KLU keeps banded/1D, circuits, and small n, which is the klulike side of the split and is unaffected. Known boundary case: large circuit matrices (scircuit, n=171k) fall on the structured side of use_klulike_sparse_structure but KLU is ~1.9x faster there. Density alone cannot separate circuits from 2D meshes (torso2 is sparser than scircuit yet SupernodalLU wins it 3x); a predicted-fill probe would fix the routing and is left as a follow-up. GROUP=Core passes. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ChrisRackauckas-Claude
force-pushed
the
supernodal-lu-default
branch
from
July 25, 2026 09:02
ba85e3f to
b3e73ca
Compare
This was referenced Jul 25, 2026
ChrisRackauckas
marked this pull request as ready for review
July 25, 2026 10:44
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.
Stacked on #1102 — merge that first. Split out of #1102 so the additive algorithm and this behavior change can be judged separately. GitHub shows this against
main, so the diff currently also contains #1102's commits (the vendoredsrc/SupernodalLUsolver); the change unique to this PR is the last commit only —src/default.jl, the sparsedefaultalginLinearSolveSparseArraysExt, and the docs wording (3 files, ~40 lines). Once #1102 merges, this diff reduces to exactly that.What
The default polyalgorithm's
:UMFPACKFactorizationslot resolves toSupernodalLUFactorization()— the same pattern as the:KLUFactorizationslot resolving toPureKLUFactorization(). ExplicitUMFPACKFactorization()requests are unchanged.Occupying the existing slot rather than adding a new one means the established sparse-LU → column-pivoted-QR singular fallback chain applies unchanged, and the
DefaultAlgorithmChoiceenum is untouched (sodefault_algs.jlpasses as-is).Side effect worth calling out: both sparse LU default slots now resolve to pure-Julia solvers, so the LU side of the sparse default no longer depends on
Base.USE_GPL_LIBS. The non-GPL build previously sent structured systems to the scalar KLU path (131–195 s on poisson3d_48 vs 3.8 s here). The QR side keeps its SPQR gating.Benchmark basis
SciMLBenchmarks SparsePDE
fdmatrixsweep (1D/2D/3D to n≈164k) plus 18 SuiteSparse-collection matrices via MatrixDepot, accuracy-aware (residual ≤ 1e-6 required to count as a win — a fast wrong answer doesn't):use_klulike_sparse_structureside of the split and is unaffected by this PR.Known boundary case (not fixed here)
Large circuit matrices (scircuit, n=171k) fall on the structured side of
use_klulike_sparse_structure, but KLU is ~1.9× faster there. Density alone can't separate circuits from 2D meshes — torso2 is sparser than scircuit yet SupernodalLU wins it 3×. A predicted-fill probe (KLU-like iff estimated nnz(L)/nnz(A) ≲ 4, available from the AMD analysis both libraries already run) would fix the routing; left as a follow-up so this PR stays a single decision.Verification
GROUP=Corepasses locally. Default routing verified end to end: structured sparse selectsSupernodalLUFactorization, the cacheval is aSupernodalLUFactor, and the refactorization and singular-fallback paths were exercised (consistent singular system falls back to sparse QR and solves to residual 0.0).🤖 Generated with Claude Code
https://claude.ai/code/session_017rr42T1vFRRT8D7DMAmJzf