]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : fix condition of im2col on Metal backend (llama/15460)
authorXuan-Son Nguyen <redacted>
Thu, 21 Aug 2025 05:32:26 +0000 (07:32 +0200)
committerGeorgi Gerganov <redacted>
Fri, 5 Sep 2025 09:54:00 +0000 (12:54 +0300)
src/ggml-metal/ggml-metal.m

index cb8eff4a772929638616bfe02fee58401ab1df5c..7c70d352dfddffa17836b39d8f42f80d5d34d100 100644 (file)
@@ -1846,7 +1846,7 @@ static bool ggml_metal_supports_op(const struct ggml_backend_metal_device_contex
         case GGML_OP_ROPE:
             return true;
         case GGML_OP_IM2COL:
-            return op->src[0]->type == GGML_TYPE_F16;
+            return op->src[1]->type == GGML_TYPE_F32 && (op->type == GGML_TYPE_F16 || op->type == GGML_TYPE_F32);
         case GGML_OP_POOL_1D:
             return false;
         case GGML_OP_UPSCALE:
@@ -4703,7 +4703,6 @@ static int ggml_metal_encode_node(
             {
                 GGML_ASSERT(ggml_is_contiguous(src0));
                 GGML_ASSERT(ggml_is_contiguous(src1));
-                GGML_ASSERT(src0->type == GGML_TYPE_F16);
                 GGML_ASSERT(src1->type == GGML_TYPE_F32);
                 GGML_ASSERT( dst->type == GGML_TYPE_F16 || dst->type == GGML_TYPE_F32);