ggml : limit get_rows threads to the number of rows

This commit is contained in:
slaren 2024-01-21 04:09:26 +01:00
parent 16e12ab734
commit 940c01eb09

2
ggml.c
View file

@ -16394,7 +16394,7 @@ static int ggml_get_n_tasks(struct ggml_tensor * node, int n_threads) {
} break; } break;
case GGML_OP_GET_ROWS: case GGML_OP_GET_ROWS:
{ {
n_tasks = n_threads; n_tasks = MIN(n_threads, ggml_nelements(node->src[1]));
} break; } break;
case GGML_OP_SCALE: case GGML_OP_SCALE:
case GGML_OP_SET: case GGML_OP_SET: