From 8be5dd9826138dc67d4ec65bf243eb32d75dc5c8 Mon Sep 17 00:00:00 2001 From: yzhou51 Date: Thu, 19 Nov 2026 15:25:31 +0800 Subject: [PATCH] ggml-openvino: one output in the decode model of a static NPU pair The decode model of a static prefill/decode pair copied the compute params of the prefill graph, including output_len. With llama-perplexity the prefill graph has many outputs (128 at -c 256), so the decode model gathered 128 rows from its one token in the last layer. For a MoE model that layer then differs from the others and NPUW fails to lower its experts ("could not lower the isolated expert partition"). A decode step outputs one token; the model cache key already assumes it (decode_signature out=1). --- ggml/src/ggml-openvino/utils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ggml/src/ggml-openvino/utils.cpp b/ggml/src/ggml-openvino/utils.cpp index 295895a56cac..eb6e79929bc9 100644 --- a/ggml/src/ggml-openvino/utils.cpp +++ b/ggml/src/ggml-openvino/utils.cpp @@ -2398,6 +2398,10 @@ enum ggml_status ov_graph_compute_static(ggml_cgraph * cgraph, const std::shared } } else { auto decode_c_params = c_params; + // A decode step outputs its one token. llama-perplexity asks for many outputs in the prefill graph; the + // decode model of the pair keeps one (decode_signature below), or its last layer would gather more rows + // than the graph has tokens. + decode_c_params.output_len = 1; if (ggml_openvino_kv_slice_enabled()) { decode_c_params.attention_size = m_params.ctx_per_seq; decode_c_params.attention_size_swa = m_params.ctx_per_seq_swa;