Repository navigation
Description
Found on main @ c1807f8, AMD R9700 (ROCm) for the end-to-end runs and CPU for the per-module analysis.
What is wrong
#5221 (099955f, mse_optimal_quant in gptqmodel/quantization/fallback_smooth.py:173-250) now scores both endpoints p = maxshrink and p = 1 and only accepts a strictly lower weight MSE. On its own objective it works: the per-row weight MSE is never worse than plain RTN any more. End-to-end quality got worse, though. RTN + SmoothMSE() 4-bit symmetric PPL went up 3.2% on Qwen2.5-0.5B-Instruct and 1.7% on Llama-3.2-1B-Instruct. SmoothMSE was already worse than no smoother at all on both models, and the gap is now wider: Qwen is +5.5% vs plain RTN. The commit, docs/quantization-scale-storage.md and the README ("SmoothMSE keeps the unclipped range when clipping would increase error") describe this change as a quality fix, and they do not mention the PPL cost.
The cause is the objective, not the storage. The search minimizes unweighted per-row weight MSE. Making that search exact also scores the p = 0.8 endpoint, which none of the probes reached before. More groups now take the strongest clip (main 15% of groups at p=0.8 vs 11% before). That clips the largest-magnitude weights, and on the projections fed by outlier activation channels those weights matter most. In the activation-weighted output error, SmoothMSE is up to 2.1x worse than plain RTN on q_proj/k_proj and the last down_proj, and main is a little worse than before on most of them. The saved checkpoint stores exactly the grid the search scored: 0.014% of elements differ, all fp16 scale-rounding ties. So this is not a packing bug.
Repro (end-to-end)
from gptqmodel import GPTQModel
from gptqmodel.quantization.config import RTNConfig, SmoothMSE, CalibrationConfig
m = GPTQModel.load("Qwen/Qwen2.5-0.5B-Instruct", RTNConfig(bits=4, group_size=128, smooth=SmoothMSE()))
m.quantize(CalibrationConfig(dataset=calib)) # 128 C4 docs; RTN ignores them
m.save(out); q = GPTQModel.load(out) # wikitext-2 PPL, 80 x 512 windows, AUTO backendwikitext-2 PPL (bisected; the parent row equals 396b5f0 bit-for-bit, checkpoint hash a32c2b6b):
| model | config | plain RTN (no smoother) | 7d80f5b (before #5221) | 099955f (#5221) = main | delta |
|---|---|---|---|---|---|
| Qwen2.5-0.5B-Instruct | 4-bit sym, g128 | 24.814 | 25.363 | 26.188 | +3.25% |
| Llama-3.2-1B-Instruct | 4-bit sym, g128 | 24.486 | 24.817 | 25.226 | +1.65% |
| Qwen2.5-0.5B-Instruct | 4-bit asym | - | 22.870 | 22.909 | +0.17% |
| Llama-3.2-1B-Instruct | 4-bit asym | - | 23.570 | 23.583 | +0.06% |
| Qwen2.5-0.5B-Instruct | 3-bit sym | - | 139.80 | 144.71 | +3.5% |
| Llama-3.2-1B-Instruct | 3-bit sym | - | 107.91 | 103.73 | -3.9% |
Per-module analysis (CPU, all 168 Qwen linears, 512 wikitext tokens as activations X, error = ||X (W_q - W)^T||^2 / ||X W^T||^2)
| plain RTN | SmoothMSE before #5221 | SmoothMSE main | |
|---|---|---|---|
| groups with weight MSE worse than RTN | 0 | 104,073 / 2,795,520 | 0 |
| total weight SSE | 2134.7 | 1774.3 | 1770.5 |
| groups at p = 0.8 (strongest clip) | - | 319,094 | 421,997 |
| layers.0.self_attn.q_proj output error | 0.00180 | 0.00372 | 0.00379 |
| layers.23.mlp.down_proj output error | 0.00932 | 0.01597 | 0.01675 |
| layers.{4,9,12,14,21}.self_attn.k_proj output error | 0.0047-0.0076 | 0.0070-0.0119 | 0.0070-0.0119 (1.4-1.55x RTN) |
The weight MSE drops, but the error on the modules that drive PPL rises.
Suggested fix
- Weight the SmoothMSE objective by input importance when it is available, as GPTQ's own
msegrid search and AWQ's clip search do. The GPTQ and QQQ fallback consumers have the Hessian diagonal. For calibration-free RTN, use at least a row/column saliency proxy. Or do not clip a group's absolute maximum in rows where clipping only helps the bulk. - Or, short term: say in the docs and README that
SmoothMSEminimizes unweighted weight MSE and can lower end-to-end quality (here it is worse than no smoother at 4-bit sym), and do not call fix(quantization): score the unshrunk SmoothMSE range as a candidate #5221 a quality improvement.
Test that should have caught it
tests/test_smooth_mse_endpoint_baseline.py checks only the weight-MSE contract. A small end-to-end check, such as RTN + SmoothMSE PPL on a 2-layer model compared with plain RTN, or an activation-weighted output-error oracle, would show this.
Severity
Medium. Opt-in smoother (not a default), but anyone who enables SmoothMSE (RTN smooth=, or the GPTQ/QQQ Fallback(smooth=SmoothMSE()) used for low-token MoE experts) gets measurably worse models than without it, and #5221 made that worse while being described as a fix.
🤖 Generated with Claude Code
Activity
Qubitium commentedon Nov 18, 2026
Agent claim:
agent-4e3a0639ecafis working on this issue now.Started 2026-11-18T17:26:36Z. 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: fix the #5221 quality regression: the exact SmoothMSE endpoint search must not make RTN+SmoothMSE worse end-to-end - find why the lower per-row MSE worsens model PPL, adjust the selection objective/criterion, and prove it with PPL on Qwen2.5-0.5B and Llama-3.2-1B
Qubitium commentedon Nov 18, 2026
Agent claim released:
agent-4e3a0639ecaffinished this issue.PR: #5294 — base
main, headaa44f051f(branchfix/5286-smoothmse-endpoint), 9 files, +395/−21.Fix
mse_optimal_quantkept the strictly lower uniform weight MSE, where clipping one row's largest weight is cheap: one element's error buys a ~20% smaller step for the other 127. #5221 made that scoring exact, so more groups took the strongest clip (15% atp = 0.8vs 11% before) and the layer output error rose even though weight MSE fell.The search now minimizes an importance-weighted error:
|w| + mean(|w|)magnitude proxy.docs/quantization-scale-storage.md/ README now describe the objective that is actually optimized.Evidence
Qwen2.5-0.5B-Instruct and Llama-3.2-1B-Instruct, RTN 4-bit symmetric g128, wikitext-2 PPL:
mainLayer-wise (Qwen, 512 wikitext tokens, float32 weights, teacher-forced activations): the uniform search cut weight SSE 2578.8 → 2144.5 but raised aggregate output error 0.01727 → 0.02455; an oracle activation-diagonal weighting gives 0.00937 and the shipped proxy 0.01388. The saved checkpoint matches the scored grid (max element difference is fp16 scale rounding).
tests/test_smooth_mse_saliency_criterion.py: 3 behavioral failures on pristinemain(heavy-tail clipping sym/asym, Hessian-diagonal fallback), 7 passed with the fix (re-verified by the parent agent: 24 passed across the new file +test_smooth_mse_endpoint_baseline.py).Not verified: GPTQ/QQQ fallback end-to-end PPL (no low-token MoE checkpoint offline; the Hessian path is covered by unit tests); the absolute Llama PPL differs from the reporter's host (the local cache is
unsloth/Llama-3.2-1B-Instruct), the relative regression and recovery reproduce.fix(quantization): weight SmoothMSE search by input saliency (#5286) (#…