Skip to content

Commit 945e1f1

Browse files
authored
ggml : fix condition of im2col on Metal backend (ggml-org#15460)
1 parent 1b0db8f commit 945e1f1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ggml/src/ggml-metal/ggml-metal.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ static bool ggml_metal_supports_op(const struct ggml_backend_metal_device_contex
18461846
case GGML_OP_ROPE:
18471847
return true;
18481848
case GGML_OP_IM2COL:
1849-
return op->src[0]->type == GGML_TYPE_F16;
1849+
return op->src[1]->type == GGML_TYPE_F32 && (op->type == GGML_TYPE_F16 || op->type == GGML_TYPE_F32);
18501850
case GGML_OP_POOL_1D:
18511851
return false;
18521852
case GGML_OP_UPSCALE:
@@ -4703,7 +4703,6 @@ static int ggml_metal_encode_node(
47034703
{
47044704
GGML_ASSERT(ggml_is_contiguous(src0));
47054705
GGML_ASSERT(ggml_is_contiguous(src1));
4706-
GGML_ASSERT(src0->type == GGML_TYPE_F16);
47074706
GGML_ASSERT(src1->type == GGML_TYPE_F32);
47084707
GGML_ASSERT( dst->type == GGML_TYPE_F16 || dst->type == GGML_TYPE_F32);
47094708

0 commit comments

Comments
 (0)