Skip to content

Commit 58728bd

Browse files
authored
sycl : Enable to support fp16 by OPs: SQR, SQRT, LOG, SIN, COS, CLAMP (#24692)
1 parent ebbc1e5 commit 58728bd

3 files changed

Lines changed: 28 additions & 33 deletions

File tree

docs/ops.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Legend:
2323
| ARGMAX ||||||||||||
2424
| ARGSORT |||||| 🟡 | 🟡 |||||
2525
| CEIL |||| 🟡 ||||||||
26-
| CLAMP |||||| 🟡 | 🟡 | 🟡 ||||
26+
| CLAMP |||||| 🟡 | | 🟡 ||||
2727
| COL2IM_1D ||||||||||||
2828
| CONCAT |||| 🟡 || 🟡 ||||||
2929
| CONT || 🟡 |||| 🟡 | 🟡 || 🟡 |||
@@ -32,7 +32,7 @@ Legend:
3232
| CONV_3D ||||||||||||
3333
| CONV_TRANSPOSE_1D ||||||||||||
3434
| CONV_TRANSPOSE_2D ||||||||||||
35-
| COS ||||||| 🟡 | 🟡 ||||
35+
| COS ||||||| | 🟡 ||||
3636
| COUNT_EQUAL ||||||||||||
3737
| CPY || 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 |||
3838
| CROSS_ENTROPY_LOSS ||||||||||||
@@ -65,7 +65,7 @@ Legend:
6565
| IM2COL_3D ||||||||||||
6666
| L2_NORM ||||||||||||
6767
| LEAKY_RELU ||||| 🟡 ||| 🟡 ||||
68-
| LOG ||||||| 🟡 |||||
68+
| LOG ||||||| |||||
6969
| MEAN ||||||||||||
7070
| MUL ||||| 🟡 |||||||
7171
| MUL_MAT | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 |
@@ -99,13 +99,13 @@ Legend:
9999
| SIGMOID |||| 🟡 || 🟡 ||||||
100100
| SILU |||| 🟡 || 🟡 ||||||
101101
| SILU_BACK ||||||||||||
102-
| SIN ||||||| 🟡 | 🟡 ||||
102+
| SIN ||||||| | 🟡 ||||
103103
| SOFTPLUS |||| 🟡 ||||||||
104104
| SOFT_MAX || 🟡 ||||||||||
105105
| SOFT_MAX_BACK ||| 🟡 | 🟡 ||| 🟡 |||||
106106
| SOLVE_TRI |||| 🟡 ||| 🟡 |||||
107-
| SQR ||||||| 🟡 | 🟡 ||||
108-
| SQRT ||||||| 🟡 | 🟡 ||||
107+
| SQR ||||||| | 🟡 ||||
108+
| SQRT ||||||| | 🟡 ||||
109109
| SSM_CONV ||||||||||||
110110
| SSM_SCAN ||||||| 🟡 | 🟡 ||||
111111
| STEP |||| 🟡 ||||||||

docs/ops/SYCL.csv

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9743,29 +9743,29 @@
97439743
"SYCL0","ADD_ID","type_a=f32,type_b=f32,n_embd=129,n_experts=8,n_experts_used=4,n_token=1","support","1","yes","SYCL"
97449744
"SYCL0","ADD_ID","type_a=f32,type_b=f32,n_embd=129,n_experts=8,n_experts_used=4,n_token=32","support","1","yes","SYCL"
97459745
"SYCL0","ADD_ID","type_a=f32,type_b=f32,n_embd=129,n_experts=8,n_experts_used=4,n_token=129","support","1","yes","SYCL"
9746-
"SYCL0","SQR","type=f16,ne=[10,5,4,3]","support","0","no","SYCL"
9747-
"SYCL0","SQRT","type=f16,ne=[10,3,3,2]","support","0","no","SYCL"
9748-
"SYCL0","LOG","type=f16,ne=[10,5,4,3]","support","0","no","SYCL"
9749-
"SYCL0","SIN","type=f16,ne=[10,2,2,2]","support","0","no","SYCL"
9750-
"SYCL0","COS","type=f16,ne=[10,2,2,2]","support","0","no","SYCL"
9751-
"SYCL0","CLAMP","type=f16,ne=[10,5,4,3],min=-0.500000,max=0.500000","support","0","no","SYCL"
9746+
"SYCL0","SQR","type=f16,ne=[10,5,4,3]","support","1","yes","SYCL"
9747+
"SYCL0","SQRT","type=f16,ne=[10,3,3,2]","support","1","yes","SYCL"
9748+
"SYCL0","LOG","type=f16,ne=[10,5,4,3]","support","1","yes","SYCL"
9749+
"SYCL0","SIN","type=f16,ne=[10,2,2,2]","support","1","yes","SYCL"
9750+
"SYCL0","COS","type=f16,ne=[10,2,2,2]","support","1","yes","SYCL"
9751+
"SYCL0","CLAMP","type=f16,ne=[10,5,4,3],min=-0.500000,max=0.500000","support","1","yes","SYCL"
97529752
"SYCL0","LEAKY_RELU","type=f16,ne_a=[10,5,4,3],negative_slope=0.100000","support","1","yes","SYCL"
97539753
"SYCL0","FLOOR","type=f16,ne=[10,2,2,2]","support","1","yes","SYCL"
97549754
"SYCL0","CEIL","type=f16,ne=[10,2,2,2]","support","1","yes","SYCL"
97559755
"SYCL0","ROUND","type=f16,ne=[10,2,2,2]","support","1","yes","SYCL"
97569756
"SYCL0","TRUNC","type=f16,ne=[10,2,2,2]","support","1","yes","SYCL"
9757-
"SYCL0","SQR","type=f16,ne=[7,1,5,3]","support","0","no","SYCL"
9758-
"SYCL0","SQR","type=f16,ne=[1024,1024,1,1]","support","0","no","SYCL"
9759-
"SYCL0","SQRT","type=f16,ne=[7,1,5,3]","support","0","no","SYCL"
9760-
"SYCL0","SQRT","type=f16,ne=[1024,1024,1,1]","support","0","no","SYCL"
9761-
"SYCL0","LOG","type=f16,ne=[7,1,5,3]","support","0","no","SYCL"
9762-
"SYCL0","LOG","type=f16,ne=[1024,1024,1,1]","support","0","no","SYCL"
9763-
"SYCL0","SIN","type=f16,ne=[7,1,5,3]","support","0","no","SYCL"
9764-
"SYCL0","SIN","type=f16,ne=[1024,1024,1,1]","support","0","no","SYCL"
9765-
"SYCL0","COS","type=f16,ne=[7,1,5,3]","support","0","no","SYCL"
9766-
"SYCL0","COS","type=f16,ne=[1024,1024,1,1]","support","0","no","SYCL"
9767-
"SYCL0","CLAMP","type=f16,ne=[7,1,5,3],min=-0.500000,max=0.500000","support","0","no","SYCL"
9768-
"SYCL0","CLAMP","type=f16,ne=[1024,1024,1,1],min=-0.500000,max=0.500000","support","0","no","SYCL"
9757+
"SYCL0","SQR","type=f16,ne=[7,1,5,3]","support","1","yes","SYCL"
9758+
"SYCL0","SQR","type=f16,ne=[1024,1024,1,1]","support","1","yes","SYCL"
9759+
"SYCL0","SQRT","type=f16,ne=[7,1,5,3]","support","1","yes","SYCL"
9760+
"SYCL0","SQRT","type=f16,ne=[1024,1024,1,1]","support","1","yes","SYCL"
9761+
"SYCL0","LOG","type=f16,ne=[7,1,5,3]","support","1","yes","SYCL"
9762+
"SYCL0","LOG","type=f16,ne=[1024,1024,1,1]","support","1","yes","SYCL"
9763+
"SYCL0","SIN","type=f16,ne=[7,1,5,3]","support","1","yes","SYCL"
9764+
"SYCL0","SIN","type=f16,ne=[1024,1024,1,1]","support","1","yes","SYCL"
9765+
"SYCL0","COS","type=f16,ne=[7,1,5,3]","support","1","yes","SYCL"
9766+
"SYCL0","COS","type=f16,ne=[1024,1024,1,1]","support","1","yes","SYCL"
9767+
"SYCL0","CLAMP","type=f16,ne=[7,1,5,3],min=-0.500000,max=0.500000","support","1","yes","SYCL"
9768+
"SYCL0","CLAMP","type=f16,ne=[1024,1024,1,1],min=-0.500000,max=0.500000","support","1","yes","SYCL"
97699769
"SYCL0","LEAKY_RELU","type=f16,ne_a=[7,1,5,3],negative_slope=0.100000","support","1","yes","SYCL"
97709770
"SYCL0","LEAKY_RELU","type=f16,ne_a=[1024,1024,1,1],negative_slope=0.100000","support","1","yes","SYCL"
97719771
"SYCL0","FLOOR","type=f16,ne=[7,1,5,3]","support","1","yes","SYCL"
@@ -11046,8 +11046,8 @@
1104611046
"SYCL0","ARGSORT","type=f32,ne=[8192,1,1,1],order=0","support","1","yes","SYCL"
1104711047
"SYCL0","ARGSORT","type=f32,ne=[16383,1,1,1],order=0","support","1","yes","SYCL"
1104811048
"SYCL0","ARGSORT","type=f32,ne=[16384,1,1,1],order=0","support","1","yes","SYCL"
11049-
"SYCL0","ARGSORT","type=f32,ne=[32767,1,1,1],order=0","support","0","no","SYCL"
11050-
"SYCL0","ARGSORT","type=f32,ne=[32768,1,1,1],order=0","support","0","no","SYCL"
11049+
"SYCL0","ARGSORT","type=f32,ne=[32767,1,1,1],order=0","support","1","yes","SYCL"
11050+
"SYCL0","ARGSORT","type=f32,ne=[32768,1,1,1],order=0","support","1","yes","SYCL"
1105111051
"SYCL0","ARGSORT","type=f32,ne=[65535,1,1,1],order=0","support","0","no","SYCL"
1105211052
"SYCL0","ARGSORT","type=f32,ne=[65536,1,1,1],order=0","support","0","no","SYCL"
1105311053
"SYCL0","ARGSORT","type=f32,ne=[131071,1,1,1],order=0","support","0","no","SYCL"
@@ -11095,8 +11095,8 @@
1109511095
"SYCL0","ARGSORT","type=f32,ne=[8192,1,1,1],order=0","support","1","yes","SYCL"
1109611096
"SYCL0","ARGSORT","type=f32,ne=[16383,1,1,1],order=0","support","1","yes","SYCL"
1109711097
"SYCL0","ARGSORT","type=f32,ne=[16384,1,1,1],order=0","support","1","yes","SYCL"
11098-
"SYCL0","ARGSORT","type=f32,ne=[32767,1,1,1],order=0","support","0","no","SYCL"
11099-
"SYCL0","ARGSORT","type=f32,ne=[32768,1,1,1],order=0","support","0","no","SYCL"
11098+
"SYCL0","ARGSORT","type=f32,ne=[32767,1,1,1],order=0","support","1","yes","SYCL"
11099+
"SYCL0","ARGSORT","type=f32,ne=[32768,1,1,1],order=0","support","1","yes","SYCL"
1110011100
"SYCL0","ARGSORT","type=f32,ne=[65535,1,1,1],order=0","support","0","no","SYCL"
1110111101
"SYCL0","ARGSORT","type=f32,ne=[65536,1,1,1],order=0","support","0","no","SYCL"
1110211102
"SYCL0","ARGSORT","type=f32,ne=[131071,1,1,1],order=0","support","0","no","SYCL"

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5582,11 +5582,6 @@ static bool ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, const g
55825582
case GGML_OP_COS:
55835583
case GGML_OP_CLAMP:
55845584
case GGML_OP_LOG:
5585-
#if defined (GGML_SYCL_F16)
5586-
return ((op->type == GGML_TYPE_F32 || op->type == GGML_SYCL_F16) && (op->src[0]->type == GGML_TYPE_F32 || op->src[0]->type == GGML_SYCL_F16) && (op->type == op->src[0]->type));
5587-
#else
5588-
return (op->type == GGML_TYPE_F32 && op->src[0]->type == GGML_TYPE_F32) && (op->type == op->src[0]->type);
5589-
#endif
55905585
case GGML_OP_NORM:
55915586
case GGML_OP_L2_NORM:
55925587
case GGML_OP_GROUP_NORM:

0 commit comments

Comments
 (0)