Skip to content

Commit 6a65a37

Browse files
authored
fix(gguf): correct mismatched-shape error message in check_quantized_param_shape (#13504)
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.
1 parent 0b8c0c0 commit 6a65a37

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/diffusers/quantizers/gguf/gguf_quantizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def check_quantized_param_shape(self, param_name, current_param, loaded_param):
8585
inferred_shape = _quant_shape_from_byte_shape(loaded_param_shape, type_size, block_size)
8686
if inferred_shape != current_param_shape:
8787
raise ValueError(
88-
f"{param_name} has an expected quantized shape of: {inferred_shape}, but received shape: {loaded_param_shape}"
88+
f"{param_name} has an expected shape of: {current_param_shape}, but the loaded GGUF weight decodes "
89+
f"to shape: {inferred_shape}"
8990
)
9091

9192
return True

0 commit comments

Comments
 (0)