Sum only one Neumann series in svd_trunc_pullback! - #287
Conversation
Codecov Report❌ Patch coverage is
... and 14 files with indirect coverage changes 🚀 New features to boost your workflow:
|
63b2cb2 to
fc70f25
Compare
|
Ok, very nice, and also somewhat trivial in hindsight. Very stupid of me to not spot this when I was deriving this. |
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
4dd40de to
90af904
Compare
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
|
@leburgel I don't really know what this stacking feature is, but that seems to say that we can only merge this if both of these changes are approved. I feel like this one is probably self-contained enough to be merged as-is? |
I think this one just says it can't be merged because the tests didn't complete yet. I can still bypass and force merge here, so I think it just obeys the same rules. The stack is only so the upper one only shows the relevant changes without targeting it on a branch that will be removed once the lower one is merged. I think for this PR this shouldn't change any normal behavior. First time trying this out though, so I could be wrong. Do you want to force merge this or wait for the tests to complete? |
|
Hmmm, guess I just got confused because it also does not give me the auto-merge option, and it seems to indicate that it wants to merge only if all PRs in the stack are ready. I'll keep an eye on this today and merge when tests complete, I don't think this is that urgent? |
|
Not urgent no. I didn't notice the auto-merge option wasn't there, but it seems this is just a missing feature for stacks: github/gh-stack#239. If there's a problem with merging in the end, I'll un-stack. |
svd_trunc_pullback!sums the Neumann series of both complement equations by doubling, forXwithAP * AP'(m × m) and forYᴴwithAP' * AP(n × n). The two are not independent:Yᴴ = Y₀ᴴ + S⁻¹ X' AP. This PR sums the series on the smaller side only and gets the other one from that single product (form > nit works with the adjoint problem, which swapsXandYᴴ). Each doubling step then squares one Gram matrix instead of two, and the stopping criterion checks the summed side only.It's the same series with the same stopping criterion: on the cases below the result agrees with
mainto at most 2.4e-15 (relative), and it is 2.0–2.6× faster for the square and small cases and 3.5–5.4× for the large rectangular ones, where the larger of the two Gram matrices drops out (except 1.6× for real 1400×1000; laptop timings, minimum of 5).Benchmark (time and error against the full-spectrum `svd_pullback!`)
On
main:With this PR: