Skip to content

Commit f6da8cb

Browse files
authored
CANN: Mask unsupported TRANSPOSE_1D operator (#15733)
CANN currently does not support kernels larger than 255. This change disables such cases.
1 parent 8a2234e commit f6da8cb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ggml/src/ggml-cann/aclnn_ops.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2803,16 +2803,14 @@ void ggml_cann_conv_transpose_1d(ggml_backend_cann_context& ctx, ggml_tensor* ds
28032803
aclIntArray *padding = aclCreateIntArray(paddingVal, 1);
28042804
int64_t dilationVal[] = {1};
28052805
aclIntArray *dilation = aclCreateIntArray(dilationVal, 1);
2806-
bool transposed = true;
2807-
int64_t groups = 1;
28082806
int8_t cubeMathType = 0;
28092807

28102808
#ifdef ASCEND_310P
28112809
cubeMathType = 1;
28122810
#endif
28132811

28142812
GGML_CANN_CALL_ACLNN_OP(ctx, Convolution, acl_input, acl_weight, nullptr, stride,
2815-
padding, dilation, transposed, padding, groups, acl_dst, cubeMathType);
2813+
padding, dilation, true, padding, 1, acl_dst, cubeMathType);
28162814

28172815
ggml_cann_release_resources(ctx, acl_weight, acl_dst, stride, padding, dilation);
28182816
}

ggml/src/ggml-cann/ggml-cann.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2479,12 +2479,14 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev,
24792479
case GGML_OP_ARGMAX:
24802480
case GGML_OP_COS:
24812481
case GGML_OP_SIN:
2482-
case GGML_OP_CONV_TRANSPOSE_1D:
24832482
case GGML_OP_LOG:
24842483
case GGML_OP_MEAN:
24852484
case GGML_OP_PAD_REFLECT_1D:
24862485
case GGML_OP_COUNT_EQUAL:
24872486
return true;
2487+
case GGML_OP_CONV_TRANSPOSE_1D:
2488+
// TODO: ((weightL - 1) * dilationW - padLeft)=1336 should not be larger than 255.
2489+
return (op->src[0]->ne[0] - 1) <= 255;
24882490
case GGML_OP_SCALE:
24892491
float bias;
24902492
memcpy(&bias, (const float *)(op->op_params) + 1, sizeof(float));

0 commit comments

Comments
 (0)