Skip to content

feat(rocsolver): Implement ORGHR/UNGHR - #12197

Open
AGonzales-amd wants to merge 4 commits into
ROCm:developfrom
AGonzales-amd:orghr-unghr-develop
Open

AGonzales-amd wants to merge 4 commits into
ROCm:developfrom
AGonzales-amd:orghr-unghr-develop

Conversation

@AGonzales-amd

Copy link
Copy Markdown
Contributor

Motivation

Implement ORGHR/UNGHR for general Eigensolver (GEEV) effort.

Technical Details

Adds rocsolver_orghr and rocsolver_unghr, which generate the orthogonal/unitary matrix Q defined as the product of Householder reflectors returned by Hessenberg reduction (GEHRD).

Functions are exported from the binary but not added to the public API header.

Test Plan

Add tests for the new routines.

Submission Checklist

AGonzales-amd and others added 4 commits September 10, 2026 21:41
Adds rocsolver_[sd]orghr and rocsolver_[cz]unghr, which generate the
orthogonal/unitary matrix Q defined as the product of Householder
reflectors returned by GEHRD (Hessenberg reduction).

Functions are exported from the binary (ROCSOLVER_EXPORT) but not added
to the public API header, following the LAHR2 pattern.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Adds a CMake option (default ON) to optionally disable ORGHR and UNGHR.
When OFF, all entry points return rocblas_status_not_implemented and
tests verify that behaviour instead of running the full computation.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
@therock-pr-bot

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
📝 PR Description ❌ Fail Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
JIRA ID : TESTAUTO-6039
JIRA ID - #330
JIRA ID #330
JIRA ID (on separate line)
ROCM-25757
ISSUE ID : TESTUTO-3334
ISSUE ID #3334
ISSUE ID - TESTAUTO-3433
ISSUE ID (on separate line)
AIRUNTIME-2352
ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
Closes #10
Fixes octo-org/octo-repo#100
Resolves: #123
#123
https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
Forbidden Files ✅ Pass
🧪 Unit Test ✅ Pass
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ PR Description

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The changes span GPU implementation, build integration, dispatching, references, and tests, warranting final human review.

Pull request overview

Adds internal ORGHR/UNGHR GPU routines to generate orthogonal/unitary matrices from Hessenberg reflectors.

Changes:

  • Implements routines, workspace handling, and binary exports.
  • Integrates build flags, dispatching, and LAPACK references.
  • Adds tests, benchmarks, and changelog documentation.
File summaries
File Description
projects/rocsolver/library/src/CMakeLists.txt Builds the implementation.
projects/rocsolver/library/src/auxiliary/rocauxiliary_orghr_unghr.hpp Defines core logic and workspace handling.
projects/rocsolver/library/src/auxiliary/rocauxiliary_orghr_unghr.cpp Provides exported wrappers.
projects/rocsolver/CMakeLists.txt Adds feature configuration.
projects/rocsolver/clients/gtest/CMakeLists.txt Registers tests and feature definitions.
projects/rocsolver/clients/gtest/auxiliary/orghr_unghr_gtest.cpp Adds parameterized tests.
projects/rocsolver/clients/common/misc/rocsolver.hpp Declares client interfaces.
projects/rocsolver/clients/common/misc/rocsolver_dispatcher.hpp Adds dispatcher entries.
projects/rocsolver/clients/common/misc/lapack_host_reference.hpp Declares reference routines.
projects/rocsolver/clients/common/misc/lapack_host_reference.cpp Implements LAPACK references.
projects/rocsolver/clients/common/auxiliary/testing_orghr_unghr.hpp Provides testing and validation helpers.
projects/rocsolver/clients/common/auxiliary/testing_orghr_unghr.cpp Instantiates test templates.
projects/rocsolver/clients/CMakeLists.txt Includes shared test sources.
projects/rocsolver/clients/benchmarks/CMakeLists.txt Propagates feature configuration.
projects/rocsolver/CHANGELOG.md Documents the new routines.
Review details
  • Files reviewed: 15/15 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The documented tau allocation is undersized for ilo > 1 and could lead callers to trigger out-of-bounds reads.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

projects/rocsolver/library/src/auxiliary/rocauxiliary_orghr_unghr.cpp:216

  • This buffer contract is too small when ilo > 1: the implementation indexes tau + (ilo - 1), and GEHRD returns the active scalars in an n - 1 array. A caller following the stated ihi - ilo allocation can therefore trigger an out-of-bounds device read. Document the full GEHRD layout instead.
    tau        pointer to type. Array on the GPU of at least ihi - ilo scalars.
  • Files reviewed: 15/15 changed files
  • Comments generated: 1
  • Review effort level: Balanced

lda rocblas_int. lda >= n.
The leading dimension of A.
@param[in]
tau pointer to type. Array on the GPU of at least ihi - ilo scalars.
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.

2 participants