]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
cuda : fix data race in soft max (llama/5853)
authorslaren <redacted>
Sun, 3 Mar 2024 13:26:18 +0000 (14:26 +0100)
committerGeorgi Gerganov <redacted>
Fri, 8 Mar 2024 09:38:32 +0000 (11:38 +0200)
ggml-cuda.cu

index 9382d96aa5190d721525b388eac8aa5a04129d6a..7d027a30a81010ed00f432fb839d3f6f30c8631e 100644 (file)
@@ -6947,6 +6947,7 @@ static __global__ void soft_max_f32(const float * x, const float * mask, const f
     // find the sum of exps in the block
     tmp = warp_reduce_sum(tmp);
     if (block_size > WARP_SIZE) {
+        __syncthreads();
         if (warp_id == 0) {
             buf_iw[lane_id] = 0.0f;
         }