Add DBDSVR: MRRR-based bidiagonal SVD (Golub-Kahan TGK) with DBDSDC safety fallback - #1361
Add DBDSVR: MRRR-based bidiagonal SVD (Golub-Kahan TGK) with DBDSDC safety fallback#1361saisuryadv wants to merge 2 commits into
Conversation
…afety fallback Same argument list as DBDSVDX plus LWORK/LIWORK. Engine: dqds values, MRRR vector tree adapted from the DSTEGR lineage (dlarrv/dlar1v/dlarrf _tgk variants), bundled bounded-progress bisection renamed DLARRB_TGK to avoid the signature collision with SRC/dlarrb.f. Wrapper audits all outputs for nonfiniteness and falls back to DBDSDC on audit or error, reporting the path in IWORK(2).
Tests 35-49 mirror the DBDSVDX tests 20-34 (RANGE='A','I','V' x residual, U/VT orthogonality, ordering, values-vs-vectors agreement). derrbd gains 12 corresponding error-exit checks. svd.in on master: all DBD ratios pass the threshold; error exits 55/55.
|
Interesting approach to an SVD with MRRR. I think names I'm not sure the best way to distinguish them, but I think both should start If the "classic" SVD with MRRR -- which has had numerical stability issues, hence never made it to LAPACK -- were ever added to LAPACK, would it replace these names, or how would it be distinguished? Something to consider. |
Add DBDSVR: an MRRR-based bidiagonal SVD driver
Summary
DBDSVRcomputes the SVD of an n-by-n bidiagonal matrix by the MRRR algorithm applied to the Golub-Kahan tridiagonal, with the same argument list asDBDSVDX(plusLWORK/LIWORK) and a built-in safety net: every output is audited for nonfiniteness and, on audit or nonzeroINFO, inputs are restored andDBDSDCrecomputes, with the execution path reported inIWORK(2)(1 native / 2 fallback-on-INFO / 3 fallback-on-audit). Motivation:DBDSVDXis 7-228x slower thanDBDSVRon a 16-variety battery and returns unorthogonalized vectors withINFO=0on clustered spectra (ratios to 2.2e14);DBDSDCremains the deflation-friendly workhorse, andDBDSVRcomplements it with the best worst-case time of the four solvers tested.Integration pattern (mirrors the DBDSVDX integration)
SRC/:dbdsvr.f(driver),dbdsvdmr3.f,dbdtgk.f,dlar1v_tgk.f,dlarrf_tgk.f,dlarrv_tgk.f,dlarrb_tgk.f(bundled bisection renamed fromDLARRB- its extended signature collides withSRC/dlarrb.f; linking the stock routine segfaults).SRC/Makefile,SRC/CMakeLists.txt: DLASRC lists extended.TESTING/EIG/dchkbd.f: tests 35-49, an exact programmatic mirror of the DBDSVDX tests 20-34 (RANGE='A','I','V' x residual, U/VT orthogonality, ordering, values-vs-vectors agreement).TESTING/EIG/derrbd.f: 12 error-exit checks.Validation on current
master(svd.in)All tests for DBD routines passed the threshold ( 14820 tests run)All tests for DBD drivers passed the threshold ( 14820 tests run)All tests for DBD routines passed the threshold ( 14820 tests run)All tests for DBD drivers passed the threshold ( 14820 tests run)All tests for DBD routines passed the threshold ( 14820 tests run)All tests for DBD drivers passed the threshold ( 14820 tests run)All tests for DBD routines passed the threshold ( 14820 tests run)All tests for DBD drivers passed the threshold ( 14820 tests run)All tests for DBD routines passed the threshold ( 14820 tests run)All tests for DBD drivers passed the threshold ( 14820 tests run)- includes the 15 new DBDSVR tests across all sizes/types.DBD routines passed the tests of the error exits ( 55 tests done)- includes the 12 new checks.Accuracy on a harder 16-variety battery (separate DCHKBSVR harness)
Sizes 2-100, DBDT04/DORT01 in n.ulp units, threshold 20; identical 240-case RANGE='A' basis; DBDSVR/DBDSVDX additionally exercised on I/V modes:
DBDSVR: 1195/1200 residuals below threshold; the exceedances (max 30.2, i.e. <=1.6x threshold) are confined to Cholesky-lifted geometric spectra where the construction fuses ~80% of sigma into one 1e-13-tight cluster (child-representation selection in
dlarrf_tgk; fix path = block factorizations, validated externally). DBDSVDX on the same battery fails variety 8 at up to 2.2e14 with INFO=0 in its I/V modes. Wilkinson-class zero-diagonal inputs route to fallback path 3 by design.Performance (same battery; ratios are the reliable objects)
N=2000, ms per call (unpinned VM; median 39% absolute drift measured, 11% on ratios; a pinned EPYC 9454 confirms all rankings and reaches 65x over DBDSDC on Clement at n=3000):
Pooled t/n^2 percentiles over 80 (variety, size) cases:
DBDSVR wins exactly the deflation-free spectra (9.8-13.4x over DBDSDC at n=2000), concedes the deflation-friendly ones (2.2-6.3x), has the smallest maximum of any solver, and the best suite total (2.9x over DBDSDC at n=2000, growing with n).
Known limitations / review questions
Double precision only (SBDSVR to follow); RANGE='I'/'V' currently post-filters a full computation (index pushdown into
dlarrv_tgkis the planned follow-up); the two clustered-spectrum exceedance classes above; LAPACKE bindings not included; the fallback introduces a dependency onDBDSDC.