You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ROCm 5.7 compatibility layer from #3267 uses #ifndef probes. Two of
them misfire on ROCm 7, and the build fails for both RDNA3 targets.
src/vt/rocm/rocm_matmul_hipblaslt.hip probes #ifndef HIPBLAS_COMPUTE_32F.
On ROCm 7 that name is an enumerator of hipblasComputeType_t in hipblas-common.h, not a macro. The probe reads true, so the pre-ROCm6
block activates and typedefs hipblasDatatype_t, a type ROCm 7 removed.
Result: 20 compile errors in that file.
include/vt/rocm/hip_shfl_compat.h probes #ifndef __shfl_down_sync and #ifndef __shfl_sync. On ROCm 6 and later those names exist as functions
in amd_warp_sync_functions.h, invisible to #ifndef. The macro shims
activate anyway and collide with the real declarations.
Root cause
#ifndef answers "does a macro with this name exist". HIP delivers API
changes as enumerators and functions, so the probe tests the wrong property.
Every ROCm release that moves a name from macro to enum or function form
silently re-arms these branches.
Proposed fix
Gate version-dependent shims on HIP_VERSION_MAJOR, and keep #ifndef
probes only for names that stay macros across releases:
// hip_shfl_compat.h: the _sync wrappers exist as functions on ROCm 6+
#if !defined(HIP_VERSION_MAJOR) || HIP_VERSION_MAJOR < 6
...existing shims...
#endif// rocm_matmul_hipblaslt.hip: enum form landed in ROCm 6,// hipblasDatatype_t was removed in ROCm 7
#if !defined(HIPBLAS_COMPUTE_32F) && \
(!defined(HIP_VERSION_MAJOR) || HIP_VERSION_MAJOR < 7)
...existing typedefand aliases...
#endif
Other propositions
Maybe... we should also think about shared header for ROCm versioning handling?
Other notes
I already have local version with fix. Tested on Granite 4.2 3b safetensors, fp8 and bf16. Results on iGPU and dGPU:
Environment
HIP_VERSION_MAJOR= 7), clang from the ROCm toolchaingfx1102(Radeon RX 7700S 8GB VRAM) andgfx1103(Radeon 780M, UMA)mainafter rocm: fix ROCm 5.7 / clang-17 build on Strix (gfx1151) #3267,cmakeHIP preset, tests excludedProblem
The ROCm 5.7 compatibility layer from #3267 uses
#ifndefprobes. Two ofthem misfire on ROCm 7, and the build fails for both RDNA3 targets.
src/vt/rocm/rocm_matmul_hipblaslt.hipprobes#ifndef HIPBLAS_COMPUTE_32F.On ROCm 7 that name is an enumerator of
hipblasComputeType_tinhipblas-common.h, not a macro. The probe reads true, so the pre-ROCm6block activates and typedefs
hipblasDatatype_t, a type ROCm 7 removed.Result: 20 compile errors in that file.
include/vt/rocm/hip_shfl_compat.hprobes#ifndef __shfl_down_syncand#ifndef __shfl_sync. On ROCm 6 and later those names exist as functionsin
amd_warp_sync_functions.h, invisible to#ifndef. The macro shimsactivate anyway and collide with the real declarations.
Root cause
#ifndefanswers "does a macro with this name exist". HIP delivers APIchanges as enumerators and functions, so the probe tests the wrong property.
Every ROCm release that moves a name from macro to enum or function form
silently re-arms these branches.
Proposed fix
Gate version-dependent shims on
HIP_VERSION_MAJOR, and keep#ifndefprobes only for names that stay macros across releases:
Other propositions
Maybe... we should also think about shared header for ROCm versioning handling?
Other notes
I already have local version with fix. Tested on Granite 4.2 3b safetensors, fp8 and bf16. Results on iGPU and dGPU: