Skip to content

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Oct 15, 2025

This is an alternative suggestion for #77, based on discussions with @mtfishman .

Here, instead of using left_orth_qr and left_orth_svd, we use a wrapper algorithm type to do the dispatching.
I've partially implemented this for the left_orth and right_orth cases, there are still some parts that would need changes to fully go to this new interface.

I'm not entirely sure which one I like best. Here the advantage would be that in principle we don't need additional functions, and do the dispatching based on the algorithm type alone. It doesn't really provide a solution to being able to call left_orth!(A; alg = LAPACK_HouseholderQR() by itself, since that would still need some trait or rewrapping in order to fully work, but it does circumvent the issue by allowing you to simply left_orth!(A; alg = LeftOrthViaQR(LAPACK_HouseholderQR()) instead.

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 75.36232% with 51 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/interface/orthnull.jl 69.11% 21 Missing ⚠️
src/implementations/orthnull.jl 68.33% 19 Missing ⚠️
src/interface/decompositions.jl 50.00% 9 Missing ⚠️
src/algorithms.jl 92.85% 1 Missing ⚠️
src/interface/truncation.jl 85.71% 1 Missing ⚠️
Files with missing lines Coverage Δ
...ixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl 82.08% <100.00%> (+5.16%) ⬆️
src/implementations/svd.jl 91.90% <ø> (ø)
src/implementations/truncation.jl 91.30% <100.00%> (-2.12%) ⬇️
src/interface/eig.jl 85.71% <100.00%> (ø)
src/interface/eigh.jl 80.00% <100.00%> (ø)
src/interface/gen_eig.jl 100.00% <100.00%> (ø)
src/interface/lq.jl 66.66% <100.00%> (+16.66%) ⬆️
src/interface/qr.jl 66.66% <100.00%> (ø)
src/interface/svd.jl 80.00% <100.00%> (ø)
src/yalapack.jl 69.46% <ø> (ø)
... and 5 more

... and 1 file with indirect coverage changes

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

@lkdvos lkdvos requested a review from mtfishman October 15, 2025 20:17
@lkdvos
Copy link
Member Author

lkdvos commented Oct 15, 2025

As a sidenote: there are some errors right now because we first select_algorithm and only then copy_input, so the LAPACK algorithms should also be chosen for Matrix{Int} etc, which still requires some adaptation. Let's first discuss which orthogonalization procedure we like, and I'll address the remaining issues afterwards.

@lkdvos lkdvos changed the title Refactor orthogonalization and nullspace interface (revisited) Refactor orthogonalization and nullspace interface Oct 27, 2025
@lkdvos
Copy link
Member Author

lkdvos commented Oct 30, 2025

So, I've updated the docs and syntaxes and docstrings etc, I think this PR should now really be ready for its final round of review.

@lkdvos lkdvos requested review from Jutho and mtfishman October 30, 2025 19:25
@lkdvos lkdvos added the documentation Improvements or additions to documentation label Oct 30, 2025
@github-actions
Copy link

After the build completes, the updated documentation will be available here

@lkdvos lkdvos added enhancement New feature or request breaking Constitutes a breaking change labels Oct 30, 2025
@mtfishman
Copy link
Collaborator

Everything looks good to me besides those small comments I left.

return Vᴴtrunc, ind
end

# disambiguate:
Copy link
Member

Choose a reason for hiding this comment

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

Are the methods below ambiguous with the methods above? They seem strictly more specific. Or are they ambiguous with methods that specify ::NoTruncation but not TU<:ROCMatrix?

Copy link
Member Author

Choose a reason for hiding this comment

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

The latter, I special-cased ::NoTruncation for the *_null implementations and this is ambiguous with the overall special-cased truncate defined above. I think in general these GPU methods still require scalar indexing, so it's not actually fully supported yet anyways, so we will probably revisit this and update that in the near future as well, but that doesn't have to be tackled in this PR

@lkdvos lkdvos enabled auto-merge (squash) November 1, 2025 12:22
@lkdvos lkdvos merged commit c52614b into main Nov 1, 2025
9 of 10 checks passed
@lkdvos lkdvos deleted the ld-leftorth2 branch November 1, 2025 12:48
@mtfishman
Copy link
Collaborator

Thanks @lkdvos, definitely a big improvement on this part of the code that will be easier to overload and extend externally.

@lkdvos lkdvos mentioned this pull request Nov 14, 2025
lkdvos referenced this pull request Nov 14, 2025
* Bump v0.6

* rename `gaugefix` -> `fixgauge`

* reduce unnecessary warnings

* fix `copy_input` signatures in Mooncake tests

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

Labels

breaking Constitutes a breaking change documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

left_orth and right_orth interface improvements

4 participants