From e2e9a6caf780f00096675ecff9eec6e843084294 Mon Sep 17 00:00:00 2001 From: HimariO Date: Fri, 13 Dec 2024 19:31:34 +0800 Subject: [PATCH] update position id tensor size check in GGML_OP_ROPE --- ggml/src/ggml-metal/ggml-metal.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml-metal/ggml-metal.m b/ggml/src/ggml-metal/ggml-metal.m index 34fe5778e..49b536a1b 100644 --- a/ggml/src/ggml-metal/ggml-metal.m +++ b/ggml/src/ggml-metal/ggml-metal.m @@ -3026,7 +3026,9 @@ static void ggml_metal_encode_node( } break; case GGML_OP_ROPE: { - GGML_ASSERT(ne10 == ne02); + // make sure we have one or more position id(ne10) per token(ne02) + GGML_ASSERT(ne10 % ne02 == 0); + GGML_ASSERT(ne10 >= ne02); const int nth = MIN(1024, ne00);