Skip to content

fix(hipsolver): support riscv64 LAPACK target configuration - #12529

Merged
mgates3 merged 1 commit into
ROCm:developfrom
sifive:users/wmou/hipsolver-riscv64-lapack
Oct 28, 2026
Merged

mgates3 merged 1 commit into
ROCm:developfrom
sifive:users/wmou/hipsolver-riscv64-lapack

Conversation

@William-Mou

Copy link
Copy Markdown
Contributor

Motivation

HIPSOLVER_INTERNAL_LAPACK_BUILD builds a static OpenBLAS through ExternalProject_Add and forces -DTARGET=GENERIC so the binaries run on any CPU. OpenBLAS resolves that target by parsing
kernel/<arch>/KERNEL.<target>, and on riscv64 that file is kernel/riscv64/KERNEL.generic, which does not exist. The OpenBLAS configure therefore aborts in ParseMakefileVars with "KERNEL.generic cannot be read" and the hipSOLVER build stops there. This is the same class of problem that was already handled for ppc64le (see OpenBLAS#5987), where the tree lacks a KERNEL.generic as well.

Technical Details

  • Select -DTARGET=RISCV64_GENERIC when CMAKE_SYSTEM_PROCESSOR is riscv64. This is the portable, non-vector-extension baseline target that OpenBLAS ships for RISC-V (TargetList.txt, kernel/riscv64/KERNEL.RISCV64_GENERIC), so it plays the same role as GENERIC does on x86.
  • Preserve the existing POWER8 and GENERIC selection for every other architecture.

Issue Tracking

ISSUE ID : ROCm/TheRock#8471

Tracked by ROCm/TheRock#8471 (riscv64 host enablement for ROCm).

Test Plan

Configure hipSOLVER with HIPSOLVER_INTERNAL_LAPACK_BUILD=ON on a riscv64 host and run the hipsolver-static-lapack configure step, before and after the change.

Test Result

Before: the OpenBLAS configure step fails in kernel/CMakeLists.txt (ParseMakefileVars) because kernel/riscv64/KERNEL.generic cannot be read. After: the step reads kernel/riscv64/KERNEL.RISCV64_GENERIC and configuration completes.

Related

#11078 is the merged ppc64le equivalent with the same error. Fixing it in OpenBLAS was rejected in OpenMathLib/OpenBLAS#5821 — the maintainer expects callers to pass a real TARGET, which is what this does.

Submission Checklist

## Motivation

`HIPSOLVER_INTERNAL_LAPACK_BUILD` builds a static OpenBLAS through
`ExternalProject_Add` and forces `-DTARGET=GENERIC` so the binaries run on
any CPU. OpenBLAS resolves that target by parsing
`kernel/<arch>/KERNEL.<target>`, and on riscv64 that file is
`kernel/riscv64/KERNEL.generic`, which does not exist. The OpenBLAS
configure therefore aborts in `ParseMakefileVars` with
"KERNEL.generic cannot be read" and the hipSOLVER build stops there.
This is the same class of problem that was already handled for ppc64le
(see OpenBLAS#5987), where the tree lacks a `KERNEL.generic` as well.

## Technical Details

- Select `-DTARGET=RISCV64_GENERIC` when `CMAKE_SYSTEM_PROCESSOR` is
  `riscv64`. This is the portable, non-vector-extension baseline target
  that OpenBLAS ships for RISC-V (`TargetList.txt`,
  `kernel/riscv64/KERNEL.RISCV64_GENERIC`), so it plays the same role as
  `GENERIC` does on x86.
- Preserve the existing `POWER8` and `GENERIC` selection for every other
  architecture.

## Test Plan

Configure hipSOLVER with `HIPSOLVER_INTERNAL_LAPACK_BUILD=ON` on a riscv64
host and run the `hipsolver-static-lapack` configure step, before and after
the change.

## Test Result

Before: the OpenBLAS configure step fails in `kernel/CMakeLists.txt`
(`ParseMakefileVars`) because `kernel/riscv64/KERNEL.generic` cannot be
read. After: the step reads `kernel/riscv64/KERNEL.RISCV64_GENERIC` and
configuration completes.

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

Signed-off-by: William-Mou <william.mou@sifive.com>
@therock-pr-bot

therock-pr-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

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

🙋 Wish to Override Policy?

@assistant-librarian assistant-librarian Bot added the external contribution Code contribution from users community.. label Sep 24, 2026
@therock-pr-bot

therock-pr-bot Bot commented Oct 7, 2026

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@benrichard-amd
benrichard-amd enabled auto-merge (squash) October 7, 2026 03:23
@mgates3
mgates3 disabled auto-merge October 16, 2026 18:56
@mgates3 mgates3 added the noOptimizations Disable optimized kernels for small sizes for some routines label Oct 23, 2026
@William-Mou

Copy link
Copy Markdown
Contributor Author

Hello @benrichard-amd,

We've received two approvals on this PR. Could you please help merge it?
Thanks to @mgates3 @jmachado-amd !

@mgates3

mgates3 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@William-Mou - I've been trying to, just having issues getting CI passing.

@mgates3
mgates3 enabled auto-merge (squash) October 28, 2026 03:15
@mgates3

mgates3 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@William-Mou - It seems "Allow edits from maintainers" is not checked, so I can't merge with the latest develop to trigger a rerun of CI. Can you check that box, in the right sidebar?

@William-Mou

Copy link
Copy Markdown
Contributor Author

Hi @mgates3, I noticed that we can't enable this option for PRs originating from an organization. Are there any other workarounds to bypass the CI? For example, by manually granting maintainer permissions within the org's repo? If that's not possible, I can try recreating a new PR from my personal account instead.

This seems to be a known GitHub issue. Please refer to the link below:
https://github.com/orgs/community/discussions/5634

@mgates3

mgates3 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@William-Mou - we manually triggered CI, so let's see if everything flows through now.

@mgates3
mgates3 merged commit 3b68114 into ROCm:develop Oct 28, 2026
398 of 415 checks passed
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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

Labels

external contribution Code contribution from users community.. noOptimizations Disable optimized kernels for small sizes for some routines project: hipsolver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants