Skip to content

Commit 9635529

Browse files
CUDA: fix broken oob check for FA vec f32 kernel (ggml-org#7904)
1 parent a9cae48 commit 9635529

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml-cuda/fattn-vec-f32.cuh

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static __global__ void flash_attn_vec_ext_f32(
149149
for (int i0 = 0; i0 < D/2; i0 += WARP_SIZE) {
150150
const int i = i0 + threadIdx.x;
151151

152-
Q_f2[j][i0/WARP_SIZE] = ncols <= 2 || ic0 + j ? Q_f2_j[i] : make_float2(0.0f, 0.0f);
152+
Q_f2[j][i0/WARP_SIZE] = ncols <= 2 || ic0 + j < ne01 ? Q_f2_j[i] : make_float2(0.0f, 0.0f);
153153
Q_f2[j][i0/WARP_SIZE].x *= scale;
154154
Q_f2[j][i0/WARP_SIZE].y *= scale;
155155
}

0 commit comments

Comments
 (0)