Skip to content

fix(hipsolver): use POWER target for OpenBLAS on ppc64le - #11078

Merged
benrichard-amd merged 1 commit into
developfrom
users/benrichard-amd/hipsolver-openblas-ppc64le
Aug 25, 2026
Merged

benrichard-amd merged 1 commit into
developfrom
users/benrichard-amd/hipsolver-openblas-ppc64le

Conversation

@benrichard-amd

@benrichard-amd benrichard-amd commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Part of ROCm/TheRock#5518

hipSOLVER's internal OpenBLAS build passes TARGET=GENERIC to ensure portable binaries. However, OpenBLAS does not provide a KERNEL.generic file for the POWER architecture, causing the build to fail at CMake configure time on ppc64le:

CMake Error at cmake/utils.cmake:59 (file):
  file STRINGS file
  ".../kernel/power/KERNEL.generic"
  cannot be read.

This blocks building hipSOLVER (and anything that depends on it) on ppc64le.

Technical Details

OpenBLAS ships KERNEL.generic for x86, x86_64, arm64, mips, mips64, and loongarch64 — but not for POWER. This has been filed upstream as OpenBLAS#5987.

This PR adds a CMAKE_SYSTEM_PROCESSOR check in projects/hipsolver/CMakeLists.txt to use TARGET=POWER8 on ppc64le, which selects the POWER8 kernel definitions and builds successfully. All other architectures continue to use TARGET=GENERIC as before.

Test Plan

  • Verified that OpenBLAS TARGET=GENERIC fails and TARGET=POWER8 succeeds on ppc64le (POWER9, RHEL 8).
  • Built hipSOLVER with this change on ppc64le via TheRock build system.
  • Confirmed no change in behavior on x86_64 (still uses TARGET=GENERIC).

Test Result

hipSOLVER configures and builds successfully on ppc64le with this change.

Submission Checklist

@benrichard-amd
benrichard-amd requested a review from a team as a code owner August 20, 2026 17:31
@therock-pr-bot

therock-pr-bot Bot commented Aug 20, 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?

@therock-pr-bot

Copy link
Copy Markdown

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

@martin-frbg

Copy link
Copy Markdown

Can you check the generated config.h in your build directory please ? I'm fairly certain that it autodetected your POWER9 build host. Given the "natural" constraints of ppc64le, I'd think a sufficiently general target should be POWER8 or at worst POWER6, unless you intend to support ancient PPC970 as well ?

@codecov

codecov Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #11078   +/-   ##
========================================
  Coverage    69.82%   69.82%           
========================================
  Files         2783     2783           
  Lines       458472   458487   +15     
  Branches     67619    67623    +4     
========================================
+ Hits        320103   320114   +11     
+ Misses      115139   115138    -1     
- Partials     23230    23235    +5     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 38.14% <ø> (ø) Carriedforward from 8c4eb98
TensileLite-Unit 76.58% <ø> (ø) Carriedforward from 8c4eb98
hipBLAS 90.62% <ø> (ø) Carriedforward from 8c4eb98
hipBLASLt 34.93% <ø> (ø) Carriedforward from 8c4eb98
hipCUB 82.68% <ø> (ø) Carriedforward from 8c4eb98
hipDNN 86.81% <ø> (ø) Carriedforward from 8c4eb98
hipFFT 43.60% <ø> (ø) Carriedforward from 8c4eb98
hipRAND 76.12% <ø> (ø) Carriedforward from 8c4eb98
hipSOLVER 69.03% <ø> (+<0.01%) ⬆️
hipSPARSE 86.99% <ø> (ø) Carriedforward from 8c4eb98
rocBLAS 48.26% <ø> (ø) Carriedforward from 8c4eb98
rocFFT 53.72% <ø> (ø) Carriedforward from 8c4eb98
rocRAND 57.05% <ø> (ø) Carriedforward from 8c4eb98
rocSOLVER 77.25% <ø> (ø) Carriedforward from 8c4eb98
rocSPARSE 74.59% <ø> (ø) Carriedforward from 8c4eb98
rocThrust 91.60% <ø> (ø) Carriedforward from 8c4eb98

*This pull request uses carry forward flags. Click here to find out more.
see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

OpenBLAS does not provide a KERNEL.generic file for the POWER
architecture, so TARGET=GENERIC fails at configure time on ppc64le.
Use TARGET=POWER8 instead, which is the baseline ISA for ppc64le
and ensures portable binaries across POWER8/9/10.

See OpenMathLib/OpenBLAS#5987
@benrichard-amd
benrichard-amd force-pushed the users/benrichard-amd/hipsolver-openblas-ppc64le branch from b072263 to bf5b098 Compare August 24, 2026 20:23
@benrichard-amd

Copy link
Copy Markdown
Contributor Author

Can you check the generated config.h in your build directory please ? I'm fairly certain that it autodetected your POWER9 build host. Given the "natural" constraints of ppc64le, I'd think a sufficiently general target should be POWER8 or at worst POWER6, unless you intend to support ancient PPC970 as well ?

Hi @martin-frbg. You're right, TARGET=POWER auto-detects the build host.

POWER8 is the baseline ISA for ppc64le, so we should go with that.

Thanks for your help.

@mgates3 mgates3 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.

Looks good.

@benrichard-amd
benrichard-amd merged commit 65198c5 into develop Aug 25, 2026
122 of 132 checks passed
@benrichard-amd
benrichard-amd deleted the users/benrichard-amd/hipsolver-openblas-ppc64le branch August 25, 2026 13:48
@RajalakshmiSR

Copy link
Copy Markdown

Using DYNAMIC_ARCH=1 together with TARGET=POWER8 allows the build to detect the running platform and select the most suitable optimizations automatically.

mgates3 pushed a commit that referenced this pull request Oct 28, 2026
## 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

- [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>
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.

4 participants