Repository navigation
fix(hipsolver): use POWER target for OpenBLAS on ppc64le - #11078
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
|
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 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
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
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
b072263 to
bf5b098
Compare
Hi @martin-frbg. You're right,
Thanks for your help. |
|
Using DYNAMIC_ARCH=1 together with TARGET=POWER8 allows the build to detect the running platform and select the most suitable optimizations automatically. |
## 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>
Motivation
Part of ROCm/TheRock#5518
hipSOLVER's internal OpenBLAS build passes
TARGET=GENERICto ensure portable binaries. However, OpenBLAS does not provide aKERNEL.genericfile for the POWER architecture, causing the build to fail at CMake configure time on ppc64le:This blocks building hipSOLVER (and anything that depends on it) on ppc64le.
Technical Details
OpenBLAS ships
KERNEL.genericfor 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_PROCESSORcheck inprojects/hipsolver/CMakeLists.txtto useTARGET=POWER8on ppc64le, which selects the POWER8 kernel definitions and builds successfully. All other architectures continue to useTARGET=GENERICas before.Test Plan
TARGET=GENERICfails andTARGET=POWER8succeeds on ppc64le (POWER9, RHEL 8).TARGET=GENERIC).Test Result
hipSOLVER configures and builds successfully on ppc64le with this change.
Submission Checklist