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

+2 -2
View File
@@ -244,9 +244,9 @@ namespace Ideogram4 {
auto w2 = std::dynamic_pointer_cast<Linear>(blocks["w2"]);
auto w3 = std::dynamic_pointer_cast<Linear>(blocks["w3"]);
auto x1 = ggml_silu(ctx->ggml_ctx, w1->forward(ctx, x));
auto x1 = w1->forward(ctx, x);
auto x3 = w3->forward(ctx, x);
x = ggml_mul(ctx->ggml_ctx, x1, x3);
x = ggml_swiglu_split(ctx->ggml_ctx, x1, x3);
x = w2->forward(ctx, x);
return x;
}