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] QuantizeConfig.to_dict() mutates config.dynamic and drops adapter overrides #3440
BaseQuantizeConfig.to_dict() publishes out["dynamic"] = self.dynamic and then mutates each dynamic layer dict in place: it removes the "adapter" key and replaces "bits" with its serialized form. Serializing a config therefore changes the live config object and drops per-layer adapter overrides.
Expected: to_dict() is a read-only serialization operation. The returned payload should contain the serialized dynamic entry (without the in-memory-only adapter override), while qconfig.dynamic keeps the adapter override and qconfig.extract_adapter_rank_patterns() still returns {'model.layers.0.self_attn.q_proj': 16} afterwards.
Expected behavior
to_dict() must not mutate self.dynamic; it should build a detached serialized copy of each dynamic layer entry.
Activity