refactor: replace QKV split helpers with ggml_ext_chunk (#2322)

This commit is contained in:
leejet authored and GitHub committed 2026-11-10 23:38:47 +08:00
1 parent 0bb132831f
commit 56070ea034
11 files changed
+12 -50

No files matched your search

+1 -1
View File
@@ -222,7 +222,7 @@ namespace Ideogram4 {
auto out_proj = std::dynamic_pointer_cast<Linear>(blocks["o"]);
auto qkv = qkv_proj->forward(ctx, x);
auto qkv_vec = ggml_ext_split_qkv(ctx, qkv);
auto qkv_vec = ggml_ext_chunk(ctx, qkv, 3, 0);
auto q = ggml_reshape_4d(ctx->ggml_ctx, qkv_vec[0], head_dim, num_heads, n_token, N);
auto k = ggml_reshape_4d(ctx->ggml_ctx, qkv_vec[1], head_dim, num_heads, n_token, N);
auto v = ggml_reshape_4d(ctx->ggml_ctx, qkv_vec[2], head_dim, num_heads, n_token, N);