@@ -2558,6 +2558,9 @@ struct llama_hparams {
25582558 if (this->rope_finetuned != other.rope_finetuned) return true;
25592559 if (this->n_ctx_orig_yarn != other.n_ctx_orig_yarn) return true;
25602560 if (this->rope_sections != other.rope_sections) return true;
2561+ if (std::equal(std::begin(this->rope_sections),
2562+ std::end(this->rope_sections),
2563+ std::begin(other.rope_sections))) return true;
25612564
25622565 if (this->ssm_d_conv != other.ssm_d_conv) return true;
25632566 if (this->ssm_d_inner != other.ssm_d_inner) return true;
@@ -3421,8 +3424,6 @@ struct llama_context {
34213424 struct ggml_tensor * inp_tokens; // I32 [n_batch]
34223425 struct ggml_tensor * inp_embd; // F32 [n_embd, n_batch]
34233426 struct ggml_tensor * inp_pos; // I32 [n_batch]
3424- struct ggml_tensor * inp_pos_w; // I32 [n_batch] second-dimension of m-rope position index
3425- struct ggml_tensor * inp_pos_h; // I32 [n_batch] third-dimension of m-rope position index
34263427 struct ggml_tensor * inp_out_ids; // I32 [n_outputs]
34273428 struct ggml_tensor * inp_KQ_mask; // F32 [kv_size, n_batch]
34283429 struct ggml_tensor * inp_KQ_mask_swa; // F32 [kv_size, n_batch]
@@ -12606,7 +12607,6 @@ struct llm_build_context {
1260612607 inpL = llm_build_inp_embd(ctx0, lctx, hparams, ubatch, model.tok_embd, cb);
1260712608
1260812609 // inp_pos - contains the positions
12609- // struct ggml_tensor * inp_pos = build_inp_pos();
1261012610 lctx.inp_pos = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, n_tokens * 4);
1261112611 cb(lctx.inp_pos, "inp_pos", -1);
1261212612 ggml_set_input(lctx.inp_pos);
@@ -12646,14 +12646,15 @@ struct llm_build_context {
1264612646
1264712647 Qcur = ggml_rope_multi(
1264812648 ctx0,
12649- ggml_reshape_3d(ctx0, Qcur, n_embd_head, n_head, n_tokens), inp_pos, nullptr,
12649+ ggml_reshape_3d(ctx0, Qcur, n_embd_head, n_head, n_tokens), inp_pos, nullptr,
1265012650 n_rot, sections, rope_type, n_ctx_orig, freq_base, freq_scale,
1265112651 ext_factor, attn_factor, beta_fast, beta_slow
1265212652 );
1265312653 cb(Qcur, "Qcur", il);
1265412654
1265512655 Kcur = ggml_rope_multi(
12656- ctx0, ggml_reshape_3d(ctx0, Kcur, n_embd_head, n_head_kv, n_tokens), inp_pos, nullptr,
12656+ ctx0,
12657+ ggml_reshape_3d(ctx0, Kcur, n_embd_head, n_head_kv, n_tokens), inp_pos, nullptr,
1265712658 n_rot, sections, rope_type, n_ctx_orig, freq_base, freq_scale,
1265812659 ext_factor, attn_factor, beta_fast, beta_slow
1265912660 );
0 commit comments