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] Config serialisation round-trip losses: to_dict() crashes on object-valued overrides; GPTQ-family drops smoother/foem/gptaq; QuantizeConfig(**d) loses settings and turns RTN into AWQ #4201
1. to_dict() / save_pretrained raises TypeError for per-module overrides the quantizer accepts
config.py:5312-5318 serialises only adapter and bits inside dynamic. Processors accept these overrides per module (normalize_fallback, _normalize_mse, _normalize_pack_dtype, the smoother normaliser), so the crash comes at save, after quantization has finished.
2. GPTQ / QQQ / VPTQ / ParoQuant drop preprocessors (smoother); FOEM / GPTAQ+FOEM are lost in to_dict()
In config.py:5571-5596, GPTQConfig._update_meta_payload never calls super(), which is what writes preprocessors (config.py:~5394).
GPTQConfig(smoother={"smooth": {"type": "mad", "k": 2.5}}) reloads with smoother=None. The same happens for QQQ, VPTQ and Paro, while AWQ, RTN, FP8, BnB, GGUF and the others keep it.
The same block writes foem only when gptaq is set, and then omits gptaq:
GPTQConfig(foem=FOEMConfig(...)).to_dict() reloads with foem=None;
gptaq + foem reloads with gptaq=None.
models/writer.py:2068-2091 re-adds gptaq/foem on the normal save path, so the FOEM loss affects direct to_dict() / QuantizeConfig.save_pretrained. The preprocessors loss affects every save.
3. QuantizeConfig(**cfg.to_dict()) loses settings and changes method
config.py:~4191 says this path "keeps working", and GPTQModel.load(quantize_config=<dict>) uses it (models/auto.py:~800). But the factory (config.py:~4259) never lifts meta fields, unlike from_quant_config:
AWQConfig(fallback=None) → the default fallback comes back.
RTNConfig(format="gemm") becomes AWQConfig (method='awq'), i.e. a calibration-based AWQ run instead of RTN.
Expected
Serialise or normalise object-valued overrides.
Call super()._update_meta_payload, and write gptaq and foem independently.
Route dict input through from_quant_config, or lift the meta keys.
Minor
VPTQ to_dict() omits sym, so every VPTQ reload logs a misleading "missing sym" warning.
Found during an AI-assisted review (Claude Code) of 9dad249; repros were run on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Activity
fix: serialize object-valued dynamic overrides and lift meta on facto…