diff --git a/src/llama-quant.cpp b/src/llama-quant.cpp index f91d795b3e96..db71f47072d0 100644 --- a/src/llama-quant.cpp +++ b/src/llama-quant.cpp @@ -673,8 +673,10 @@ static ggml_type llama_tensor_get_type(quantize_state_impl & qs, const llama_mod // get more optimal quantization type based on the tensor shape, layer, etc. if (!params->pure && ggml_is_quantized(default_type)) { - // if the user provided tensor types - use those - bool manual = false; + // use the standard logic for choosing the quantization type based on the selected mixture + new_type = llama_tensor_get_type_impl(qs, new_type, tensor, params->ftype, tm.category); + + // if the user provided tensor types - use those instead if (!qs.tensor_type_patterns.empty()) { const std::string tensor_name(tensor->name); for (const auto & [pattern, qtype] : qs.tensor_type_patterns) { @@ -683,18 +685,12 @@ 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; } } } } - // if not manual - use the standard logic for choosing the quantization type based on the selected mixture - if (!manual) { - new_type = llama_tensor_get_type_impl(qs, new_type, tensor, params->ftype, tm.category); - } - // incompatible tensor shapes are handled here - fallback to a compatible type new_type = tensor_type_fallback(qs, tensor, new_type); }