Skip to content

Commit a1a1caf

Browse files
ggerganovJohannesGaessler
authored andcommitted
cuda : fix bounds check for src0 rows in MMVQ kernel (ggml-org#2231)
* cuda : fix bounds check for src0 rows in MMVQ kernel * Update ggml-cuda/mmvq.cu Co-authored-by: Johannes Gäßler <[email protected]> --------- Co-authored-by: Johannes Gäßler <[email protected]>
1 parent 7f282a3 commit a1a1caf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml-cuda/mmvq.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static __global__ void mul_mat_vec_q(
7575
tmp[j][i] = warp_reduce_sum(tmp[j][i]);
7676
}
7777

78-
if (threadIdx.x < rows_per_cuda_block) {
78+
if (threadIdx.x < rows_per_cuda_block && (rows_per_cuda_block == 1 || row0 + threadIdx.x < nrows_dst)) {
7979
dst[j*nrows_dst + row0 + threadIdx.x] = tmp[j][threadIdx.x];
8080
}
8181
}

0 commit comments

Comments
 (0)