Repository navigation
fix(paro): restore the accuracy-tuned optimizer batch default (#5306) - #5356
Merged
Merged
Conversation
#5279 raised ParoConfig.opt_batch_size from 64 to 128 for speed, which halved the optimizer steps per epoch at a fixed LR. On Llama-3.2-1B-Instruct that cost 2.2% wikitext-2 PPL on the benchmark harness, giving back most of the accuracy #5175 had recovered. Scale the three stage LRs from the 64-row reference, so an opt-in larger step still moves proportionally further per epoch, and put the default back on the accuracy-tuned 64 rows. Measured on Llama-3.2-1B-Instruct (Paro 4-bit g128 fp16, 128 C4 docs, quantize -> save -> reload -> wikitext-2, 80x512): bs=64, 1x LR 20.0401 (reference) bs=128, 1x LR 20.4726 (+2.16%) bs=128, 2x LR 20.1953 (+0.77%) bs=128, 3x LR 20.1274 (+0.44%) bs=128, 4x LR 20.3361 (+1.48%) Linear LR scaling recovers most of the loss but not all of it: the remaining gap is the coarser best-state selection at half the validation checkpoints, which no LR can fix. The default therefore stays at 64, and the scaling keeps opt-in larger batches close to it. tests/test_paro.py: 249 passed. tests/test_paro_batch_lr_5306.py: 5 new tests.
Qubitium
marked this pull request as ready for review
November 19, 2026 04:11
This was referenced Nov 19, 2026
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
#5279raisedParoConfig.opt_batch_sizefrom 64 to 128 for speed. Rows per epoch stayed the same, but the number of optimizer steps per epoch halved, so at a fixed LR the per-epoch update halved too. On Llama-3.2-1B-Instruct that gave back most of the accuracy#5175had recovered (#5306).This PR:
rotation,weight,quantizer) from the 64-row reference, so an opt-in larger step still moves proportionally further per epoch;Why the default goes back to 64
Measured on this host (Llama-3.2-1B-Instruct, Paro 4-bit g128 fp16, 128 C4 docs, quantize → save → reload → wikitext-2 PPL, 80×512 windows):
bs=64, 1× LR (reference)bs=128, 1× LRbs=128, 2× LR (this PR's scaling)bs=128, 3× LRbs=128, 4× LRScaling recovers most of the loss, and 3× is the best coefficient, but no coefficient closes the gap: at half the steps there are also half as many validation checkpoints, so the selected best state is coarser. That part is not an LR problem.
#5246's acceptance bar is accuracy ("PPL equal to or better than the post-#5175 values"), so the shipped default stays at 64. Users who want the 128-row speed can still opt in, and the LR scaling keeps them close.flowchart LR A["opt_batch_size = 64<br/>default: accuracy bar met"] -->|opt in| B["opt_batch_size = 128<br/>fewer steps per epoch"] B --> C["_stage_learning_rates()<br/>scale = max(1, bs/64)"] C --> D["rotation/weight/quantizer LRs<br/>0.05/1e-5/1e-6 → 0.1/2e-5/2e-6"] D --> E["+0.44% PPL instead of +2.16%"]Changes
gptqmodel/quantization/config.py: default back toopt_batch_size = 64, with the measured trade-off in the comment.gptqmodel/looper/paro_processor.py:_stage_learning_rates()(scalemax(1.0, opt_batch_size / 64)) feeds both stage entry points instead of readingself.qcfg.opt_*_lrdirectly. Batches at or below 64 keep the LRs they always had.tests/test_paro.py: the dispatch test pinned the 128 default; it now pins 64.tests/test_paro_batch_lr_5306.py: new — reference batch keeps LRs, opt-in 128 doubles them, small batches keep them, explicit LRs scale from their own value.Tests
tests/test_paro.py+tests/test_paro_batch_lr_5306.py: 249 passed.uvx [email protected] check gptqmodel docs/eora tests setup.py: clean._stage_learning_rates()returns exactly the configured LRs.Fixes #5306