Add missing labels and symbols for new operators

This commit is contained in:
saharNooby 2023-04-06 20:26:31 +04:00
parent d12088e164
commit ad3a4ebc57
2 changed files with 12 additions and 1 deletions

10
ggml.c
View File

@ -2477,9 +2477,14 @@ static const char * GGML_OP_LABEL[GGML_OP_COUNT] = {
"ABS",
"SGN",
"NEG",
"EXP",
"1_MINUS_X",
"MAX",
"STEP",
"RELU",
"GELU",
"SIGMOID",
"SILU",
"NORM",
"RMS_NORM",
@ -2521,9 +2526,14 @@ static const char * GGML_OP_SYMBOL[GGML_OP_COUNT] = {
"abs(x)",
"sgn(x)",
"-x",
"e^x",
"1-x",
"max(x,y)",
"step(x)",
"relu(x)",
"gelu(x)",
"sigmoid(x)",
"silu(x)",
"norm(x)",
"rms_norm(x)",

3
ggml.h
View File

@ -186,7 +186,8 @@
// - to `ggml_compute_forward` and call the forward dispatch function here.
// - to `ggml_compute_backward` and add `GGML_ASSERT(false)` here.
// - to `ggml_graph_compute` and add `node->n_tasks = 1` here.
// 6. Fix all assertions that check value of `GGML_OP_COUNT`: you've added 1 operator, so increment asserted value by one.
// 6. Add operator label to `GGML_OP_LABEL` array and operator symbol to `GGML_OP_SYMBOL` array.
// 7. Fix all assertions that check value of `GGML_OP_COUNT`: you've added 1 operator, so increment asserted value by one.
//
// When in doubt, consult the code of existing operators similar to that you're implementing.
// Resulting operator would work for the forward pass, but will lack backward implementation and multi-threading support.