]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
cuda : fix data race in soft max (#5853)
authorslaren <redacted>
Sun, 3 Mar 2024 13:26:18 +0000 (14:26 +0100)
committerGitHub <redacted>
Sun, 3 Mar 2024 13:26:18 +0000 (14:26 +0100)
ggml-cuda.cu

index 7ed97430f4fa4cf93ce0ad1c53e3c75bb2bf31f8..04c6cb1b8fada126a2b26d497b213806c840da0f 100644 (file)
@@ -6904,6 +6904,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;
         }