Skip to content

Commit 5481c46

Browse files
slarenhodlen
authored andcommitted
cuda : fix data race in soft max (ggml-org#5853)
1 parent 0916a80 commit 5481c46

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ggml-cuda.cu

+1
Original file line numberDiff line numberDiff line change
@@ -6904,6 +6904,7 @@ static __global__ void soft_max_f32(const float * x, const float * mask, const f
69046904
// find the sum of exps in the block
69056905
tmp = warp_reduce_sum(tmp);
69066906
if (block_size > WARP_SIZE) {
6907+
__syncthreads();
69076908
if (warp_id == 0) {
69086909
buf_iw[lane_id] = 0.0f;
69096910
}

0 commit comments

Comments
 (0)