From 55dbee2bbe1059dac78eb139869c0aa189558df2 Mon Sep 17 00:00:00 2001 From: ddh0 Date: Wed, 11 Feb 2026 21:03:34 -0600 Subject: [PATCH] fixup tensor_requires_imatrix --- src/llama-quant.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/llama-quant.cpp b/src/llama-quant.cpp index c411d41153..252fbe2085 100644 --- a/src/llama-quant.cpp +++ b/src/llama-quant.cpp @@ -480,19 +480,18 @@ static size_t llama_tensor_quantize_impl(enum ggml_type new_type, const float * } static bool tensor_requires_imatrix(const llama_model_quantize_params * params, const ggml_tensor * t, const ggml_type dst_type) { - if (!params->imatrix) { - if ( - dst_type == GGML_TYPE_IQ2_XXS || dst_type == GGML_TYPE_IQ2_XS || - dst_type == GGML_TYPE_IQ2_S || dst_type == GGML_TYPE_IQ1_S || ( - dst_type == GGML_TYPE_IQ1_M && strcmp(t->name, "token_embd.weight") && - strcmp(t->name, "output.weight") - ) || ( - dst_type == GGML_TYPE_Q2_K && params->ftype == LLAMA_FTYPE_MOSTLY_Q2_K_S && - strcmp(t->name, "token_embd.weight") != 0 - ) - ) return true; + if (dst_type == GGML_TYPE_IQ2_XXS || dst_type == GGML_TYPE_IQ2_XS || + dst_type == GGML_TYPE_IQ2_S || dst_type == GGML_TYPE_IQ1_S || ( + dst_type == GGML_TYPE_IQ1_M && strcmp(t->name, "token_embd.weight") && + strcmp(t->name, "output.weight") + ) || ( + dst_type == GGML_TYPE_Q2_K && params->ftype == LLAMA_FTYPE_MOSTLY_Q2_K_S && + strcmp(t->name, "token_embd.weight") != 0 + )) { + return true; + } else { + return false; } - return false; } static void llama_model_quantize_impl(const std::string & fname_inp, const std::string & fname_out, const llama_model_quantize_params * params) {