From f2478bcab58d08fd528d9b579e57fd85570ee1cf Mon Sep 17 00:00:00 2001 From: Gabe Goodhart Date: Mon, 9 Dec 2024 13:43:27 -0700 Subject: [PATCH] fix: Get n_head_kv per-layer in build_bamba Branch: BambaArchitecture Signed-off-by: Gabe Goodhart --- src/llama.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/llama.cpp b/src/llama.cpp index ade7e52f3..0d97e54c3 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -14710,14 +14710,15 @@ struct llm_build_context { } Qcur = ggml_rope_ext( - ctx0, ggml_reshape_3d(ctx0, Qcur, n_embd_head, n_head, n_tokens), inp_pos, rope_factors, + ctx0, ggml_reshape_3d(ctx0, Qcur, n_embd_head, hparams.n_head(il), n_tokens), inp_pos, rope_factors, n_rot, rope_type, n_ctx_orig, freq_base, freq_scale, ext_factor, attn_factor, beta_fast, beta_slow ); cb(Qcur, "Qcur", il); + LLAMA_LOG_DEBUG("%s[%d]: 9. ggml_rope_ext\n", __func__, il); Kcur = ggml_rope_ext( - ctx0, ggml_reshape_3d(ctx0, Kcur, n_embd_head, n_head_kv, n_tokens), inp_pos, rope_factors, + ctx0, ggml_reshape_3d(ctx0, Kcur, n_embd_head, hparams.n_head_kv(il), n_tokens), inp_pos, rope_factors, n_rot, rope_type, n_ctx_orig, freq_base, freq_scale, ext_factor, attn_factor, beta_fast, beta_slow );