Repository navigation
fix(exl3): honor head_bits and reload injected dynamic rules (#6224, #6216) - #6246
Merged
Merged
Conversation
Qubitium
marked this pull request as ready for review
November 29, 2026 08:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR now fixes both EXL3 head-configuration issues.
#6224 —
head_bitswas silently ignoredEXL3Config(bits=4, head_bits=6)was accepted, logged, and serialized, but the looper only visitslm_headwhenquantize_config.lm_headis true. The head stayed dense BF16.Following exllamav3 semantics,
head_bitsis a request to quantize the output head, soEXL3Config.__post_init__now enableslm_head. The serialized config recordslm_head: trueinstead of claiming a 6-bit head that was never applied.calculate_bits_per_weightonly reports ahead_bitsrate when head quantization is requested.#6216 — saved EXL3 head checkpoints could not reload
ModuleLooper._loop_implinjects the GPTQ-style implicit ruledynamic["lm_head"] = {"bits": 8, "group_size": 32, "sym": True, "desc_act": False, "mse": 2.4}for every method whenlm_head=True. EXL3 ignores those keys, but they were serialized. Reload then failed with:The fix is config-side only, in
gptqmodel/quantization/config.py(no changes togptqmodel/looper/module_looper.py, avoiding a conflict with #6240):group_size,sym,desc_act, andmseduring normalization and before serialization.bitsandhead_bitssemantics are kept.to_dict()also sanitizes rules injected after construction by the looper, so savedquantize_config.json/config.jsoncontain only{"lm_head": {"bits": 8}}in the dynamic entry.Test evidence
New #6224 tests
tests/test_exl3_fractional_bits.py::test_head_bits_enables_lm_head_quantizationtests/test_exl3_fractional_bits.py::test_head_bits_overrides_an_explicit_lm_head_falsetests/test_exl3_fractional_bits.py::test_head_bits_absent_does_not_enable_lm_head_quantizationRed at
2d3261d:2 failed, 1 passed.Green:
3 passed.New #6216 tests
tests/test_exl3_fractional_bits.py::test_injected_gptq_lm_head_dynamic_rule_loads_for_exl3tests/test_exl3_fractional_bits.py::test_exl3_save_load_save_drops_injected_lm_head_group_sizetests/test_exl3_fractional_bits.py::test_exl3_dynamic_unknown_option_still_raises_after_sanitizingtests/test_exl3_fractional_bits.py::test_exl3_dynamic_invalid_bits_still_raises_after_sanitizingRed at
95c1a88(the previous PR head, config file restored):Green:
4 passed.Full commands and results
Result:
43 passed.Result:
17 passed, 2 skipped(ROCm GPU required).Result:
38 passedand202 passed.Ruff:
Result:
All checks passed!Unverified
group_sizeremains the EXL3-1sentinel; only the unused per-module dynamic key is removed.Fixes #6224
Fixes #6216