Repository navigation
Description
TODO
#5175 (fix of #5137) improved ParoQuant accuracy, but made ParoQuant quantization about 1.7x slower. Recover the quantize speed while keeping the accuracy gain.
Measurements
Main @ 396b5f0 vs round-18 base c2b0bf6. ROCm R9700 (gfx1201), fp16, 128 calibration rows, same harness and wikitext-2 PPL as the round-18 sweep. Checkpoints are bit-identical across processes on both trees.
| model | quant time, before → after | per layer | PPL, before → after | peak alloc / reserved (GiB), before → after |
|---|---|---|---|---|
| Qwen2.5-0.5B-Instruct | 115.3 s → 199.9 s (1.73x) | 4.6 s → 7.6–7.9 s | 19.31 → 18.99 | 0.36 / 0.61 → 0.39 / 0.63 |
| Llama-3.2-1B-Instruct | 204.0 s → 344.5 s (1.69x) | 19.45 → 19.07 | 1.18 / 1.48 → 1.22 / 1.50 |
Bisected to 0b1aea0 (#5175). The commit before it runs at 4.6 s per layer, and #5175 runs at 7.6 s per layer.
Cause
Before #5175, ParoQuant's per-batch torch.cat of uneven calibration batches raised. The error was swallowed, so each module trained on its first batch only. That is the #5198 class.
After #5175, the sampled rows concatenate, so each module trains on the full row budget (2112 rows on Qwen). That is more compute per optimisation step, and it is also why PPL improved by about 0.3–0.4.
Related:
- [QUALITY] ParoQuant trains each module on its first calibration batch only whenever per-batch row counts differ: _layer_input_features torch.cat(dim=0) RuntimeError -> tensors[0] fallback (every routed MoE expert; dense layers with one short row, 133 of 2112 rows; #5175 hides it only for uniform dense batches) #5198 (still open): uneven batches can still collapse to the first batch in other shapes. Fixing it fully will add more rows and make quantization slower again, so this speed work should assume the full row budget.
- [PERF] Regression from #5164 (fix of #5096): ParoLinear's 640-row dense dispatch makes 641-~2000-token prefills 1.1-2.1x slower per layer on 7-8B shapes (1.29x end-to-end at 768 tokens on Llama-3.2-1B) #5210 and [PERF] #5167 (fix of #5115) incomplete on GPU: ParoTritonLinear declares CUDAGRAPH, but every non-identity Paro layer graph-breaks on the rotation autotune disk lock (and the fused rotate op has no fake impl) - optimize() on ROCm: 52 breaks, 0.6x eager #5225: Paro inference and compile perf. Separate issues.
Ideas to evaluate
Measure each against the post-#5175 PPL, which is the accuracy bar.
- Profile one layer's training loop: rotation fwd/bwd, the quantize step, the loss, and the optimizer. Find where the extra time goes now that M grew about 16x.
- Mini-batch the training rows per step (sample a subset of the full budget each step) instead of running the whole budget every step. This keeps the data coverage and cuts the cost per step.
- Stop on convergence or a plateau of the validation loss, instead of a fixed step count, with the post-fix(awq): bound token-row activation capture to sampling budget (#5137) #5175 loss as the target.
- Precompute or cache the per-module input statistics and rotated inputs that don't change between steps.
- Use bf16/TF32 matmuls in the training forward and backward where the loss is not sensitive (check PPL).
- Overlap independent modules of a layer (q/k/v, gate/up) across streams or devices.
Done when
- ParoQuant quantize time is back within about 10–15% of the pre-fix(awq): bound token-row activation capture to sampling budget (#5137) #5175 numbers above, on both models.
- Wikitext-2 PPL is equal to or better than the post-fix(awq): bound token-row activation capture to sampling budget (#5137) #5175 values (Qwen 18.99, Llama 19.07).
- Checkpoints are still deterministic across processes.
Activity
Qubitium commentedon Nov 18, 2026
More data from the round-21 quality sweep: CUDA (RTX 4090) and ROCm. Each tree was re-timed 2×, interleaved on the same card. "Old" is e75181d, which is before #5175.
The checkpoint-hash change bisects to 0b1aea0 (#5175). Before it, the batch-0 fallback trained on about 650 rows; now training uses the configured 2048+64 row budget. Peak memory is +0.03–0.05 GB.
Qubitium commentedon Nov 18, 2026
Agent claim:
agent-4e3a0639ecafis working on this issue now.Started 2026-11-18T14:28:04Z. 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: recover ParoQuant quantize speed (1.7x slower since #5175) without giving up the row-join correctness #5175 added; measure per-stage and fix the hot path, with before/after timings on the issue's shapes
perf(paro): replay calibration rows in larger optimizer steps (#5246) (…