From ad3a4ebc57f57a583fcac32ba9d231fc5c493172 Mon Sep 17 00:00:00 2001 From: saharNooby Date: Thu, 6 Apr 2023 20:26:31 +0400 Subject: [PATCH] Add missing labels and symbols for new operators --- ggml.c | 10 ++++++++++ ggml.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ggml.c b/ggml.c index 05304a8..6efd47e 100644 --- a/ggml.c +++ b/ggml.c @@ -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)", diff --git a/ggml.h b/ggml.h index 0b7f9a3..9ca2fe8 100644 --- a/ggml.h +++ b/ggml.h @@ -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.