SupernodalLU: route panel triangular solves through TriangularSolve (−13 to −18% refactorization)#1113
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Conversation
The supernodal factorization applies two BLAS-3 trsms per supernode against its just-factored diagonal block: the L21 panel on the right by U11, and the U12 panel on the left by unit-L11. They now go through overridable hooks whose default is the stdlib triangular solve, with LinearSolveRecursiveFactorizationExt overriding them with TriangularSolve. TriangularSolve is a hard dependency of RecursiveFactorization and is what RecursiveFactorization uses for its own trsms, so this adds nothing to anyone's dependency graph: it is declared as a weakdep purely to trigger the extension, and since RecursiveFactorization pulls it in, loading RecursiveFactorization alone still activates everything. That is also exactly the condition under which RFLUFactorization becomes the dense default, so the sparse solver's panel work and the dense default run on the same kernels. Measured refactorization, BLAS pinned to 1 thread: poisson2d_512 0.4781 -> 0.3921 s (-18%) poisson3d_32 0.3466 -> 0.3027 s (-13%) Residuals unchanged (1.5e-14 / 8.8e-16). GROUP=Core passes. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Independent of #1109, #1111 and #1112; touches
src/SupernodalLU/numeric.jl(two hooks), the RecursiveFactorization extension, and 3 lines ofProject.toml.What
The supernodal factorization applies two BLAS-3 trsms per supernode against its just-factored diagonal block — the L21 panel on the right by U11, the U12 panel on the left by unit-L11. These now go through overridable hooks whose default is the stdlib triangular solve, with
LinearSolveRecursiveFactorizationExtoverriding them with TriangularSolve.Why this costs nothing
TriangularSolve is a hard dependency of RecursiveFactorization and is what RecursiveFactorization uses for its own trsms internally. It is declared here as a weakdep purely to trigger the extension; because RecursiveFactorization pulls it in transitively,
using RecursiveFactorizationalone still activates everything — no user gains an install. That is also exactly the condition under whichRFLUFactorizationbecomes the dense default, so the sparse solver's panel work and the dense default end up on the same kernels.(This recovers the gap I flagged when the diagonal-block factorization moved to LinearSolve's dense
init/solve!: that move was performance-neutral on its own, and the ~15 % that had been attributed to it was in fact the panel trsms.)Measured (refactorization, BLAS pinned to 1 thread)
Residuals unchanged (1.5e-14 / 8.8e-16). Verified the extension actually loads and takes the override path in an environment with RecursiveFactorization present.
GROUP=Corepasses.🤖 Generated with Claude Code
https://claude.ai/code/session_017rr42T1vFRRT8D7DMAmJzf