You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] GPTQModel.load() of a quantized checkpoint silently drops unknown/misspelled kwargs (dtpye=, attn_implmentation=, bits=) and a passed quantize_config; the unquantized path raises TypeError for the same typo #4945
Found on main @ 3867c82, CPU (Qwen2.5-0.5B-Instruct GPTQ 4-bit checkpoint made on this commit).
What is wrong
GPTQModel.load() handles extra arguments differently on its two paths:
Unquantized model (from_pretrained): unknown keywords reach the HF model constructor and fail loudly, e.g. TypeError: Qwen2ForCausalLM.__init__() got an unexpected keyword argument 'dtpye'.
Quantized checkpoint (from_quantized): every unknown keyword is silently discarded. loader.from_quantized pops the keys it knows into kwargs_without_internal (gptqmodel/models/loader.py ~2460-2555). The rest go to QuantizeConfig.from_pretrained(model_local_path, **cached_file_kwargs, **kwargs_without_internal) (~2619), which pops only format/subfolder and ignores everything else (gptqmodel/quantization/config.py:5894). A misspelled real option (dtpye=, attn_implmentation=, devcie_map=) or an option that does not apply (bits=8) "succeeds" and changes nothing.
In the same way, GPTQModel.load(quantized_path, quantize_config) silently drops the quantize_config argument (auto.pyload() never forwards it to from_quantized). The checkpoint's own config is used and nothing is logged, even when the passed config is a different method/bits/group size.
This is the load-side twin of #4686 (quantized save(**kwargs) dropped every keyword, now a TypeError with a difflib suggestion) and of #4052/#4668 (config typos).
After from_quantized has consumed its known keys (HF hub/cache keys, max_memory, attn_implementation, the GGUF internals, ...), raise TypeError for whatever is left, with a difflib.get_close_matches hint, the same way save() does since #4686. QuantizeConfig.from_pretrained should not take **kwargs it never reads. When load() routes to from_quantized and a quantize_config was passed, either raise or at least warn that the checkpoint's config is used instead.
Test that should have caught it
There is no negative test for GPTQModel.load(quantized, <unknown kw>). Add one next to the #4686 save test (TypeError, message naming the key and a suggestion), plus one for load(quantized, quantize_config=...).
Severity
Low-medium. A typo in dtype/attn_implementation/device_map silently loads with defaults (wrong dtype or attention, on a GPU host possibly the wrong device). The same typo fails loudly on the unquantized path, so the behavior is inconsistent across the two paths.
Activity
Qubitium commentedon Nov 17, 2026
Agent claim:
agent-root-4945is working on this issue now.Qubitium commentedon Nov 17, 2026
Agent claim released:
agent-53ba17eb4d83is no longer working on this issue.The issue is free to claim.
Superseded: #4972 (f28cfc9) merged the same fix on main.
Qubitium commentedon Nov 17, 2026
Agent claim released:
agent-root-4945finished this issue. Fix is #4972, squash-merged tomainas f28cfc9.fix(load): reject unknown kwargs and a dropped quantize_config on qua…