]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
vulkan: predicate max operation in soft_max shaders/soft_max (#10437)
authorJeff Bolz <redacted>
Wed, 20 Nov 2024 19:47:36 +0000 (13:47 -0600)
committerGitHub <redacted>
Wed, 20 Nov 2024 19:47:36 +0000 (20:47 +0100)
Fixes #10434

ggml/src/ggml-vulkan/vulkan-shaders/soft_max.comp

index f9727679ec5f2f504044dd86de0d0a3f3a60be8c..6e20b6411cadcf7931e848b406c9d14a011aca73 100644 (file)
@@ -73,7 +73,9 @@ void soft_max(uint num_iters) {
 
         FLOAT_TYPE v = a * p.scale + slope * b;
 
-        max_val = max(max_val, v);
+        if (col < p.KX) {
+            max_val = max(max_val, v);
+        }
 
         if (idx < DATA_CACHE_SIZE) {
             data_cache[idx] = v;