mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 11:26:34 +00:00
refactor: replace manual gated activations with native ggml GLU (#2250)
This commit is contained in:
1 parent
37bc88b5e9
commit
e239e4b0fd
13 files changed
+33
-53
No files matched your search
@@ -207,9 +207,9 @@ namespace MiniT2I {
|
||||
auto w1 = std::dynamic_pointer_cast<Linear>(blocks["w1"]);
|
||||
auto w3 = std::dynamic_pointer_cast<Linear>(blocks["w3"]);
|
||||
auto w2 = std::dynamic_pointer_cast<Linear>(blocks["w2"]);
|
||||
auto gate = ggml_silu(ctx->ggml_ctx, w1->forward(ctx, x));
|
||||
auto gate = w1->forward(ctx, x);
|
||||
auto up = w3->forward(ctx, x);
|
||||
return w2->forward(ctx, ggml_mul(ctx->ggml_ctx, gate, up));
|
||||
return w2->forward(ctx, ggml_swiglu_split(ctx->ggml_ctx, gate, up));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user