From 7e2006b0c08e1a47d9032693b32676ee7527030d Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sat, 9 Dec 2023 14:24:58 +0200 Subject: [PATCH] metal : add/mul/div use general kernel when src1 not cont --- ggml-metal.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ggml-metal.m b/ggml-metal.m index 28c628958691b..00dc4b0e1813a 100644 --- a/ggml-metal.m +++ b/ggml-metal.m @@ -1003,14 +1003,13 @@ void ggml_metal_graph_compute( case GGML_OP_MUL: case GGML_OP_DIV: { - GGML_ASSERT(ggml_is_contiguous(src0)); - GGML_ASSERT(ggml_is_contiguous(src1)); - bool bcast_row = false; int64_t nb = ne00; - if (ggml_nelements(src1) == ne10 && ne00 % 4 == 0) { + if (ggml_nelements(src1) == ne10 && ggml_is_contiguous(src1) && ne00 % 4 == 0) { + GGML_ASSERT(ggml_is_contiguous(src0)); + // src1 is a row GGML_ASSERT(ne11 == 1);