Commit e7742ab
Route RFLU matrix right-hand sides through TriangularSolve (#1117)
RecursiveFactorization already uses TriangularSolve inside its own lu!,
but the ldiv! that consumes the factorization only does so for the
pivotless NotIPIV case (RecursiveFactorization/src/lu.jl); a pivoted LU -
which is what RFLUFactorization produces - falls back to LinearAlgebra,
i.e. BLAS trsv/trsm.
Fixing that inside RecursiveFactorization would be type piracy (it owns
neither ldiv! nor LU), so it belongs here: LinearSolve owns solve! for
its own algorithm type. Matrix right-hand sides now go through
TriangularSolve's blocked kernels.
Measured solve-only, factorization already computed, 1 BLAS thread:
n nrhs=4 nrhs=8
64 6.31 -> 3.76 us 8.76 -> 5.40 us (1.68x / 1.62x)
128 21.11 -> 12.68 us 26.20 -> 17.22 us (1.66x / 1.52x)
256 86.43 -> 55.11 us 97.09 -> 67.87 us (1.57x / 1.43x)
500 277.11 -> 175.42 us 301.13 -> 225.77 us (1.58x / 1.33x)
Vector right-hand sides keep the stdlib path: TriangularSolve has no
vector kernel, and reshaping to n x 1 measured 1.09x at n=128 but 0.88x
by n=256. A single-column matrix is the same case in disguise, so it is
guarded explicitly - with the guard, nrhs=1 and vector results are
bit-identical to the stdlib path (agreement exactly 0.0), while
multi-RHS keeps 1.5-1.7x.
TriangularSolve is added as a weakdep purely to trigger the extension;
RecursiveFactorization depends on it, so loading RecursiveFactorization
alone still activates everything and no dependency graph changes.
New multi-RHS RFLU testset covers the direct and cache-reuse paths.
Co-authored-by: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent c9f1666 commit e7742ab
3 files changed
Lines changed: 72 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| 178 | + | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
38 | 88 | | |
39 | 89 | | |
40 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
214 | 232 | | |
215 | 233 | | |
216 | 234 | | |
| |||
0 commit comments