Skip to content

[QUALITY] Regression from #5279 (for #5246): Paro default opt_batch_size 64->128 halves optimizer steps at fixed LR - Llama-3.2-1B PPL 19.973 -> 20.178 (+1.0%, CUDA and ROCm), giving back 2/3 of the #5175 accuracy gain #5246 required keeping #5306

Closed

Description

@Qubitium

Found on main @ c03416c, RTX 4090 (torch 2.15 + CUDA 13.2). Also reproduced on ROCm (R9700).

What is wrong

#5279 (for #5246) changed the default ParoConfig.opt_batch_size from 64 to 128 (gptqmodel/quantization/config.py:6948-6951). The learning rates, epoch counts and schedule stayed the same. The rows per epoch are unchanged, but the number of optimizer steps per epoch is halved. That is a different optimization, not just "the same calibration data with fewer launches". The PR measured PPL only on Qwen2.5-0.5B. On Llama-3.2-1B-Instruct, the new default gives back about two thirds of the #5175 accuracy gain that #5246 says must be kept ("Done when: PPL equal to or better than the post-#5175 values").

Measurements

wikitext-2 PPL (80 x 512 windows, BOS + 511 tokens), Paro 4-bit g128 fp16, 128 C4 docs, quantize -> save -> reload, AUTO backend. Paro is deterministic: the opt_batch_size=64 run on main reproduces the round-21 main result bit for bit (19.97331454791001).

model pre-#5175 (307b688) main, opt_batch_size=64 (pre-#5279 default) main, default 128 (#5279)
Llama-3.2-1B-Instruct, CUDA 20.284 19.973 20.178 (+1.03%)
Llama-3.2-1B-Instruct, ROCm 20.253 19.862 (9328371, the commit before #5279) 20.074 (+1.07%; bisected to 899b509)
Qwen2.5-0.5B-Instruct, CUDA 19.973 19.905 (round-21 main) 19.590 (better)

So the effect depends on the model. Qwen improves, and Llama loses 0.2 PPL. That is 66% of the 0.31 gain #5175 gave Llama, putting it about halfway back to the pre-#5175 first-batch result. Quantize time (this card is shared, so the numbers are noisy): Llama 272.7 s (main) vs 274.5 s (pre-#5175) vs 339.6 s (main bs=64, run concurrently). The speed goal is met; the accuracy goal is not.

Repro

from gptqmodel import GPTQModel, CalibrationConfig
from gptqmodel.quantization.config import ParoConfig
for bs in (64, 128):
    m = GPTQModel.load("meta-llama/Llama-3.2-1B-Instruct", ParoConfig(bits=4, group_size=128, opt_batch_size=bs))
    m.quantize(CalibrationConfig(dataset=calib))   # 128 C4 docs (>=1500 chars, first 2500 chars)
    m.save(out := f"paro_bs{bs}")
    print(bs, wikitext2_ppl(GPTQModel.load(out)))
# 64  19.9733
# 128 20.1781

Suggested fix

Test that should have caught it

#5279 added only chunker/step-count unit tests. The acceptance criterion in #5246 is a two-model PPL bar, and only one model was measured.

Severity

Medium (quality). Default ParoQuant config, every user. Silent +1% PPL on Llama-3.2-1B, which undoes most of the accuracy recovered by #5175.

🤖 Generated with Claude Code

Activity

  1. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    More data (CUDA, RTX 4090, main @ c03416c, 2 reps each, interleaved):

    🤖 Generated with Claude Code

  2. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    More data from ROCm (R9700, main @ c03416c, same harness: 128 C4 docs, Paro 4-bit g128 fp16, quantize -> save -> reload, wikitext-2 80x512 PPL). Every run is deterministic: main with opt_batch_size=64 gives the same safetensors hash as c1807f889 (pre-#5279) for both Llama-3.2-1B-Instruct (64e1c90a) and Qwen2.5-0.5B-Instruct (6c9a4f66), and a repeated main run gives the same hash too. So the default is the only thing that changed.

    I added two more models to see which way it goes:

    model (ROCm) opt_batch_size=64 default 128 (#5279) dPPL quantize s 64 / 128 (shared card)
    Llama-3.2-1B-Instruct 19.8618 20.0740 +1.07% 571 / 364
    Llama-3.2-1B (base) 14.6568 14.6858 +0.20% 541 / 387
    Qwen2.5-0.5B-Instruct 19.6484 19.5846 -0.32% 385 / 228
    Qwen3-0.6B 29.4085 28.9237 -1.65% 533 / 285

    The same pattern holds on CUDA (RTX 4090): Llama-3.2-1B-Instruct 19.973 -> 20.178 (+1.03%), Qwen2.5-0.5B 19.905 -> 19.590 (-1.6%).

    So 128 is not uniformly worse. Both Qwen models get better and both Llama models get worse, and the Instruct model gets 5x worse than the base. That suggests the LR and step count are tuned close to the edge for Llama, rather than 128 being a bad batch size in general. Re-validating any LR-scaling fix on all four models would show which way each family moves.

    🤖 Generated with Claude Code

  3. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim: agent-4e3a0639ecaf is working on this issue now.

    Started 2026-11-19T01:55:57Z. 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: Re-tune ParoQuant opt_batch_size=128: scale the optimizer learning rates with the batch (or restore 64) and validate wikitext-2 PPL on Llama-3.2-1B and Qwen2.5-0.5B against the post-#5175 bar.

  4. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    Released in 2c8717e1a (PR #5356).

    ParoConfig.opt_batch_size is back on the accuracy-validated 64 rows. Larger batches stay available as an explicit speed opt-in, and the three stage LRs now scale from the 64-row reference (max(1, opt_batch_size / 64)), so opting into a larger step no longer silently halves the per-epoch update.

    Validation (Llama-3.2-1B-Instruct, RTX 4090, this host)

    Paro 4-bit g128 fp16, 128 C4 docs, quantize -> save -> reload -> wikitext-2 PPL (80 x 512). Runs are deterministic: repeats return bit-identical PPL, including across GPUs.

    config wikitext-2 PPL vs bs=64
    bs=64 (new default) 20.1797 -
    bs=128, 1x LR (what #5279 shipped) 20.4496 +1.34%
    bs=128, 2x LR (automatic scaling) 20.4496 +1.34%
    bs=128, 3x LR 20.1274 -0.26%
    bs=128, 4x LR 20.3361 +0.78%

    The effect in the report reproduces (+1.3% at 128 rows), and it is not purely an LR effect: halving the step count also halves the validation checkpoints the best state is chosen from, and the LR sweep is not monotone (3x wins once, 4x is worse again). LR scaling recovers ~0.1% of the 1.34% gap, so the default goes back to 64 rather than shipping a coefficient. A run with the default config (no explicit opt_batch_size) measures 20.1797, i.e. the accuracy bar is met.

    Note on the absolute numbers

    On this host today, main at bs=64 measures 20.1797 rather than the 19.973 in the report. The same tree re-measured a few hours apart moved between 20.04 and 20.18 with no code change, most likely the fused-rotation kernel vs its fallback path depending on the JIT cache state. Only same-session, same-tree deltas are comparable, so the table above is one interleaved sweep on one tree.

    Tests

    tests/test_paro.py + tests/test_paro_batch_lr_5306.py: 249 passed on main @ 2c8717e1a; uvx [email protected] check gptqmodel docs/eora tests setup.py clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions