diff options
author | Georgi Gerganov <ggerganov@gmail.com> | 2024-05-13 11:01:07 +0300 |
---|---|---|
committer | Georgi Gerganov <ggerganov@gmail.com> | 2024-05-14 19:08:09 +0300 |
commit | f308ea705974dff62a1fe5367d776ad9d5109239 (patch) | |
tree | 006d228968ec6e315533889df3861efbfe7682ab | |
parent | c3c88f296a72432edb697ac8026dbf2ec18f2b21 (diff) |
metal : tune soft_max number of threads (whisper/0)
-rw-r--r-- | ggml-metal.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ggml-metal.m b/ggml-metal.m index 28dec762..bfa352c3 100644 --- a/ggml-metal.m +++ b/ggml-metal.m @@ -1378,7 +1378,7 @@ static enum ggml_status ggml_metal_graph_compute( const bool use_f16 = (src1 && src1->type == GGML_TYPE_F16); if (ne00%4 == 0) { - while (nth < ne00/4 && nth < 256) { + while (nth < ne00/4 && nth*ne01*ne02*ne03 < 256) { nth *= 2; } if (use_f16) { @@ -1387,7 +1387,7 @@ static enum ggml_status ggml_metal_graph_compute( pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SOFT_MAX_F32_4].pipeline; } } else { - while (nth < ne00 && nth < 1024) { + while (nth < ne00 && nth*ne01*ne02*ne03 < 256) { nth *= 2; } if (use_f16) { |