Skip to content

Commit f308ea7

Browse files
committed
metal : tune soft_max number of threads (whisper/0)
1 parent c3c88f2 commit f308ea7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml-metal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ static enum ggml_status ggml_metal_graph_compute(
13781378
const bool use_f16 = (src1 && src1->type == GGML_TYPE_F16);
13791379

13801380
if (ne00%4 == 0) {
1381-
while (nth < ne00/4 && nth < 256) {
1381+
while (nth < ne00/4 && nth*ne01*ne02*ne03 < 256) {
13821382
nth *= 2;
13831383
}
13841384
if (use_f16) {
@@ -1387,7 +1387,7 @@ static enum ggml_status ggml_metal_graph_compute(
13871387
pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_SOFT_MAX_F32_4].pipeline;
13881388
}
13891389
} else {
1390-
while (nth < ne00 && nth < 1024) {
1390+
while (nth < ne00 && nth*ne01*ne02*ne03 < 256) {
13911391
nth *= 2;
13921392
}
13931393
if (use_f16) {

0 commit comments

Comments
 (0)