Repository navigation
[math-libs] Enable rocPRIM benchmark builds - #4334
Conversation
Add -DBUILD_BENCHMARK=ON and amdsmi build dependency to the rocPRIM_tests subproject so that rocPRIM benchmark binaries are built alongside tests. Signed-off-by: Lenine Ajagappane <Lenine.Ajagappane@amd.com>
…able Signed-off-by: Lenine Ajagappane <Lenine.Ajagappane@amd.com>
Signed-off-by: Lenine Ajagappane <Lenine.Ajagappane@amd.com>
Signed-off-by: Lenine Ajagappane <Lenine.Ajagappane@amd.com>
This build failure is caused by recent rocm-libraries commit ROCm/rocm-libraries#5512. Now I've created github-issue for it #4739. It wasn't caught by rocm-libraries CI because benchmarks aren't built in their pre-checkin workflow. Our PR is the first to actually compile rocPRIM benchmarks, which is why it is observed here. I've filed a fix upstream: ROCm/rocm-libraries#6662. And started trial run now - https://github.com/ROCm/TheRock/actions/runs/24775330791 |
|
Upstream fix is merged now, we need to wait for rocm-libraries submodule update with fix. |
geomin12
left a comment
There was a problem hiding this comment.
let's wait for rocm-libraries bump. i would also appreciate review from rocprim folks if this makes sense
rocm-libraries submodule updated with fix. Rebased the PR now. |
…lable (#5612) ## Summary - Guard `_rocprim_benchmark_enable` on `TARGET amdsmi` so the prim-isolated CI build (`-DTHEROCK_ENABLE_ALL=OFF -DTHEROCK_ENABLE_PRIM=ON`) no longer fails configure with `get_target_property() called with non-existent target "amdsmi"`. - Full SDK builds are unaffected — `amdsmi` is declared (via `THEROCK_ENABLE_CORE_AMDSMI`), so the target is present, and benchmarks build exactly as before. - Mirrors the existing precedent at `core/CMakeLists.txt:589` for `rocrtst`. ## Background #4334 added `amdsmi` to `rocPRIM_tests` `BUILD_DEPS` unconditionally for non-Windows, but `amdsmi` is only declared as a TheRock subproject when `THEROCK_ENABLE_CORE_AMDSMI` is ON. The prim-isolated CI group doesn't enable CORE, so `_therock_cmake_subproject_collect_build_deps` blows up before configure completes. This is breaking the rocm-libraries TheRock-pin bump in [ROCm/rocm-libraries#7979](ROCm/rocm-libraries#7979) (e.g. `Linux (rocthrust,rocprim,hipcub | gfx94X-dcgpu) / Build`). Related upstream tracking: #4651 (rocPRIM should also gracefully skip `find_package(amd_smi)` when not requested — once that lands, the `therock_rocprim_benchmark_deps.cmake` workaround can be dropped, but this guard is still the right shape regardless). ## Test plan - [ ] TheRock CI green on full SDK (benchmarks still built — confirm `benchmark_*` binaries under `dist/rocm/`) - [x] TheRock CI green on any prim-isolated job (configure no longer errors) - [ ] After merge, repoint rocm-libraries#7979's `therock-ref` to the merge SHA and re-run its failing build jobs
…lable (#5612) ## Summary - Guard `_rocprim_benchmark_enable` on `TARGET amdsmi` so the prim-isolated CI build (`-DTHEROCK_ENABLE_ALL=OFF -DTHEROCK_ENABLE_PRIM=ON`) no longer fails configure with `get_target_property() called with non-existent target "amdsmi"`. - Full SDK builds are unaffected — `amdsmi` is declared (via `THEROCK_ENABLE_CORE_AMDSMI`), so the target is present, and benchmarks build exactly as before. - Mirrors the existing precedent at `core/CMakeLists.txt:589` for `rocrtst`. ## Background #4334 added `amdsmi` to `rocPRIM_tests` `BUILD_DEPS` unconditionally for non-Windows, but `amdsmi` is only declared as a TheRock subproject when `THEROCK_ENABLE_CORE_AMDSMI` is ON. The prim-isolated CI group doesn't enable CORE, so `_therock_cmake_subproject_collect_build_deps` blows up before configure completes. This is breaking the rocm-libraries TheRock-pin bump in [ROCm/rocm-libraries#7979](ROCm/rocm-libraries#7979) (e.g. `Linux (rocthrust,rocprim,hipcub | gfx94X-dcgpu) / Build`). Related upstream tracking: #4651 (rocPRIM should also gracefully skip `find_package(amd_smi)` when not requested — once that lands, the `therock_rocprim_benchmark_deps.cmake` workaround can be dropped, but this guard is still the right shape regardless). ## Test plan - [ ] TheRock CI green on full SDK (benchmarks still built — confirm `benchmark_*` binaries under `dist/rocm/`) - [x] TheRock CI green on any prim-isolated job (configure no longer errors) - [ ] After merge, repoint rocm-libraries#7979's `therock-ref` to the merge SHA and re-run its failing build jobs
Summary
Enable building of rocPRIM benchmarks in TheRock's build system, with platform guards for Windows.
Changes
math-libs/CMakeLists.txt:-DBUILD_BENCHMARK=ONto therocPRIM_testssubproject CMake args (Linux)amdsmitoBUILD_DEPS(benchmarks link againstamd_smiviaprimbench.hpp)-DBUILD_BENCHMARK=OFF) sinceamdsmiis Linux-onlytherock_rocprim_benchmark_deps.cmakeviaCMAKE_INCLUDESto provide the missingfind_package(amd_smi)callcmake/therock_rocprim_benchmark_deps.cmake(new):find_package(amd_smi)inbenchmark/CMakeLists.txtartifact-prim.toml:bin/benchmark_*to the include listDetails
rocPRIM ships ~40 benchmarks under
rocm-libraries/projects/rocprim/benchmark/covering block, device, and warp-level primitives. These were not previously built becauseBUILD_BENCHMARKdefaults toOFF.The
CMAKE_INCLUDESworkaround is needed because upstream rocPRIM'sbenchmark/CMakeLists.txtlinks againstamd_smibut never callsfind_package(amd_smi), which only matters in non-system-install environments like TheRock. See #4651 for the upstream fix.