From 15daccec5423a634cb656eff52e09f0dbc7fdee8 Mon Sep 17 00:00:00 2001 From: Vladan Rakic Date: Thu, 25 Sep 2025 07:36:35 -0400 Subject: [PATCH] Fix ROCm 7.0 build Remove use of warpSize for setting c-style array size. Since ROCm 7.0 warpSize can no longer be used as compile time constant. --- exllamav2/exllamav2_ext/cuda/layer_norm.cu | 9 ++++++--- exllamav2/exllamav2_ext/cuda/rms_norm.cu | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/exllamav2/exllamav2_ext/cuda/layer_norm.cu b/exllamav2/exllamav2_ext/cuda/layer_norm.cu index b286492e..a2ffa637 100644 --- a/exllamav2/exllamav2_ext/cuda/layer_norm.cu +++ b/exllamav2/exllamav2_ext/cuda/layer_norm.cu @@ -3,8 +3,12 @@ #include "compat.cuh" #if defined(USE_ROCM) -#define NUM_WARPS (1024 / warpSize) -#define WARP_SIZE (warpSize) +#if defined(__GFX8__) || defined(__GFX9__) + #define WARP_SIZE 64 +#else + #define WARP_SIZE 32 +#endif +#define NUM_WARPS (1024 / WARP_SIZE) #else #define NUM_WARPS 32 #define WARP_SIZE 32 @@ -230,4 +234,3 @@ void layer_norm_cuda_update_y { graph->update_param_ptr(label, 0, 3, y); } - diff --git a/exllamav2/exllamav2_ext/cuda/rms_norm.cu b/exllamav2/exllamav2_ext/cuda/rms_norm.cu index 94155ade..e6aa6b5d 100644 --- a/exllamav2/exllamav2_ext/cuda/rms_norm.cu +++ b/exllamav2/exllamav2_ext/cuda/rms_norm.cu @@ -3,8 +3,12 @@ #include "compat.cuh" #if defined(USE_ROCM) -#define NUM_WARPS (1024 / warpSize) -#define WARP_SIZE (warpSize) +#if defined(__GFX8__) || defined(__GFX9__) + #define WARP_SIZE 64 +#else + #define WARP_SIZE 32 +#endif +#define NUM_WARPS (1024 / WARP_SIZE) #else #define NUM_WARPS 32 #define WARP_SIZE 32