Repository navigation
fix(paro): carry per-module krot, kernel and fallback into the packed layer - #5675
Merged
Merged
Conversation
#5573 applied every dynamic field to a per-module config clone, but for Paro two of them stopped there. resolve_module_constructor_config() had no FORMAT.PARO branch, so a per-module krot never reached the constructor: the packed ParoLinear was built from the top-level value while the optimizer produced buffers for the module's value. pairs.copy_ then either broadcast one Givens sweep across every stage (top=8, dyn=1) or raised RuntimeError (top=8, dyn=16). The same gap dropped a per-module kernel. The fallback threshold was read from the processor, so a per-module fallback rule changed the clone and nothing else. Changes: * module_config: a PARO branch normalizes krot into the constructor options, rejecting the same values ParoConfig rejects. * paro_processor: packing builds the layer from the module's own quant_linear_init_kwargs() (krot + kernel), and a pairs/theta shape guard names a krot mismatch instead of relying on a shape-compatible copy. * paro_processor: fallback decisions, logging and the missing-features guard read the module's resolved fallback, falling back to the processor value. * config: an explicit None in a dynamic rule means inherit. It is dropped before validation, so {"krot": None} no longer reaches int(None) inside the clone's __post_init__, and a None scope key is no longer rejected. Tests: tests/test_paro_dynamic_overrides_5659.py (7 tests; 6 red on main). Fixes #5659
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
Two defects left behind by #5573, found in a post-merge review of #5638.
krotnever reached the packed layer.resolve_module_constructor_config()has branches for FP8, bitsandbytes, GGUF and MXFP4 but none forFORMAT.PARO, so akrotrule stayed out of the constructor options.ParoProcessorpacked withinit_kwargs=self.qcfg.quant_linear_init_kwargs()(the run-levelkrot) and then copied the optimizer's buffers in. Withtop=8, dyn=1the copy broadcast one Givens sweep across every stage; withtop=8, dyn=16,top=1, dyn=8andtop=8, dyn=4it raisedRuntimeErrorinsidecopy_. A per-modulekernelwas lost the same way.fallbackwas cloned then ignored.preprocess()setself.fallbackfrom the run-level config, and both_module_fallback_requested()and_log_fallback()read it. Top-level0.5%with a module rule of1.0%and 5 of 1000 calibration rows: the clone said fall back, the processor did not.Also fixed in the same area: an explicit
Nonein adynamicrule now means "inherit" instead of crashing ({"krot": None}reachedint(None)inside the clone's__post_init__and raised a bareTypeError).Fixes #5659
What Changed
gptqmodel/quantization/module_config.py: newFORMAT.PARObranch that normalizeskrotinto the constructor options, rejecting0, negatives, bools, non-integers and fractional floats the wayParoConfig.__post_init__does.gptqmodel/looper/paro_processor.py:quant_linear_init_kwargs()(sokrotandkernelcome from the resolved rule);pairs/thetashape guard names thekrotmismatch instead of relying on a shape-compatible copy;fallback, falling back to the processor value for synthetic configs.gptqmodel/quantization/config.py: aNonevalue in a dynamic rule is dropped before validation, so it inherits the run-level setting;_validate_dynamic_module_scopeno longer rejects aNonescope key;apply_module_overridesskipsNonedefensively.tests/test_paro_dynamic_overrides_5659.py: new regression file (7 tests). No API change.Out of scope:
damp_percent/static_groupsare still accepted per module with no Paro consumer; that needs a decision on whether to reject them, not a silent fix.Tests
tests/test_paro.pyreports 23 failures on this CPU-only host (fused-rotation gradient and launch-plan tests); the identical 23 fail on unmodifiedmain, so they are pre-existing and unrelated.The packed-layer test builds a real
ParoLinearthroughcreate_quant_moduleand assertskrot/pairs/thetaare sized by the module rule, which is the exact path that used to broadcast.Model Support / Module Plan
Not applicable: no
MODEL_MAP, definition, or module-plan change.AWQ onboarding safety
Not applicable: no AWQ grouping, search, replay or fold change.