[hipthreads] Add hipThreads build recipe and artifact to TheRock#6769
[hipthreads] Add hipThreads build recipe and artifact to TheRock#6769marsavicc wants to merge 6 commits into
Conversation
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
| [components.lib."math-libs/hipthreads/stage"] | ||
| optional = true | ||
| [components.dbg."math-libs/hipthreads/stage"] | ||
| optional = true |
There was a problem hiding this comment.
Why those are marked optional? I think we can drop those if empty.
There was a problem hiding this comment.
The static lib lands in dev, so lib/dbg were empty. I'll drop both.
| # Make libhipcxx's CMake package resolvable by dependents (e.g. hipthreads) | ||
| # via find_package(libhipcxx). |
There was a problem hiding this comment.
| # Make libhipcxx's CMake package resolvable by dependents (e.g. hipthreads) | |
| # via find_package(libhipcxx). |
| # on therock_provide_artifact below) so per-arch CI upload races are harmless. | ||
| USE_TEST_AMDGPU_TARGETS | ||
| DEFAULT_GPU_TARGETS | ||
| gfx1201 # Fixes issue with empty target list for unsupported architectures. |
There was a problem hiding this comment.
Why do we pick gfx1201 here? This needs an public issue, linked here instead of the comment.
There was a problem hiding this comment.
This was copied from the libhipcxx recipe (I looked up that PR for reference), but hipthreads supports all architectures and is never in EXCLUDE_TARGET_PROJECTS, so the DEFAULT_GPU_TARGETS fallback never fires for us.
Removed it rather than link an issue for a workaround we don't need.
| -DHIP_PLATFORM=amd | ||
| -DROCM_PATH= | ||
| -DROCM_DIR= | ||
| -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON # Needed for Ninja build? |
There was a problem hiding this comment.
| -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON # Needed for Ninja build? | |
| -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON |
Why this comment? What do you need to know?
There was a problem hiding this comment.
I think it was copied from some libhipcxx PRs that I was looking at as a reference and I forgot to remove it.
| rocm-cmake | ||
| libhipcxx | ||
| RUNTIME_DEPS | ||
| amd-llvm |
There was a problem hiding this comment.
Why does this require amd-llvm as a runtime dep?
There was a problem hiding this comment.
The static lib embeds device code and HIP fatbin symbols, so consumers link through amd-llvm's clang++/ld.lld (--hip-link). A host-only linker can't resolve it, so amd-llvm is a real consume-time dep (same as libhipcxx).
| # identical across per-arch shards. Built for all targets once (see | ||
| # USE_TEST_AMDGPU_TARGETS in math-libs/CMakeLists.txt) and published as a single | ||
| # _generic artifact, making per-arch CI upload races harmless (latest write wins). |
There was a problem hiding this comment.
| # identical across per-arch shards. Built for all targets once (see | |
| # USE_TEST_AMDGPU_TARGETS in math-libs/CMakeLists.txt) and published as a single | |
| # _generic artifact, making per-arch CI upload races harmless (latest write wins). | |
| # identical across per-arch shards. Built for all targets once. |
| "hipthreads/**/*", | ||
| ] | ||
| exclude = [ | ||
| # Exclude folders not needed for testing |
There was a problem hiding this comment.
| # Exclude folders not needed for testing |
That comment is not needed.
Motivation
JIRA ID : ROCM-23943
Onboard hipThreads (GPU-side
std::thread-style concurrency library, now living in rocm-libraries) into TheRock so it builds as part of ROCm.Technical Details
hipthreadsbuild recipe inmath-libs/CMakeLists.txt, pulling source from${THEROCK_ROCM_LIBRARIES_SOURCE_DIR}/projects/hipthreads.[artifacts.hipthreads]inBUILD_TOPOLOGY.toml(target-neutral: the staticlibhipthreads.ais identical across architectures) and addmath-libs/artifact-hipthreads.toml.find_package(libhipcxx)(hipThreads is the first consumer of it this way).-DDISABLE_WERROR=ON(HIP runtime headers trip hipThreads' strict warnings) and document the newTHEROCK_ENABLE_HIPTHREADSflag.Test Plan
Build hipThreads via TheRock against rocm-libraries.
Test Result
Builds succesfully and produces the hipthreads artifact.
Note: CI is red until the TheRock rocm-libraries submodule is bumped to a SHA that includes
projects/hipthreads(migration landed after the current pin).Submission Checklist