From f1f6929ea6b83d362403b7e9cd99db90fc725fe0 Mon Sep 17 00:00:00 2001 From: Tai An Date: Thu, 30 Apr 2026 09:23:08 -0700 Subject: [PATCH] llama-quant : honor explicit --tensor-type override even when it matches the global type (#22544) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #22544. When a user supplies an explicit `--tensor-type` mapping that happens to match the requested global ftype, the previous code only set `manual = true` inside the `qtype != new_type` branch, so it was never flipped on the equal-type case. Control then fell through to `llama_tensor_get_type_impl`, which is free to override the user's choice via imatrix/heuristics — exactly what `--tensor-type` is meant to suppress. Set `manual = true` and break out of the pattern loop unconditionally once a pattern matches; only emit the override log line when the requested type actually differs from the current one. --- src/llama-quant.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llama-quant.cpp b/src/llama-quant.cpp index 25a333b4a7f1..2f0f70b73b6c 100644 --- a/src/llama-quant.cpp +++ b/src/llama-quant.cpp @@ -683,9 +683,9 @@ static ggml_type llama_tensor_get_type(quantize_state_impl & qs, const llama_mod LLAMA_LOG_WARN("%s: %-36s - applying manual override: %s -> %s\n", __func__, tensor_name.c_str(), ggml_type_name(new_type), ggml_type_name(qtype)); new_type = qtype; - manual = true; - break; } + manual = true; + break; } } }