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
This commit is contained in:
Marco Colombo
2026-09-16 08:38:44 -07:00
committed by GitHub
parent 7ceed8737f
commit 82324fc508
+4 -2
View File
@@ -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;
}