Skip to content

Forward rules for QR/LQ - #283

Merged
lkdvos merged 13 commits into
mainfrom
ksh/qr_lq_fwd
Sep 30, 2026
Merged

lkdvos merged 13 commits into
mainfrom
ksh/qr_lq_fwd

Conversation

@kshyatt

@kshyatt kshyatt commented Sep 24, 2026

Copy link
Copy Markdown
Member

I ended up deciding to just zero out the "extra" spaces, and test the ones that are well-defined. These are the last factorizations we're missing forward rules for, I think.

@kshyatt
kshyatt requested review from Jutho and lkdvos September 24, 2026 14:13
@kshyatt

kshyatt commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

Mooncake + CUDA is failing for a Mooncake internal reason I'll look into, will also look at the 1.10 Enzyme fails

Comment thread src/pushforwards/qr.jl Outdated
Comment thread src/pushforwards/qr.jl
Comment thread src/pushforwards/qr.jl Outdated
Comment thread src/pushforwards/lq.jl Outdated
Comment thread src/pushforwards/lq.jl

@Jutho Jutho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks very good. I left a few suggestions, but I think this is more or less good to go. I might still go through the test files in a bit more detail, but I like the approach to focus on gauge-invariant quantities.

@kshyatt

kshyatt commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

The Mooncake PR needs to be merged for 1.10 + CUDA to pass, in the meantime I'll try all the suggestions

@kshyatt

kshyatt commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

This has passed for everything except AMD, which doesn't run AD tests at all, and no longer has a [sources]. @Jutho, any more thoughts?

Comment thread ext/MatrixAlgebraKitEnzymeExt/MatrixAlgebraKitEnzymeExt.jl Outdated
test_reverse(call_and_zero!, RT, (left_orth!, Const), (A, TA), (alg, Const); atol, rtol, fdm, output_tangent = ΔVC)
test_reverse(call_and_zero!, RT, (left_orth!, Const), (copy(A), TA), (alg, Const); atol, rtol, fdm, output_tangent = ΔVC)
test_forward(left_orth, RT, (A, TA), (alg, Const); atol, rtol, fdm)
test_forward(call_and_zero!, RT, (left_orth!, Const), (copy(A), TA), (alg, Const); atol, rtol, fdm)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand correctly: before we did not copy(A) in the test_reverse(call_and_zero!,...) because it was the final call, and we didn't care that A was destroyed afterwards. By adding test_forward tests, we still need A, so you copy(A) in test_reverse(call_and_zero!,...). However, is copy(A) strictly necessary test_forward(call_and_zero!,...), or is this as a hygiene measure or a safeguard when adding further tests later?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a hygiene guard indeed

Comment thread test/testsuite/enzyme/orthnull.jl Outdated
Comment thread test/testsuite/enzyme/orthnull.jl Outdated
@Jutho

Jutho commented Sep 30, 2026

Copy link
Copy Markdown
Member

Nothing major. I do keep wondering if the case A !== Q is sufficiently common that we still want to specialize on that with the strategy that has fewer allocations, but for now I think this is fine.

@Jutho
Jutho enabled auto-merge (squash) September 30, 2026 13:43
@lkdvos
lkdvos disabled auto-merge September 30, 2026 17:34
@lkdvos
lkdvos enabled auto-merge (squash) September 30, 2026 17:52
@lkdvos lkdvos closed this Sep 30, 2026
auto-merge was automatically disabled September 30, 2026 17:58

Pull request was closed

@lkdvos lkdvos reopened this Sep 30, 2026
@lkdvos
lkdvos merged commit c3cf149 into main Sep 30, 2026
1 of 2 checks passed
@lkdvos
lkdvos deleted the ksh/qr_lq_fwd branch September 30, 2026 17:59
@kshyatt

kshyatt commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

What the heck happened here lol

@lkdvos

lkdvos commented Sep 30, 2026

Copy link
Copy Markdown
Member

Github being Github, I tried to merge this and just could not get it to recognize that it was actually on top of main, and closing/opening seemed to fix that

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.28302% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ixAlgebraKitEnzymeExt/MatrixAlgebraKitEnzymeExt.jl 61.53% 5 Missing ⚠️
Files with missing lines Coverage Δ
...gebraKitMooncakeExt/MatrixAlgebraKitMooncakeExt.jl 69.95% <100.00%> (-0.09%) ⬇️
src/pushforwards/lq.jl 100.00% <100.00%> (ø)
src/pushforwards/qr.jl 100.00% <100.00%> (ø)
...ixAlgebraKitEnzymeExt/MatrixAlgebraKitEnzymeExt.jl 80.35% <61.53%> (-1.16%) ⬇️

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants