From 82324fc508006de234552e701f4509c72c4fdd8d Mon Sep 17 00:00:00 2001 From: Marco Colombo Date: Wed, 16 Sep 2026 17:38:44 +0200 Subject: [PATCH] hexagon: accept the zeroed rope probe in supports_op (#28995) llama probes weight placement with a rope where all params are 0, so rejecting n_dims == 0 or freq_base == 0 puts rope_freqs on the CPU. That splits the decode graph at every full-attention layer (gemma-4-E2B: 5 splits instead of 2). Assisted-by: Claude Opus 5 --- ggml/src/ggml-hexagon/ggml-hexagon.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ggml/src/ggml-hexagon/ggml-hexagon.cpp b/ggml/src/ggml-hexagon/ggml-hexagon.cpp index ec78013886..36b9f817cb 100644 --- a/ggml/src/ggml-hexagon/ggml-hexagon.cpp +++ b/ggml/src/ggml-hexagon/ggml-hexagon.cpp @@ -4986,7 +4986,9 @@ static bool ggml_hexagon_supported_rope(const struct ggml_hexagon_session * sess const int mode = op_params[2]; const int n_offs = op_params[15]; - if (n_dims <= 0 || n_dims % 2 != 0) { + // llama probes weight placement with a dummy rope where every param is 0 (llama-model-loader.cpp). + // Rejecting it puts rope_freqs on the CPU, which then splits the graph at every full-attention layer. + if (n_dims < 0 || n_dims % 2 != 0) { return false; } @@ -4997,7 +4999,7 @@ static bool ggml_hexagon_supported_rope(const struct ggml_hexagon_session * sess float freq_base; memcpy(&freq_base, op_params + 5, sizeof(float)); - if (freq_base <= 0.0f) { + if (freq_base < 0.0f) { return false; }