Skip to content

Commit 8977ffb

Browse files
authored
[ROCm][Bugfix] Fix compilation errors with fused_qknorm_rope_kernel.cu (vllm-project#28682)
Signed-off-by: Sage Moore <[email protected]>
1 parent fd45550 commit 8977ffb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

csrc/fused_qknorm_rope_kernel.cu

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737

3838
#ifdef USE_ROCM
3939
#define FINAL_MASK 0xffffffffffffffffULL
40+
41+
#if defined(HIP_VERSION) && HIP_VERSION < 70000000
42+
// On ROCm versions before 7.0, __syncwarp isn't defined. The below
43+
// implementation is copy/pasted from the implementation in ROCm 7.0
44+
__device__ inline void __syncwarp() {
45+
__builtin_amdgcn_fence(__ATOMIC_RELEASE, "wavefront");
46+
__builtin_amdgcn_wave_barrier();
47+
__builtin_amdgcn_fence(__ATOMIC_ACQUIRE, "wavefront");
48+
}
49+
#endif
4050
#else
4151
#define FINAL_MASK 0xffffffff
4252
#endif

0 commit comments

Comments
 (0)