diff options
author | Georgi Gerganov <ggerganov@gmail.com> | 2023-12-03 15:56:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-03 15:56:22 +0200 |
commit | adf3de4f69ff7e44131222f05f9c7447ac0be3cb (patch) | |
tree | fb481e339dc7199660bd072a7a7a8729fefdf555 /ggml.c | |
parent | 33e171d1e9fc4903f9314b490d77fb8d58331b63 (diff) |
ggml : fix soft max out-of-bounds access (#4307)
ggml-ci
Diffstat (limited to 'ggml.c')
-rw-r--r-- | ggml.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -15629,7 +15629,6 @@ static int ggml_get_n_tasks(struct ggml_tensor * node, int n_threads) { } break; case GGML_OP_DIAG_MASK_ZERO: case GGML_OP_DIAG_MASK_INF: - case GGML_OP_SOFT_MAX: case GGML_OP_SOFT_MAX_BACK: case GGML_OP_ROPE: case GGML_OP_ROPE_BACK: @@ -15645,6 +15644,10 @@ static int ggml_get_n_tasks(struct ggml_tensor * node, int n_threads) { { n_tasks = 1; //TODO } break; + case GGML_OP_SOFT_MAX: + { + n_tasks = MIN(MIN(4, n_threads), ggml_nrows(node->src[0])); + } break; case GGML_OP_CONV_TRANSPOSE_1D: { n_tasks = n_threads; |