From 7fe1794cc3b52500792049605e4744d999c65dd7 Mon Sep 17 00:00:00 2001 From: ibrahim khadraoui <132432132+ibrahimkhadraoui@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:22:56 +0400 Subject: [PATCH 1/5] Update src/llama-hparams.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sigbjørn Skjæret --- src/llama-hparams.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llama-hparams.cpp b/src/llama-hparams.cpp index bf7aece8de..64e7831cf6 100644 --- a/src/llama-hparams.cpp +++ b/src/llama-hparams.cpp @@ -74,8 +74,8 @@ uint32_t llama_hparams::n_embd_r() const { // TODO: maybe support other convolution strides than 1 // NOTE: since the first column of the conv_state is shifted out each time, it's not actually needed // Corresponds to Mamba's conv_states size - - // check if the architecture is using d_ssm + + // check if the architecture is using d_ssm return (ssm_d_conv > 0 ? ssm_d_conv - 1 : 0) * (ssm_d_inner + 2*ssm_n_group*ssm_d_state); } From 40058c043f88a6d25e089c8854485dc8c121c2ef Mon Sep 17 00:00:00 2001 From: ibrahim khadraoui <132432132+ibrahimkhadraoui@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:23:10 +0400 Subject: [PATCH 2/5] Update src/llama-model.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sigbjørn Skjæret --- src/llama-model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama-model.cpp b/src/llama-model.cpp index af37a83438..1d9c573a82 100644 --- a/src/llama-model.cpp +++ b/src/llama-model.cpp @@ -4600,7 +4600,7 @@ bool llama_model::load_tensors(llama_model_loader & ml) { if (output == NULL) { output = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, TENSOR_DUPLICATED); } - + for (int i = 0; i < n_layer; ++i) { auto & layer = layers[i]; layer.attn_norm = create_tensor(tn(LLM_TENSOR_ATTN_NORM, "weight", i), {n_embd}, 0); From debf4e5dd5bf9bb1c0ec8353e45a60cb9e9af826 Mon Sep 17 00:00:00 2001 From: ibrahim khadraoui <132432132+ibrahimkhadraoui@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:23:19 +0400 Subject: [PATCH 3/5] Update src/llama-model.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sigbjørn Skjæret --- src/llama-model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama-model.cpp b/src/llama-model.cpp index 1d9c573a82..4eb0cd5d13 100644 --- a/src/llama-model.cpp +++ b/src/llama-model.cpp @@ -14738,7 +14738,7 @@ struct llm_build_falcon_h1 : public llm_graph_context { inpSA = ggml_add(ctx0, cur, inpSA); cb(cur, "layer_out", il); - if (il == n_layer - 1 && inp_out_ids) { + if (il == n_layer - 1 && inp_out_ids) { cur = ggml_get_rows(ctx0, cur, inp_out_ids); inpSA = ggml_get_rows(ctx0, inpSA, inp_out_ids); } From 212edffd868780d541375c808bdf203447c6a4bb Mon Sep 17 00:00:00 2001 From: ibrahim khadraoui <132432132+ibrahimkhadraoui@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:23:37 +0400 Subject: [PATCH 4/5] Update src/llama-arch.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sigbjørn Skjæret --- src/llama-arch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama-arch.cpp b/src/llama-arch.cpp index 6509ca7f37..10c38d3691 100644 --- a/src/llama-arch.cpp +++ b/src/llama-arch.cpp @@ -129,7 +129,7 @@ static const std::map LLM_KV_NAMES = { { LLM_KV_EMBEDDING_SCALE, "%s.embedding_scale" }, { LLM_KV_TOKEN_SHIFT_COUNT, "%s.token_shift_count" }, { LLM_KV_INTERLEAVE_MOE_LAYER_STEP, "%s.interleave_moe_layer_step" }, - + { LLM_KV_ATTENTION_HEAD_COUNT, "%s.attention.head_count" }, { LLM_KV_ATTENTION_HEAD_COUNT_KV, "%s.attention.head_count_kv" }, { LLM_KV_ATTENTION_MAX_ALIBI_BIAS, "%s.attention.max_alibi_bias" }, From 90ddf2412ad3ecc154c409da1cfd17d2e884367f Mon Sep 17 00:00:00 2001 From: ibrahim khadraoui <132432132+ibrahimkhadraoui@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:23:56 +0400 Subject: [PATCH 5/5] Update convert_hf_to_gguf.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sigbjørn Skjæret --- convert_hf_to_gguf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index c015be5353..440898a45e 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -6669,7 +6669,7 @@ class FalconH1Model(Mamba2Model): # Add any other Falcon Mamba2 specific configuration self.gguf_writer.add_rope_freq_base(self.find_hparam(["rope_theta"])) - + @ModelBase.register("HunYuanMoEV1ForCausalLM") class HunYuanMoEModel(TextModel): model_arch = gguf.MODEL_ARCH.HUNYUAN_MOE