diff options
Diffstat (limited to 'qwen_kernels.h')
| -rw-r--r-- | qwen_kernels.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qwen_kernels.h b/qwen_kernels.h index 36d2913..9abb489 100644 --- a/qwen_kernels.h +++ b/qwen_kernels.h @@ -111,6 +111,10 @@ void qwen_silu_mul_inplace(float *gate, const float *up, int n); * "gelu" activation HF BERT/BGE/MiniLM use, not the tanh approximation. */ void qwen_gelu_inplace(float *x, int n); +/* Tanh-approximation GeLU in place (HF gelu_new / gelu_pytorch_tanh): + * x = 0.5 * x * (1 + tanh(sqrt(2/pi) * (x + 0.044715 * x^3))). */ +void qwen_gelu_tanh_inplace(float *x, int n); + /* ======================================================================== * Attention Operations * ======================================================================== */ |
