Skip to content

Commit 5e43f10

Browse files
authored
SYCL: Disable f16 Unary OPs as not supported by the kernels (#12201)
1 parent 16e4b22 commit 5e43f10

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

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

+10-8
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "ggml-sycl/gemm.hpp"
4242
#include "ggml-sycl/sycl_hw.hpp"
4343
#include "ggml-sycl/getrows.hpp"
44+
#include "ggml.h"
4445

4546
static bool g_sycl_loaded = false;
4647
int g_ggml_sycl_debug = 0;
@@ -3864,7 +3865,7 @@ static bool ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, const g
38643865
case GGML_UNARY_OP_GELU_QUICK:
38653866
case GGML_UNARY_OP_TANH:
38663867
case GGML_UNARY_OP_EXP:
3867-
return ggml_is_contiguous(op->src[0]);
3868+
return ggml_is_contiguous(op->src[0]) && (op->src[0]->type == GGML_TYPE_F32);
38683869
default:
38693870
return false;
38703871
}
@@ -3981,23 +3982,24 @@ static bool ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, const g
39813982
case GGML_OP_VIEW:
39823983
case GGML_OP_PERMUTE:
39833984
case GGML_OP_TRANSPOSE:
3985+
return true;
39843986
case GGML_OP_ADD:
39853987
case GGML_OP_ADD1:
3986-
case GGML_OP_LOG:
39873988
case GGML_OP_SUB:
39883989
case GGML_OP_MUL:
39893990
case GGML_OP_DIV:
3990-
return true;
3991-
case GGML_OP_NORM:
3992-
case GGML_OP_RMS_NORM:
3993-
case GGML_OP_GROUP_NORM:
3994-
return ggml_is_contiguous(op->src[0]);
3995-
case GGML_OP_SCALE:
39963991
case GGML_OP_SQR:
39973992
case GGML_OP_SQRT:
39983993
case GGML_OP_SIN:
39993994
case GGML_OP_COS:
40003995
case GGML_OP_CLAMP:
3996+
case GGML_OP_LOG:
3997+
return (op->src[0]->type == GGML_TYPE_F32);
3998+
case GGML_OP_NORM:
3999+
case GGML_OP_RMS_NORM:
4000+
case GGML_OP_GROUP_NORM:
4001+
return ggml_is_contiguous(op->src[0]);
4002+
case GGML_OP_SCALE:
40014003
return true;
40024004
case GGML_OP_CONT:
40034005
return op->src[0]->type != GGML_TYPE_BF16;

0 commit comments

Comments
 (0)