Skip to content

Commit 66cb20f

Browse files
committed
Use rope_type variable instead of direct definition
1 parent e969238 commit 66cb20f

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/llama-model.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18137,9 +18137,8 @@ struct llm_build_cogvlm : public llm_graph_context {
1813718137

1813818138
Vcur = ggml_reshape_3d(ctx0, Vcur, n_embd_head, n_head_kv, n_tokens);
1813918139

18140-
// TODO: Check Rope because this might not be the same as cogvlm
18141-
Qcur = ggml_rope(ctx0, Qcur, inp_pos, n_embd_head, GGML_ROPE_TYPE_NEOX);
18142-
Kcur = ggml_rope(ctx0, Kcur, inp_pos, n_embd_head, GGML_ROPE_TYPE_NEOX);
18140+
Qcur = ggml_rope(ctx0, Qcur, inp_pos, n_embd_head, rope_type);
18141+
Kcur = ggml_rope(ctx0, Kcur, inp_pos, n_embd_head, rope_type);
1814318142

1814418143
cur = build_attn(inp_attn, wo, nullptr, Qcur, Kcur, Vcur, nullptr, nullptr, kq_scale, il);
1814518144
cb(cur, "attn_out", il);
@@ -18151,12 +18150,6 @@ struct llm_build_cogvlm : public llm_graph_context {
1815118150
cur = build_norm(ffn_inp, model.layers[il].ffn_norm, NULL, LLM_NORM_RMS, il);
1815218151
cb(cur, "ffn_norm", il);
1815318152

18154-
// Make a standard ffn without the build_ffn function
18155-
//ggml_tensor * tmp = build_lora_mm(ffn_up, cur);
18156-
//ggml_tensor * gate = build_lora_mm(ffn_gate, cur);
18157-
//gate = ggml_silu(ctx0, gate);
18158-
//cur = ggml_mul(ctx0, gate, tmp);
18159-
//cur = build_lora_mm(ffn_down, cur);
1816018153
cur = build_ffn(cur,
1816118154
ffn_up, NULL, NULL,
1816218155
ffn_gate, NULL, NULL,
@@ -18812,7 +18805,6 @@ llama_rope_type llama_model_rope_type(const llama_model * model) {
1881218805
case LLM_ARCH_ARCEE:
1881318806
case LLM_ARCH_ERNIE4_5:
1881418807
case LLM_ARCH_ERNIE4_5_MOE:
18815-
case LLM_ARCH_COGVLM:
1881618808
return LLAMA_ROPE_TYPE_NORM;
1881718809

1881818810
// the pairs of head values are offset by n_rot/2
@@ -18858,6 +18850,7 @@ llama_rope_type llama_model_rope_type(const llama_model * model) {
1885818850
case LLM_ARCH_LFM2:
1885918851
case LLM_ARCH_SMALLTHINKER:
1886018852
case LLM_ARCH_GLM4_MOE:
18853+
case LLM_ARCH_COGVLM:
1886118854
return LLAMA_ROPE_TYPE_NEOX;
1886218855

1886318856
case LLM_ARCH_QWEN2VL:

0 commit comments

Comments
 (0)