Skip to content

fix(config): serialize true_sequential so it round-trips (#4382) - #4407

Merged
Qubitium merged 1 commit into
mainfrom
fix/config-true-sequential-4382
Nov 16, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/config-true-sequential-4382

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Fixes #4382.

Problem

BaseQuantizeConfig.to_dict() never serialized true_sequential. The field's class default is True, so a config saved with true_sequential=False reloaded through either QuantizeConfig(**cfg.to_dict()) or from_quant_config() silently switched back to the default True, changing calibration/quantization ordering.

Fix

BaseQuantizeConfig.to_dict() now writes meta.true_sequential. The existing _SERIALIZED_META_FIELD_NAMES allowlist already lifts that key back onto the config, so both reload paths preserve the value. Putting it in the shared base serializer covers every concrete config class, not just GPTQConfig.

Tests

  • tests/test_config_serialization_roundtrip_4201.py: False and default True through both QuantizeConfig(**d) and from_quant_config(d).
  • tests/qcfg/test_config_serialization.py: parametrized over all 12 concrete config classes.
  • Pre-fix: the two new round-trip tests fail (reloaded value is True).
  • Post-fix: tests/test_config_serialization_roundtrip_4201.py tests/qcfg/test_config_serialization.py → 59 passed; broader targeted config/serialization batch → 113 passed, 10 skipped.
  • ruff check on changed files → clean.

Residual risk

  • meta.true_sequential now appears in every config's to_dict()/save_pretrained() output, including weight-only methods where it is inert. This matches what models/writer.py already records, but an external golden-file comparison of older quantize_config.json artifacts would see the extra key.
  • Old checkpoints that omit the key still default to True, unchanged.

to_dict() omitted true_sequential, so a config built with true_sequential=False reloaded as the class default True through both QuantizeConfig(**cfg.to_dict()) and from_quant_config(). Write it into the shared meta payload (the reader already lifts it) so every concrete config class round-trips it.
@Qubitium
Qubitium merged commit 2fac888 into main Nov 16, 2026
8 of 9 checks passed
@Qubitium
Qubitium deleted the fix/config-true-sequential-4382 branch November 16, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant