Skip to content

Commit 19b7a83

Browse files
cuda : fix bounds check for src0 rows in MMVQ kernel (whisper/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 b5fcf8e commit 19b7a83

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
@@ -117,7 +117,7 @@ static __global__ void mul_mat_vec_q(
117117
tmp[j][i] = warp_reduce_sum(tmp[j][i]);
118118
}
119119

120-
if (threadIdx.x < rows_per_cuda_block) {
120+
if (threadIdx.x < rows_per_cuda_block && (rows_per_cuda_block == 1 || row0 + threadIdx.x < nrows_dst)) {
121121
dst[j*nrows_dst + row0 + threadIdx.x] = tmp[j][threadIdx.x];
122122
}
123123
}

0 commit comments

Comments
 (0)