8 Commits

Author SHA1 Message Date
LI bd38ca5b0c arm/riscv: avoid fp16 GELU overflow (#7060) 2026-10-12 14:07:42 +08:00
nihui 9f9d4ec815 reduce gpu test cases (#7017) 2026-10-01 23:33:05 +08:00
Linton fa5754e864 arm: fix fp16 tanh_ps_f16 saturating at 1.044 instead of 1.0 (#6979)
The fp32 rational approximation coefficients cannot be represented in
half precision: alpha_9/11/13 underflow to zero and alpha_7 becomes
subnormal, so tanh_ps_f16 saturates at ~1.044 and fast gelu returns
+0.022*|x| for large negative inputs. Transformer models with large
activations (SigLIP2, CLIP ViT) produce input-independent features under
use_fp16_arithmetic.

Refit the rational approximation for fp16 on [0, 4.5], return +/-1
beyond that range, clamp the result to 1, and add large-magnitude test
cases for GELU and TanH.
2026-09-09 14:33:58 +08:00
nihui 171b9d1bba use spdx license header, copyright Tencent (#6152) 2025-07-08 11:01:29 +08:00
nihui 556b79ce4d create layer decoupled (#5258)
* create layer decoupled
* no more virtual public
* allow build test with shared library
* decouple cpu vulkan
* drop old scripts
2024-01-05 14:08:15 +08:00
nihui a37a83d850 clip gelu mish tanh 4d (#4695) 2023-05-04 15:55:50 +08:00
Lry89757 5eb56b2ea5 [Gelu x86] Finish intrinsic with elempack merged(fast version) (#4144)
* Finish the gelu x86 intrinsics
* Finish the fast tanh x86 simd impl
2022-09-18 13:07:37 +08:00
RBelogorodtsevFBase 1212ed6e94 implements gelu activation (#2749) 2021-03-12 22:25:25 +08:00