refactor: replace manual gated activations with native ggml GLU (#2250)

This commit is contained in:
leejet authored and GitHub committed 2026-10-30 01:32:46 +08:00
1 parent 37bc88b5e9
commit e239e4b0fd
13 files changed
+33 -53

No files matched your search

+1 -2
View File
@@ -204,9 +204,8 @@ namespace ErnieImage {
auto linear_fc2 = std::dynamic_pointer_cast<Linear>(blocks["linear_fc2"]);
auto gate = gate_proj->forward(ctx, x);
gate = ggml_ext_gelu(ctx->ggml_ctx, gate);
x = up_proj->forward(ctx, x);
x = ggml_mul(ctx->ggml_ctx, x, gate);
x = ggml_geglu_split(ctx->ggml_ctx, gate, x);
x = linear_fc2->forward(ctx, x);
return x;
}