From 940c01eb09fb13d13f9a13af96116351e661a107 Mon Sep 17 00:00:00 2001 From: slaren Date: Sun, 21 Jan 2024 04:09:26 +0100 Subject: [PATCH] ggml : limit get_rows threads to the number of rows --- ggml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml.c b/ggml.c index a2b3a44e4..534b68939 100644 --- a/ggml.c +++ b/ggml.c @@ -16394,7 +16394,7 @@ static int ggml_get_n_tasks(struct ggml_tensor * node, int n_threads) { } break; case GGML_OP_GET_ROWS: { - n_tasks = n_threads; + n_tasks = MIN(n_threads, ggml_nelements(node->src[1])); } break; case GGML_OP_SCALE: case GGML_OP_SET: