implement unary REGLU/GEGLU/SWIGLU cpu ops

This commit is contained in:
Sigbjørn Skjæret
2025-06-12 17:39:56 +02:00
committed by Akarshan
parent aa064b2eb7
commit 76c9bc1731
8 changed files with 493 additions and 22 deletions

View File

@@ -538,6 +538,9 @@ extern "C" {
GGML_UNARY_OP_HARDSIGMOID,
GGML_UNARY_OP_EXP,
GGML_UNARY_OP_GELU_ERF,
GGML_UNARY_OP_REGLU,
GGML_UNARY_OP_GEGLU,
GGML_UNARY_OP_SWIGLU,
GGML_UNARY_OP_COUNT,
};
@@ -1086,6 +1089,18 @@ extern "C" {
struct ggml_context * ctx,
struct ggml_tensor * a);
GGML_API struct ggml_tensor * ggml_reglu(
struct ggml_context * ctx,
struct ggml_tensor * a);
GGML_API struct ggml_tensor * ggml_geglu(
struct ggml_context * ctx,
struct ggml_tensor * a);
GGML_API struct ggml_tensor * ggml_swiglu(
struct ggml_context * ctx,
struct ggml_tensor * a);
// normalize along rows
GGML_API struct ggml_tensor * ggml_norm(
struct ggml_context * ctx,