You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fused pipeline: the "factor delta <= 1e-8 vs stock" gate of bench/ARCH-TUNING.md does not hold on the pglib KKT dumps (even at main) #177
Found while working on: T34 (local branch task/T34-fused-sm89-gap, PR not yet opened)
What: bench/ARCH-TUNING.md (ground rule 1) and the T34 task text gate every fused-pipeline change on an elementwise factor delta of at most 1e-8 against the stock factorization of the same analysis (max|L_fused - L_stock| / max|L_stock|). On an idle H200 (sm_90), the unmodified pipeline at c38e013 does not meet that gate on the condensed pglib KKT dumps:
"SPD", 78k condensed KKT (iteration 10, n = 674562): 9 of 20 refactorizations exceed it, max delta 1.8e-8. The delta varies from run to run, which points to the arrival-order sums of the concurrent extend-add (deterministic_mode = 0).
"S" (no-pivot LDLᵀ): case118 (max delta 1.9e-8, 20/20), case1354 (2.9e-8, 20/20) and the 78k (1.2e-7, 20/20). These deltas are constant from run to run, so they come from systematic rounding differences between the fused LDL kernels and the stock LDL path under the element growth of these ill-conditioned systems, not from a race.
In every run info = 0 and the relative residual matches the stock path and cuDSS (about 2e-2 on the 78k, 5e-5 on case118). The well-conditioned harness matrices (bcsstk17/38, lap2d_300, lap3d_40) stay at 1e-13 or below. Measured with an A/B gate script (20 refactorizations per configuration) on both c38e013 and the T34 branch, with the same results.
Why it is out of scope: T34 changes kernel performance, not the numerical contract; no task in TASKS.md owns the gate definition. It affects every later fused-pipeline task (T24–T26) that cites the gate.
Suggested fix or plan change: on matrices with element growth, define the gate relative to a run-to-run baseline (no worse than the unmodified pipeline) or use growth_tol(T, Nr) as the tests do, and keep the strict 1e-8 for the well-conditioned harness matrices.
Produced by a Claude agent at the owner's request: a measurement that separates the forward sensitivity of these factors from the stability of the fused path.
Setup. One NVIDIA H200 (sm_90, compute capability 9.0) through srun --gres=gpu:1 on kkt. CUDA.jl 6.5.0, cuDSS 0.8.0, Julia 1.13.3. Tree: task/T34-fused-sm89-gap @ 9cfa205 (the fused kernels there give the same gate numbers as main @ c38e013, see the issue text). Default tuning. Scripts are outside the repository (sens.jl, solvesplit.jl, dumpdiag.jl + cudss_cmp.jl, built from the T34 ab.jl). The commands, run from the worktree:
srun --time=180 --gres=gpu:1 --cpus-per-task=32 julia --project=bench -t 32 sens.jl --mats=case118,case1354,lap3d_40,bcsstk17,78k --structure=S # and --structure=SPD
srun --time=60 --gres=gpu:1 julia --project=bench solvesplit.jl case118,case1354,78k S # and case118,78k SPD
srun --time=60 --gres=gpu:1 julia --project=bench dumpdiag.jl <mats> S|SPD dump/ ; julia --project=bench cudss_cmp.jl <mats> S|SPD dump/ # cuDSS in its own process
Definitions. Every Δ is max|X − X_ref| / max|X_ref| over the whole factor array (L; for "S" also over D), on one analysis.
CPU vs CUDA: the stock DirectSolver on the KA CPU backend against the stock solver on CUDA. The options were copied, and the permutation and panel layout were checked identical, so only the rounding differs (FMA, reduction order).
eps-perturbation: the stock CUDA factor of A·(1+δ) against that of A, with δ uniform in [−eps, eps] on each stored entry. This is the factor's response to an input perturbation at the rounding level. fused (pert.) is the same for the fused path.
fused run-to-run: max over 10 refactorizations against the first. Stock run-to-run was exactly 0 everywhere.
bwd err: the factorization backward error ‖PAPᵀ − L D Lᵀ‖_F / ‖A‖_F, estimated with 4 Gaussian probes (‖E Z‖_F / ‖A Z‖_F) and evaluated in double-double, so the probe adds no rounding of its own.
ρ: ‖ |L||D||Lᵀ| ‖_∞ / ‖A‖_∞, the growth that enters the componentwise bound.
max|L| is listed for the multipliers.
κ₁: Hager estimate with the stock solve.
η: the normwise backward error of a solve, ‖b − Ax‖_∞ / (‖A‖_∞‖x‖_∞ + ‖b‖_∞), b = rand(n).
cuDSS: user_perm = the SDS permutation, checked against cuDSS's perm_reorder_row, and no pivoting. Only cuDSS's "diag" output can be compared (D for "S", diag(L) for "SPD"); cuDSS does not export L.
matrix (n)
κ₁
CPU vs CUDA (stock) L / D
eps-perturbation, stock L / D
eps-perturbation, fused L / D
fused vs stock L / D (max of 10)
fused run-to-run L / D
bwd err stock / fused
ρ
max|L|
cuDSS diag vs stock
relres stock / fused
η stock / fused
case118 "S" (1088)
9.9e16
4.4e-8 / 4.6e-15
5.5e-8 / 7.8e-15
3.8e-8 / 1.1e-14
1.9e-8 / 2.1e-15 (1.9e-8)
0 / 0
2.45e-19 / 2.42e-19
1.00
2.4e3
3.5e-15
8.8e-6 / 4.4e-5
8.6e-21 / 4.6e-20
case1354 "S" (11192)
1.2e16
7.5e-8 / 3.1e-10
7.0e-8 / 3.3e-10
6.0e-8 / 1.2e-10
2.9e-8 / 1.4e-10 (2.9e-8)
6.0e-9 / 1.6e-13
8.22e-17 / 8.21e-17
1.40
1.3e4
3.4e-11
9.9e-5 / 9.6e-5
1.4e-18 / 1.4e-18
78k "S" (674562)
1.1e17
4.9e-8 / 5.1e-10
9.8e-8 / 6.2e-10
1.2e-7 / 1.7e-9
1.1e-7 / 9.9e-10 (1.2e-7)
2.7e-8 / 2.5e-10
1.58e-16 / 1.59e-16
1.00
1.5e5
1.2e-9
1.2e-2 / 2.4e-2
8.1e-18 / 1.4e-16
78k "SPD" (674562)
1.1e17
1.0e-8
3.6e-8
4.5e-8
1.4e-8 (2.1e-8)
1.6e-8
1.72e-16 / 1.72e-16
1.00
1.7e7
1.0e-8
1.4e-2 / 2.8e-2
1.4e-17 / 1.8e-16
case118 "SPD"
9.9e16
5.8e-11
4.9e-11
4.9e-11
1.7e-13
0
9.50e-17 / 9.50e-17
1.00
4.3e7
2.5e-12
1.1e-5 / 2.3e-5
6.9e-21 / 1.6e-20
case1354 "SPD"
1.2e16
6.3e-9
4.6e-8
4.6e-8
6.4e-10
2.5e-10
8.41e-17 / 8.47e-17
1.40
3.4e6
1.5e-9
9.9e-5 / 1.1e-4
1.8e-18 / 1.8e-18
lap3d_40 "SPD" (64000), control
1.1e3
7.3e-16
5.4e-16
5.4e-16
3.6e-16
1.8e-16
1.90e-16 / 1.77e-16
4.57
2.5
1.6e-15
6.9e-14 / 7.4e-14
1.1e-15 / 1.1e-15
lap3d_40 "S", control
1.1e3
5.6e-17 / 1.5e-16
3.3e-16 / 8.9e-16
3.3e-16 / 5.9e-16
5.6e-16 / 1.3e-15
1.7e-16 / 3.0e-16
1.22e-16 / 1.34e-16
4.57
1.0
2.7e-15
5.6e-14 / 6.0e-14
1.3e-15 / 1.3e-15
bcsstk17 "SPD" (10974), control
2.0e10
1.2e-14
2.6e-14
2.6e-14
2.9e-15 (6.1e-15)
3.2e-15
8.62e-17 / 8.24e-17
1.78
5.7e4
8.8e-15
3.9e-11 / 5.2e-11
3.2e-20 / 6.6e-20
bcsstk17 "S", control
2.0e10
5.4e-14 / 3.9e-15
1.0e-13 / 4.9e-15
1.0e-13 / 5.4e-15
4.4e-14 / 3.2e-15
6.1e-15 / 2.4e-16
8.73e-17 / 9.11e-17
1.78
18
2.0e-15
4.1e-11 / 5.0e-11
4.7e-20 / 4.1e-20
info = 0 everywhere. The stock solver perturbs no pivots (npivots = 0). cuDSS with its own defaults (own ordering, default pivoting) gives relres / η of 1.8e-2 / 1.5e-17 (78k "SPD"), 1.8e-2 / 1.7e-17 (78k "S"), 1.05e-5 / 1.0e-20 (case118 "S") and 1.4e-4 / 2.2e-18 (case1354 "S").
To separate the factor from the solve algorithm, I ran the stock solve on the fused factor (solvesplit.jl; a separate run, so the fused numbers differ slightly from the table):
matrix
stock factor + stock solve (relres / η)
fused factor + fused solve
fused factor + stock solve
case118 "S"
8.8e-6 / 8.6e-21
5.4e-5 / 5.8e-20
1.3e-5 / 9.6e-21
case1354 "S"
9.6e-5 / 1.2e-18
1.1e-4 / 1.7e-18
1.0e-4 / 1.6e-18
78k "S"
1.2e-2 / 8.6e-18
2.0e-2 / 6.7e-17
1.4e-2 / 9.2e-18
case118 "SPD"
1.3e-5 / 1.4e-20
1.9e-5 / 1.7e-20
1.2e-5 / 1.3e-20
78k "SPD"
1.4e-2 / 9.2e-18
1.9e-2 / 6.9e-17
1.4e-2 / 9.0e-18
Interpretation.
The factor deltas are forward sensitivity. These KKT matrices have κ₁ ≈ 1e16–1e17. An input perturbation at the rounding level (|δ| ≤ eps per entry) moves the stock factor by 5.5e-8 (case118 "S"), 7.0e-8 (case1354 "S"), 9.8e-8 (78k "S") and 3.6e-8 (78k "SPD"). Running the same stock algorithm on the CPU backend instead of CUDA, which changes only the FMA contraction and the reduction order, moves it by 4.4e-8, 7.5e-8, 4.9e-8 and 1.0e-8. Under the 1e-8 gate of bench/ARCH-TUNING.md, the stock solver therefore fails against itself across backends on the three "S" rows. The fused-vs-stock deltas of #177 are 1.9e-8, 2.9e-8, 1.1–1.2e-7 and 1.4–2.1e-8. In every row except the 78k "S" they are below the stock eps-perturbation response, and they are of the same order as the CPU-vs-CUDA delta (below it on case118/case1354 "S", 1.4–2.1× it on the 78k "SPD"). On the 78k "S" they are about 1.2× the eps-perturbation response (and 2.3× the CPU-vs-CUDA delta). The fused path's own response to the same eps-perturbation (1.2e-7) has the same size. The cuDSS diagonal, under the same permutation without pivoting, also differs from the stock one by 1.2e-9 on D (78k "S"), close to the fused path's 9.9e-10, and by 1.0e-8 on diag(L) (78k "SPD"). On the well-conditioned controls (lap3d_40, bcsstk17) every column is at 1e-13 or below, so the fused kernels show no excess where the problem is not sensitive. The "SPD" run-to-run spread of the fused path (1.6e-8 on the 78k) has the same size as its deviation from stock. It is the arrival-order sum of the atomic extend-add. For "S", the run-to-run spread is smaller than the constant fused-vs-stock offset (2.7e-8 vs 1.1e-7 on the 78k), and that offset is the systematic rounding difference of the fused LDLᵀ kernels. A correction to the issue text: the "S" deltas are not strictly constant. case1354 and the 78k vary run to run by 6e-9 and 2.7e-8 (EA roles and in-kernel wide-front tiles use atomics in "S" too); only case118 is bitwise reproducible.
The fused factor's backward error equals the stock one's. ‖PAPᵀ − LDLᵀ‖_F/‖A‖_F is 1.58e-16 vs 1.59e-16 (78k "S"), 1.72e-16 vs 1.72e-16 (78k "SPD"), 8.22e-17 vs 8.21e-17 (case1354 "S") and 2.4e-19 for both (case118 "S"). Growth ρ is 1.00–1.40 and identical for the two factors. The large multipliers (max|L| up to 1.7e7) belong to these matrices, not to the fused path. Both factorizations are backward stable at the eps level. The fused factor is not worse.
The fused solve is measurably less accurate (still backward stable). With the fused solve, η is 8–17× the stock solve's on the 78k (1.4e-16 vs 8.1e-18 for "S", 1.8e-16 vs 1.4e-17 for "SPD"; 7× on the split run). relres is about 2× (2.4e-2 vs 1.2e-2). On case118 "S", relres is 5× and η 5×. Running the stock solve on the fused factor recovers the stock numbers (78k "S" η 9.2e-18, "SPD" 9.0e-18). So this excess comes from the partitioned-inverse solve (explicit inv(L₁₁) products; T34 measured Δinv 3.8e-6 relative on the 78k), not from the factor. An η of 1e-16 is still at the rounding level, and the relative residual of 1e-2 on the 78k is set by κ ≈ 1e17 for every solver (cuDSS: 1.8e-2). It is the one place where the fused pipeline is plainly worse than stock, and it is outside the factor gate.
Conclusion.#177 is a gate-threshold problem, not evidence of an unstable kernel. On the KKT dumps the fused-vs-stock factor delta has the same size as the stock factor's response to an eps-level input perturbation and to a change of backend, and the fused factor's backward error and growth match the stock ones to three digits. A gate that holds on these matrices compares the fused factor's backward error (and the delta normalised by the stock eps-perturbation response, or growth_tol) rather than an absolute 1e-8 elementwise forward delta, and keeps 1e-8 for the well-conditioned harness. Separately, the fused solve's η is about 10× the stock solve's on the 78k. That is worth its own tracking if solve accuracy matters to MadNLP's iterative refinement.
Activity
michel2323 commentedon Nov 3, 2026
Produced by a Claude agent at the owner's request: a measurement that separates the forward sensitivity of these factors from the stability of the fused path.
Setup. One NVIDIA H200 (sm_90, compute capability 9.0) through
srun --gres=gpu:1onkkt. CUDA.jl 6.5.0, cuDSS 0.8.0, Julia 1.13.3. Tree:task/T34-fused-sm89-gap@ 9cfa205 (the fused kernels there give the same gate numbers asmain@ c38e013, see the issue text). Default tuning. Scripts are outside the repository (sens.jl,solvesplit.jl,dumpdiag.jl+cudss_cmp.jl, built from the T34ab.jl). The commands, run from the worktree:Definitions. Every Δ is max|X − X_ref| / max|X_ref| over the whole factor array (L; for
"S"also over D), on one analysis.DirectSolveron the KA CPU backend against the stock solver on CUDA. The options were copied, and the permutation and panel layout were checked identical, so only the rounding differs (FMA, reduction order).user_perm= the SDS permutation, checked against cuDSS'sperm_reorder_row, and no pivoting. Only cuDSS's"diag"output can be compared (D for"S", diag(L) for"SPD"); cuDSS does not export L."S"(1088)"S"(11192)"S"(674562)"SPD"(674562)"SPD""SPD""SPD"(64000), control"S", control"SPD"(10974), control"S", controlinfo = 0everywhere. The stock solver perturbs no pivots (npivots = 0). cuDSS with its own defaults (own ordering, default pivoting) gives relres / η of 1.8e-2 / 1.5e-17 (78k"SPD"), 1.8e-2 / 1.7e-17 (78k"S"), 1.05e-5 / 1.0e-20 (case118"S") and 1.4e-4 / 2.2e-18 (case1354"S").To separate the factor from the solve algorithm, I ran the stock solve on the fused factor (
solvesplit.jl; a separate run, so the fused numbers differ slightly from the table):"S""S""S""SPD""SPD"Interpretation.
The factor deltas are forward sensitivity. These KKT matrices have κ₁ ≈ 1e16–1e17. An input perturbation at the rounding level (|δ| ≤ eps per entry) moves the stock factor by 5.5e-8 (case118
"S"), 7.0e-8 (case1354"S"), 9.8e-8 (78k"S") and 3.6e-8 (78k"SPD"). Running the same stock algorithm on the CPU backend instead of CUDA, which changes only the FMA contraction and the reduction order, moves it by 4.4e-8, 7.5e-8, 4.9e-8 and 1.0e-8. Under the 1e-8 gate ofbench/ARCH-TUNING.md, the stock solver therefore fails against itself across backends on the three"S"rows. The fused-vs-stock deltas of #177 are 1.9e-8, 2.9e-8, 1.1–1.2e-7 and 1.4–2.1e-8. In every row except the 78k"S"they are below the stock eps-perturbation response, and they are of the same order as the CPU-vs-CUDA delta (below it on case118/case1354"S", 1.4–2.1× it on the 78k"SPD"). On the 78k"S"they are about 1.2× the eps-perturbation response (and 2.3× the CPU-vs-CUDA delta). The fused path's own response to the same eps-perturbation (1.2e-7) has the same size. The cuDSS diagonal, under the same permutation without pivoting, also differs from the stock one by 1.2e-9 on D (78k"S"), close to the fused path's 9.9e-10, and by 1.0e-8 on diag(L) (78k"SPD"). On the well-conditioned controls (lap3d_40, bcsstk17) every column is at 1e-13 or below, so the fused kernels show no excess where the problem is not sensitive. The"SPD"run-to-run spread of the fused path (1.6e-8 on the 78k) has the same size as its deviation from stock. It is the arrival-order sum of the atomic extend-add. For"S", the run-to-run spread is smaller than the constant fused-vs-stock offset (2.7e-8 vs 1.1e-7 on the 78k), and that offset is the systematic rounding difference of the fused LDLᵀ kernels. A correction to the issue text: the"S"deltas are not strictly constant. case1354 and the 78k vary run to run by 6e-9 and 2.7e-8 (EA roles and in-kernel wide-front tiles use atomics in"S"too); only case118 is bitwise reproducible.The fused factor's backward error equals the stock one's. ‖PAPᵀ − LDLᵀ‖_F/‖A‖_F is 1.58e-16 vs 1.59e-16 (78k
"S"), 1.72e-16 vs 1.72e-16 (78k"SPD"), 8.22e-17 vs 8.21e-17 (case1354"S") and 2.4e-19 for both (case118"S"). Growth ρ is 1.00–1.40 and identical for the two factors. The large multipliers (max|L| up to 1.7e7) belong to these matrices, not to the fused path. Both factorizations are backward stable at the eps level. The fused factor is not worse.The fused solve is measurably less accurate (still backward stable). With the fused solve, η is 8–17× the stock solve's on the 78k (1.4e-16 vs 8.1e-18 for
"S", 1.8e-16 vs 1.4e-17 for"SPD"; 7× on the split run). relres is about 2× (2.4e-2 vs 1.2e-2). On case118"S", relres is 5× and η 5×. Running the stock solve on the fused factor recovers the stock numbers (78k"S"η 9.2e-18,"SPD"9.0e-18). So this excess comes from the partitioned-inverse solve (explicitinv(L₁₁)products; T34 measured Δinv 3.8e-6 relative on the 78k), not from the factor. An η of 1e-16 is still at the rounding level, and the relative residual of 1e-2 on the 78k is set by κ ≈ 1e17 for every solver (cuDSS: 1.8e-2). It is the one place where the fused pipeline is plainly worse than stock, and it is outside the factor gate.Conclusion. #177 is a gate-threshold problem, not evidence of an unstable kernel. On the KKT dumps the fused-vs-stock factor delta has the same size as the stock factor's response to an eps-level input perturbation and to a change of backend, and the fused factor's backward error and growth match the stock ones to three digits. A gate that holds on these matrices compares the fused factor's backward error (and the delta normalised by the stock eps-perturbation response, or
growth_tol) rather than an absolute 1e-8 elementwise forward delta, and keeps 1e-8 for the well-conditioned harness. Separately, the fused solve's η is about 10× the stock solve's on the 78k. That is worth its own tracking if solve accuracy matters to MadNLP's iterative refinement.T34: restate the factor gate at the rounding level of the matrix (#177)
T34: fused pipeline — blocked L11 inverses, gpu-scope fences, coalesc…