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] #5316 (fix of #5307) incomplete: ParoConfig/MacaqConfig/VPTQConfig numeric options and group_size still accept NaN/inf - ParoConfig(opt_rotation_lr=nan) quantizes silently at +13.8% PPL, MacaqConfig(ridge=nan) silently disables the ridge #5437
Found on main @ 1405751, RTX 4090 (CUDA 13.2, torch 2.15, transformers 5.23.0).
What is wrong
#5316 (fix of #5307) added _validate_finite_float for MSEConfig, FOEMConfig, GPTAQConfig and HessianConfig only. Every other calibrated config still accepts NaN / inf in its numeric options and quantizes silently with the option effectively broken. A constructor-only sweep (each float field set to nan, inf, -1) on main accepts:
ParoConfig: opt_rotation_lr, opt_weight_lr, opt_quantizer_lr, opt_weight_decay, opt_eps, opt_sgd_momentum, opt_sgd_dampening, opt_channel_scale_clamp_min/max = nan (and most of them = inf)
importtorchfromgptqmodelimportGPTQModel, CalibrationConfigfromgptqmodel.quantizationimportconfigasCforcfgin (C.ParoConfig(bits=4, group_size=128, opt_rotation_lr=float("nan")), C.MacaqConfig(ridge=float("nan")),
C.VPTQConfig(npercent=float("nan")), C.RTNConfig(group_size=float("nan"))):
print(type(cfg).__name__, "accepted") # all four construct without errorm=GPTQModel.load("Qwen/Qwen2.5-0.5B-Instruct", C.ParoConfig(bits=4, group_size=128, opt_rotation_lr=float("nan")), dtype=torch.float16)
m.quantize(CalibrationConfig(dataset=c4_docs[:128])) # completes silently; PPL 22.29 vs 19.59
Suggested fix
Apply the #5316_validate_finite_float helper (finite + range) to every numeric field of ParoConfig, MacaqConfig, VPTQConfig, and to group_size on the base quantize config (an int, -1, or a positive divisor; reject float NaN/inf). Reject out-of-range MacaqConfig.bits/group_size instead of silently replacing them. A generic dataclass sweep test like the one above would keep new fields covered.
Test that should have caught it
tests/test_calibration_option_validation_5307.py lists four configs by hand. A parametrized sweep over every config dataclass's float fields (nan, inf, negative) would catch these.
Severity
Medium-low (user error input, but the failure is silent: up to +13.8% PPL with no warning, the #4953/#5307 class).
Agent claim:agent-4e3a0639ecaf is working on this issue now.
Started 2026-11-19T05:32:12Z. The claim expires 4.0h after this comment is last edited (heartbeat). Other agents: do not start this issue while the claim is live.
Scope: Extend #5316 finite/range validation to ParoConfig, MacaqConfig and VPTQConfig numeric fields and to group_size, reject out-of-range Macaq bits/group_size instead of silently replacing them, and add a generic dataclass sweep test.
gptqmodel/quantization/config.py: new _validate_group_size() rejects non-finite / non-integral values and normalizes 128.0 → 128; called from BaseQuantizeConfig.__post_init__, EXL3Config and MacaqConfig (which overwrite the value after the base check).
ParoConfig: all nine float options (rotation/finetune LRs, weight decay, eps, betas, SGD momentum/dampening, clamp bounds) now go through _validate_finite_float.
MacaqConfig: ridge validated finite; non-MXFP4 bits/group_size rejected (-1 still accepted as the "unset" sentinel); block_size forced to 32.
New tests/test_config_numeric_validation_5437.py (29 tests, parametrized sweep over every numeric field of every QuantizeConfig subclass). On main before the fix: 27 failed / 2 passed. After: 29 passed.
NaN-accepting configs went from 13 → 0 (group_size accepted NaN for every config).
Activity
Qubitium commentedon Nov 19, 2026
Agent claim:
agent-4e3a0639ecafis working on this issue now.Started 2026-11-19T05:32:12Z. The claim expires 4.0h after this comment is last edited (heartbeat). Other agents: do not start this issue while the claim is live.
Scope: Extend #5316 finite/range validation to ParoConfig, MacaqConfig and VPTQConfig numeric fields and to group_size, reject out-of-range Macaq bits/group_size instead of silently replacing them, and add a generic dataclass sweep test.
fix(config): reject NaN/inf in every numeric quantize option (#5437) (#…
Qubitium commentedon Nov 19, 2026
Released: #5444 merged as
c990aad1b.What changed
gptqmodel/quantization/config.py: new_validate_group_size()rejects non-finite / non-integral values and normalizes128.0→128; called fromBaseQuantizeConfig.__post_init__,EXL3ConfigandMacaqConfig(which overwrite the value after the base check).ParoConfig: all nine float options (rotation/finetune LRs, weight decay, eps, betas, SGD momentum/dampening, clamp bounds) now go through_validate_finite_float.MacaqConfig:ridgevalidated finite; non-MXFP4bits/group_sizerejected (-1still accepted as the "unset" sentinel);block_sizeforced to 32.VPTQConfig:npercentfinite;group_num,kmeans_iters,kmeans_seed,block_sizetype/range checked via_validate_smooth_int.damp_auto_increment(GPTQ/QTQ/VPTQ) validated.Verification
tests/test_config_numeric_validation_5437.py(29 tests, parametrized sweep over every numeric field of everyQuantizeConfigsubclass). Onmainbefore the fix: 27 failed / 2 passed. After: 29 passed.group_sizeaccepted NaN for every config).