Repository navigation
fix(eora): keep zeroed eigenspace out of leading SVD columns - #6671
Merged
Merged
Conversation
`eora_compute_lora` scales the eigendecomposition by sqrt(eigenvalue) and then runs a float32 SVD on the product. `eigh` sorts ascending, so every eigenvalue below the numerical-rank cutoff leaves an all-zero column at the front of the SVD input. PyTorch links NVPL LAPACK on aarch64 (GB10), whose `sgesdd` aborts on that layout ("SLASCL parameter number 4 had an illegal value", then SIGBUS/heap corruption), crashing EoRA quantization and the #5354/#4307 tests.
Move the retained eigenspace first before the SVD and apply the same column permutation to `scaling_matrix_inv`. The permutation leaves the singular values and the adapter unchanged (float64 control is bit-identical), while avoiding the all-zero leading columns. Add a subprocess regression that reproduces the 64x64 rank-9 layout so a native abort is reported as a failed exit status instead of taking pytest down.
Qubitium
force-pushed
the
fix/eora-svd-leading-zero-columns
branch
from
December 1, 2026 17:26
f329321 to
91abcdf
Compare
Qubitium
marked this pull request as ready for review
December 1, 2026 17:45
6 of 8 tasks
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.
Summary
EoRA quantization aborts on GB10 (aarch64) inside the float32 SVD.
eora_compute_lorazeroes eigenvalues below the numerical-rank cutoff, andbecause
eighsorts ascending, those zeroed columns are at the front of thematrix passed to
torch.linalg.svd. PyTorch's aarch64 build links NVIDIA NVPLLAPACK, whose
sgesddaborts on leading all-zero columns (SLASCL parameter number 4 had an illegal value) and then SIGBUS/heap corruption. This is thecrash behind the GB10 failures of the #5354 and #4307 test files.
No issue number: this was found by a GB10 regression sweep, not filed upstream.
What Changed
eora_compute_loranow moves the retained eigenspace columns to the front ofthe SVD input and applies the same column permutation to
scaling_matrix_inv. The permutation is mathematically neutral; on the9-mode control used by the regression, a float64 run of the old and new
layouts produces a bit-identical
B @ A.tests/test_eora.pythat reproduces the64x64 rank-9 layout, so the native abort is reported as a failed exit status
instead of taking pytest down.
No API or behavior change beyond the SVD input layout.
Tests
Red evidence on origin/main (
0127a0313) with the same interpreter, no xdist:On GB10, the new regression passes on the branch and fails on main with the
native
SLASCLabort, not an assertion about implementation details.Numerical Validation
Method: captured the real
w_wq_deltaand covariance from a Qwen2.5-0.5BEoRA run (same 8 wikitext texts, bits=4/g128,
Lora(rank=8)) for 12 modules.All variants were applied to the same captured inputs:
maps the reduced right singular vectors back through
scaling_matrix_inv.Metrics are against
ref;relFis||X - ref||_F / ||ref||_F.Main is slightly closest to the float64 reference on average (median relF
1.35e-4; branch 1.45e-4; slice 1.45e-4), but the branch is within float32 SVD
noise of main: the same-input main-vs-branch difference at the worst layer
(
22.mlp.gate_proj) is 4.286e-6 max / 1.108e-4 relF. The saved-adapterdifference at that layer is 6.415e-3 max / 0.188 relF, i.e. propagation from
earlier near-degenerate subspace choices, not the layer's SVD error.
sigma9/sigma8is 0.9435-0.9993 across the sample, so the rank-8 cutoff sitsin a near-degenerate pair; that is why a tiny basis change propagates.
The slice variant avoids the NVPL abort on the 64x64 rank-9 CPU repro (exit 0),
but it is not closer to the float64 reference and is worse on
10.mlp.down_proj(8.262e-3 relF vs 2.489e-3 main / 1.639e-3 branch), so itwas not chosen.
Seeded end-to-end quality check on GB10 GPU, Qwen2.5-0.5B-Instruct,
WikiText-2 test, fixed 512-token windows (80 windows, 40,880 scored tokens),
EoRA adapters loaded through
GPTQModel.load:Difference: 0.0014 absolute / 0.0065% relative, equal within noise.
CPU/NVPL A/B: main aborts with
SLASCL/exit 1 during EoRA quantization;branch completes 168 adapters in 954.1 s. GPU quantization timings are 130.1 s
(main) and 130.6 s (branch).
Model Support / Module Plan
Not applicable: no model, alias, definition, module-plan, or fusion changes.
AWQ onboarding safety
Not applicable: no AWQ grouping, search, replay, or folding changes.
Logic Flow Documentation
This change does not alter a major logic flow or selection order. It only
reorders columns of the SVD input and the matching rows of
scaling_matrix_inv; the float64 control is bit-identical, so no diagram isneeded.
Review Requirements
I or an AI agent (such as Codex or Claude) have:
Kernel Accuracy Requirements
Not applicable: this is EoRA host-side linear algebra, not a kernel. The SVD
layout was checked against a float64 reference on 12 real Qwen layers; the
branch is within float32 SVD noise of main, and WikiText-2 PPL is equal
(21.8076 vs 21.8062).
Notes
The proximate abort is in NVPL LAPACK. The fix avoids the degenerate
leading-zero-column layout in GPT-QModel's own SVD input rather than patching
the library. The branch is not measurably more accurate than main: main is
slightly closer to the float64 reference on average, but the branch's
same-input difference is within float32 SVD noise and WikiText-2 PPL is equal
within noise. The 6.4e-3 propagated adapter difference comes from the
near-degenerate sigma8/sigma9 pair at the rank-8 cutoff. The slice variant
avoids the abort but is not closer to the float64 reference, so it was
rejected. No x86 host was available for this run; the #5354/#4307 files passed
there before the sweep.