]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml : update softmax n_task calculation (llama/5126)
authorsnadampal <redacted>
Fri, 26 Jan 2024 17:17:59 +0000 (11:17 -0600)
committerGeorgi Gerganov <redacted>
Sat, 27 Jan 2024 15:19:52 +0000 (17:19 +0200)
updated the n_task calculation to use max number of
threads possible. This has improved the prompt eval
performance by around 5% for DOT kernels and by
around 10% for MMLA kernels on AWS Graviton3.

ggml.c

diff --git a/ggml.c b/ggml.c
index 6a1e218730af95b5bd01d6a12b0fd8b5dd682a66..cb7b74743071bcd041292349cb72da21548f229f 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -16602,7 +16602,7 @@ static int ggml_get_n_tasks(struct ggml_tensor * node, int n_threads) {
             } break;
         case GGML_OP_SOFT_MAX:
             {
-                n_tasks = MIN(MIN(4, n_threads), ggml_nrows(node->src[0]));
+                n_tasks = MIN(n_threads, ggml_nrows(node->src[0]));
             } break;
         case GGML_OP_CONV_TRANSPOSE_1D:
             {