From 67316774a00e747a11211ef5d4e326bfaf3ddeb8 Mon Sep 17 00:00:00 2001 From: claude-noether Date: Sat, 18 Jul 2026 15:21:55 +0200 Subject: [PATCH] ggml-rocket: make ROCKET_MIN_BATCH runtime-tunable via GGML_ROCKET_MIN_BATCH The offload gate (M < 32 -> CPU) was compile-time only. Reading the env var (default 32 unchanged) gives a clean NPU on/off toggle: GGML_ROCKET_MIN_BATCH=999999 forces CPU-only for benchmarking without rmmod or a CPU-only build. Used for the 2026-07-18 ampere NPU-vs-CPU gemma prefill benchmark. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01EWpfhDgYNA21tETDP9ueBE --- ggml/src/ggml-rocket/ggml-rocket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml-rocket/ggml-rocket.cpp b/ggml/src/ggml-rocket/ggml-rocket.cpp index 20e57f8e3..2a8665c81 100644 --- a/ggml/src/ggml-rocket/ggml-rocket.cpp +++ b/ggml/src/ggml-rocket/ggml-rocket.cpp @@ -384,7 +384,8 @@ static bool ggml_backend_rocket_device_supports_op(ggml_backend_dev_t dev, const const int64_t K = src1->ne[0]; // == src0->ne[0] const int64_t M = op->ne[1]; // batch rows (tokens) const char *why = NULL; - if (M < ROCKET_MIN_BATCH) why="Mtype != GGML_TYPE_F32) why="src1!=F32"; else if (!ggml_is_contiguous(src0)) why="src0 noncontig"; else if (!ggml_is_contiguous(src1)) why="src1 noncontig";