Skip to content

Lapack {or,un}mqr#2962

Merged
lucbv merged 4 commits into
kokkos:developfrom
lucbv:lapack_unmqr
Apr 22, 2026
Merged

Lapack {or,un}mqr#2962
lucbv merged 4 commits into
kokkos:developfrom
lucbv:lapack_unmqr

Conversation

@lucbv
Copy link
Copy Markdown
Contributor

@lucbv lucbv commented Feb 23, 2026

Implementing {or,un}mqr as a follow on PR to #2858 this will also supersede #1165
This PR only proposes wrappers to the TPLs although we may decide to implement it later on

@lucbv lucbv self-assigned this Feb 23, 2026
@lucbv lucbv requested review from brian-kelley and jgfouca March 6, 2026 17:37
@jgfouca
Copy link
Copy Markdown
Contributor

jgfouca commented Mar 6, 2026

Looks good! Did you try our new tool or did you do this all by hand?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements KokkosLapack::mqr — the {or,un}mqr operation that applies the Q factor from a prior QR decomposition (geqrf) to a matrix C. It is a follow-on to PR #2858 (which added geqrf) and supersedes PR #1165. Only TPL wrappers are provided (LAPACK/Accelerate, cuSOLVER, and rocSOLVER); no fallback Kokkos-native implementation is included. The PR also contains several unrelated cleanup changes in BLAS and sparse TPL layers (hardcoding Kokkos::HIP in rocBLAS/rocSPARSE specializations, removing unused offset_type).

Changes:

  • New KokkosLapack::mqr API with LAPACK, cuSOLVER, and rocSOLVER TPL specializations
  • New side_mode_kk_to_cublas and side_mode_kk_to_rocblas helper functions in the BLAS TPL layer
  • Cleanup in BLAS/sparse rocBLAS/rocSPARSE specializations (hardcode Kokkos::HIP, remove unused variables, remove trailing semicolons from macro instantiations)

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
lapack/src/KokkosLapack_mqr.hpp Public API header for the new mqr function
lapack/impl/KokkosLapack_mqr_spec.hpp ETI specialization declarations and fallback stub for mqr
lapack/impl/KokkosLapack_mqr_impl.hpp Empty implementation placeholder for future Kokkos-native mqr
lapack/tpls/KokkosLapack_mqr_tpl_spec_avail.hpp TPL availability traits for mqr (LAPACK, cuSOLVER, rocSOLVER)
lapack/tpls/KokkosLapack_mqr_tpl_spec_decl.hpp Full TPL specializations for mqr (LAPACK, cuSOLVER, rocSOLVER)
lapack/tpls/KokkosLapack_Host_tpl.hpp Declaration of HostLapack<T>::mqr interface
lapack/tpls/KokkosLapack_Host_tpl.cpp Fortran declarations and implementations for {or,un}mqr
lapack/unit_test/Test_Lapack_mqr.hpp New unit tests for mqr
lapack/unit_test/Test_Lapack_geqrf.hpp Updated getQR signature; copyright header modernized
lapack/unit_test/Test_Lapack.hpp Include Test_Lapack_mqr.hpp
lapack/CMakeLists.txt ETI generation for mqr
lapack/eti/... ETI template files for mqr
scripts/check_api_updates.py Register KokkosLapack_mqr.hppmqr.rst mapping
blas/tpls/KokkosBlas_tpl_spec.hpp New side_mode_kk_to_cublas and side_mode_kk_to_rocblas helpers
blas/tpls/KokkosBlas3_gemm_tpl_spec_decl.hpp Hardcode Kokkos::HIP in rocBLAS GEMM specializations
blas/tpls/KokkosBlas3_gemm_tpl_spec_avail.hpp Hardcode Kokkos::HIP in rocBLAS GEMM availability traits
blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp Hardcode Kokkos::HIP in rocBLAS GEMV specializations
blas/tpls/KokkosBlas2_gemv_tpl_spec_avail.hpp Hardcode Kokkos::HIP in rocBLAS GEMV availability traits
sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp Remove semicolons from macro instantiations
sparse/tpls/KokkosSparse_spmv_sellmatrix_tpl_spec_decl.hpp Remove unused offset_type variable
lapack/unit_test/Test_Lapack_svd.hpp Fix stale comment: "device side" → "host side"
lapack/src/KokkosLapack_geqrf.hpp Copyright header modernized
Multiple geqrf/lapack files Copyright header modernized (old NTESS header → SPDX)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lapack/tpls/KokkosLapack_mqr_tpl_spec_decl.hpp Outdated
Comment thread lapack/tpls/KokkosLapack_mqr_tpl_spec_decl.hpp Outdated
Comment thread lapack/tpls/KokkosLapack_Host_tpl.cpp Outdated
Comment thread lapack/impl/KokkosLapack_mqr_spec.hpp Outdated
Comment thread scripts/check_api_updates.py Outdated
Comment thread lapack/tpls/KokkosLapack_mqr_tpl_spec_decl.hpp Outdated
Comment thread lapack/impl/KokkosLapack_mqr_spec.hpp Outdated
Comment thread lapack/impl/KokkosLapack_mqr_impl.hpp Outdated
Comment thread lapack/src/KokkosLapack_mqr.hpp Outdated
Comment thread lapack/src/KokkosLapack_mqr.hpp Outdated
@lucbv lucbv changed the title Lapack unmqr Lapack {or,un}mqr Apr 1, 2026
The mqr algorithms provide the multiplication operator for
orthonormal/unitary matrices Q computed with a QR factorization.
TPL support for Host, Cuda and HIP.

Signed-off-by: Luc Berger-Vergiat <[email protected]>
@lucbv lucbv requested a review from jgfouca April 21, 2026 03:34
@lucbv
Copy link
Copy Markdown
Contributor Author

lucbv commented Apr 21, 2026

@jgfouca @brian-kelley this is finally ready for some more review! : )

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lapack/src/KokkosLapack_gemqr.hpp
Comment thread docs/source/API/lapack/geqrf.rst Outdated
Comment thread lapack/unit_test/Test_Lapack_mqr.hpp Outdated
Comment thread lapack/src/KokkosLapack_gemqr.hpp
Comment thread docs/source/API/lapack/mqr.rst Outdated
Comment thread docs/source/API/lapack/mqr.rst Outdated
Comment thread docs/source/API/lapack/mqr.rst Outdated
Comment thread docs/source/API/lapack/mqr.rst Outdated
Comment thread sparse/tpls/KokkosSparse_spmv_sellmatrix_tpl_spec_decl.hpp
Comment thread lapack/tpls/KokkosLapack_mqr_tpl_spec_decl.hpp Outdated
lucbv added 2 commits April 22, 2026 08:36
Signed-off-by: Luc Berger-Vergiat <[email protected]>
@lucbv lucbv requested a review from jgfouca April 22, 2026 17:41
@lucbv
Copy link
Copy Markdown
Contributor Author

lucbv commented Apr 22, 2026

@jgfouca the copilot comments have been addressed

@lucbv lucbv merged commit 9b5115e into kokkos:develop Apr 22, 2026
26 of 28 checks passed
@lucbv lucbv deleted the lapack_unmqr branch April 22, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants