llama: fix kv shifting, add tests, add per-model build_rope (#31683)
* llama: fix kv shifting and add tests * llama: add graph build_rope (#31693) * llama: add graph build_rope * improve * migrate new models * update review skill * fix ci * add --kv-shift to CI
This commit is contained in:
1 parent
b1c902f026
commit
6023692b1e
144 files changed
+1154
-1847
No files matched your search
@@ -80,15 +80,13 @@ llama_model_command_r::graph::graph(const llm_graph_params & params) :
|
||||
Qcur = build_norm(Qcur, model.layers[il].attn_q_norm, NULL, LLM_NORM, il);
|
||||
cb(Qcur, "Qcur", il);
|
||||
}
|
||||
Qcur = ggml_rope_ext(ctx0, Qcur, inp_pos, nullptr, n_rot, rope_type, n_ctx_orig, freq_base, freq_scale,
|
||||
ext_factor, attn_factor, beta_fast, beta_slow);
|
||||
Qcur = build_rope(Qcur, inp_pos, il);
|
||||
|
||||
if (model.layers[il].attn_k_norm) {
|
||||
Kcur = build_norm(Kcur, model.layers[il].attn_k_norm, NULL, LLM_NORM, il);
|
||||
cb(Kcur, "Kcur", il);
|
||||
}
|
||||
Kcur = ggml_rope_ext(ctx0, Kcur, inp_pos, nullptr, n_rot, rope_type, n_ctx_orig, freq_base, freq_scale,
|
||||
ext_factor, attn_factor, beta_fast, beta_slow);
|
||||
Kcur = build_rope(Kcur, inp_pos, il);
|
||||
|
||||
cb(Qcur, "Qcur", il);
|
||||
cb(Kcur, "Kcur", il);
|
||||
|
||||
Reference in new issue
Block a user