From 7c5abdae0fd0e68cc6618667e5a762ae6b3594ae Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Mon, 3 Aug 2026 13:21:29 +0200 Subject: [PATCH] DFlash: inherit rope type from the linked target. Another option would be to store it in the gguf file itself. --- src/llama-graph.cpp | 5 ++++- src/llama-model.cpp | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/llama-graph.cpp b/src/llama-graph.cpp index 6d1c8f4e42..de44586ae2 100644 --- a/src/llama-graph.cpp +++ b/src/llama-graph.cpp @@ -1350,7 +1350,10 @@ llm_graph_context::llm_graph_context(const llm_graph_params & params) : n_outputs (params.n_outputs), n_ctx_orig (cparams.n_ctx_orig_yarn), pooling_type (cparams.pooling_type), - rope_type (hparams.rope_type), + // DFlash: inherit rope type from the linked target + rope_type ((arch == LLM_ARCH_DFLASH && cparams.ctx_other != nullptr) + ? llama_get_model(cparams.ctx_other)->hparams.rope_type + : hparams.rope_type), sched (params.sched), backend_cpu (params.backend_cpu), cvec (params.cvec), diff --git a/src/llama-model.cpp b/src/llama-model.cpp index 2180d36b2a..1b9bc6f9fa 100644 --- a/src/llama-model.cpp +++ b/src/llama-model.cpp @@ -2623,6 +2623,7 @@ llama_rope_type llama_model_rope_type(const llama_model * model) { case LLM_ARCH_STEP35: case LLM_ARCH_TALKIE: case LLM_ARCH_MELLUM: + // fallback, dflash rope is inherited from the linked target case LLM_ARCH_DFLASH: return LLAMA_ROPE_TYPE_NEOX;