From 6a65a3735b5352feedaeffbd669cfd614845615b Mon Sep 17 00:00:00 2001 From: Ricardo-M-L <69202550+Ricardo-M-L@users.noreply.github.com> Date: Thu, 21 May 2026 06:03:10 +0800 Subject: [PATCH] fix(gguf): correct mismatched-shape error message in check_quantized_param_shape (#13504) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(gguf): correct mismatched-shape error message check_quantized_param_shape compares inferred_shape against current_param_shape, but the error message printed inferred_shape vs loaded_param_shape — and inferred_shape is derived from loaded_param_shape, so the reported mismatch was effectively self-referential and gave no signal about the model's expected shape. Print current_param_shape (what the model expected) vs inferred_shape (what the quantized weight decodes to) so the two sides of the comparison are actually visible. Noted by @Vargol in #13001. --- src/diffusers/quantizers/gguf/gguf_quantizer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/diffusers/quantizers/gguf/gguf_quantizer.py b/src/diffusers/quantizers/gguf/gguf_quantizer.py index 8a3d406249..42ea3982c9 100644 --- a/src/diffusers/quantizers/gguf/gguf_quantizer.py +++ b/src/diffusers/quantizers/gguf/gguf_quantizer.py @@ -85,7 +85,8 @@ class GGUFQuantizer(DiffusersQuantizer): inferred_shape = _quant_shape_from_byte_shape(loaded_param_shape, type_size, block_size) if inferred_shape != current_param_shape: raise ValueError( - f"{param_name} has an expected quantized shape of: {inferred_shape}, but received shape: {loaded_param_shape}" + f"{param_name} has an expected shape of: {current_param_shape}, but the loaded GGUF weight decodes " + f"to shape: {inferred_shape}" ) return True