Skip to content

Commit e9e661b

Browse files
mahorozteZhaoXiaoYu
authored andcommitted
CUDA: remove unnecessary warp reduce in FA (ggml/1032)
* kqmax_new_j in every thread within warp is same after operate at line 199,this reduce can be omit * same problem in vec32 --------- Co-authored-by: ZhaoXiaoYu <[email protected]>
1 parent efb6ae9 commit e9e661b

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

ggml/src/ggml-cuda/fattn-vec-f16.cuh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ static __global__ void flash_attn_vec_ext_f16(
220220
for (int j = 0; j < ncols; ++j) {
221221
half kqmax_new_j = ncols == 1 ? kqmax_new : kqmax_new_arr[j];
222222

223-
kqmax_new_j = warp_reduce_max(kqmax_new_j);
224223
if (threadIdx.x == 0) {
225224
kqmax_shared[j][threadIdx.y] = kqmax_new_j;
226225
}

ggml/src/ggml-cuda/fattn-vec-f32.cuh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ static __global__ void flash_attn_vec_ext_f32(
206206
for (int j = 0; j < ncols; ++j) {
207207
float kqmax_new_j = kqmax_new_arr[j];
208208

209-
kqmax_new_j = warp_reduce_max(kqmax_new_j);
210209
if (threadIdx.x == 0) {
211210
kqmax_shared[j][threadIdx.y] = kqmax_new_j;
212211
}

0 commit comments

Comments
 (0)