Skip to content

Commit 8515811

Browse files
author
Phylliida
committed
Cleaned gating of non-circular pad devices
1 parent 624433d commit 8515811

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2554,6 +2554,9 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev, const ggml_ten
25542554
case GGML_OP_ARGSORT:
25552555
case GGML_OP_ACC:
25562556
case GGML_OP_GROUP_NORM:
2557+
case GGML_OP_PAD:
2558+
// TODO: add circular padding support for cann, see https://github.com/ggml-org/llama.cpp/pull/16985
2559+
return ggml_get_op_params_i32(op, 8) == 0;
25572560
case GGML_OP_ARANGE:
25582561
case GGML_OP_TIMESTEP_EMBEDDING:
25592562
case GGML_OP_LEAKY_RELU:
@@ -2565,8 +2568,6 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev, const ggml_ten
25652568
case GGML_OP_PAD_REFLECT_1D:
25662569
case GGML_OP_COUNT_EQUAL:
25672570
return true;
2568-
case GGML_OP_PAD:
2569-
return ggml_get_op_params_i32(op, 8) == 0;
25702571
case GGML_OP_OUT_PROD:
25712572
{
25722573
switch (op->src[0]->type) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ bool ggml_metal_device_supports_op(ggml_metal_device_t dev, const struct ggml_te
898898
case GGML_OP_POOL_2D:
899899
return op->src[0]->type == GGML_TYPE_F32;
900900
case GGML_OP_PAD:
901-
// TODO: add circular padding support https://github.com/ggml-org/llama.cpp/pull/16985
901+
// TODO: add circular padding support for metal, see https://github.com/ggml-org/llama.cpp/pull/16985
902902
if (ggml_get_op_params_i32(op, 8) != 0) {
903903
return false;
904904
}

ggml/src/ggml-opencl/ggml-opencl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,6 +2997,7 @@ static bool ggml_opencl_supports_op(ggml_backend_dev_t dev, const struct ggml_te
29972997
case GGML_OP_REPEAT:
29982998
return op->src[0]->type == GGML_TYPE_F32 && op->type == GGML_TYPE_F32; // Assuming F32 for now, can be expanded
29992999
case GGML_OP_PAD:
3000+
// TODO: add circular padding support for opencl, see https://github.com/ggml-org/llama.cpp/pull/16985
30003001
if (ggml_get_op_params_i32(op, 8) != 0) {
30013002
return false;
30023003
}

ggml/src/ggml-sycl/ggml-sycl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4607,6 +4607,7 @@ static bool ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, const g
46074607
case GGML_OP_ACC:
46084608
return true;
46094609
case GGML_OP_PAD:
4610+
// TODO: add circular padding support for syscl, see https://github.com/ggml-org/llama.cpp/pull/16985
46104611
if (ggml_get_op_params_i32(op, 8) != 0) {
46114612
return false;
46124613
}

0 commit comments

Comments
 (0)