fix(cmake): pin HIP compiler variables in amd-hip toolchain file #5489
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 190 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.314
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5489"
general
weight: 0.35
Naraenda
Motivation
Guarantee that subprojects using
COMPILER_TOOLCHAIN amd-hipalways buildwith TheRock's own HIP compiler rather than a system-discovered one.
Technical Details
Subprojects that call
project(... LANGUAGES HIP)orenable_language(HIP)trigger
CMakeDetermineHIPCompiler, which scans the system and silently picksup
/opt/rocm-/bin/when a system ROCm install is present. Inside themanylinux build container this was latent; on a developer machine with
/opt/rocm-7.3installed it causedrocr-debug-agent-testsandlibhipcxxto compile against the wrong toolchain.
Emit
CMAKE_HIP_PLATFORM,CMAKE_HIP_COMPILER_ROCM_ROOT,CMAKE_HIP_COMPILER,and
CMAKE_HIP_COMPILER_LAUNCHERinto the generated toolchain file usingCACHE ... FORCE. TheFORCEis required becauseCMakeDetermineHIPCompilerruns after the toolchain file is processed and would override plain
set()calls — forcing into the cache makes the values visible to the determine module
so it skips detection entirely. This mirrors the pattern in
examples/CMakeLists.txt(ROCm/TheRock#102).CMAKE_HIP_COMPILER_LAUNCHERis propagated fromCMAKE_CXX_COMPILER_LAUNCHERso that HIP compilation benefits from ccache, consistent with C/CXX targets.
Test Plan
Tested by observing the HIP compiler used to build the mentioned subprojects.
Also validated with a local script that confirms the CMake variables point at
TheRock's compiler.
Test Result
Confirmed the correct compiler is being used.
ISSUE ID : #102