Skip to content

Commit 0fd90db

Browse files
authored
metal : remove contiguous assertion for src0 in IM2COL (ggml-org#15577)
* remove contiguous assertion for src0 in IM2COL * add contiguous check in supports_op
1 parent 4c37636 commit 0fd90db

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
@@ -1876,7 +1876,7 @@ static bool ggml_metal_supports_op(const struct ggml_backend_metal_device_contex
18761876
case GGML_OP_ROPE:
18771877
return true;
18781878
case GGML_OP_IM2COL:
1879-
return op->src[1]->type == GGML_TYPE_F32 && (op->type == GGML_TYPE_F16 || op->type == GGML_TYPE_F32);
1879+
return ggml_is_contiguous(op->src[1]) && op->src[1]->type == GGML_TYPE_F32 && (op->type == GGML_TYPE_F16 || op->type == GGML_TYPE_F32);
18801880
case GGML_OP_POOL_1D:
18811881
return false;
18821882
case GGML_OP_UPSCALE:
@@ -4731,7 +4731,6 @@ static int ggml_metal_encode_node(
47314731
} break;
47324732
case GGML_OP_IM2COL:
47334733
{
4734-
GGML_ASSERT(ggml_is_contiguous(src0));
47354734
GGML_ASSERT(ggml_is_contiguous(src1));
47364735
GGML_ASSERT(src1->type == GGML_TYPE_F32);
47374736
GGML_ASSERT( dst->type == GGML_TYPE_F16 || dst->type == GGML_TYPE_F32);

0 commit comments

Comments
 (0)