Skip to content

[PERF] TODO: recover ParoQuant quantize speed (1.7x slower since #5175) while keeping its accuracy gain #5246

Closed

Description

@Qubitium

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:

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

Activity

  1. Qubitium commented on Nov 18, 2026

    @Qubitium
    CollaboratorAuthor

    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.

    platform model quant s, old (2 reps) quant s, main (2 reps) PPL old → main
    ROCm Qwen2.5-0.5B 162 / 142 189 / 241 19.943 → 19.647
    ROCm Llama-3.2-1B 188 / 197 331 / 346 20.253 → 19.862
    CUDA Llama-3.2-1B 170 / 104 191 / 187 20.284 → 19.973
    CUDA Qwen2.5-0.5B (sweep only) 210.6 167.0 19.973 → 19.905

    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.

  2. Qubitium commented on Nov 18, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim: agent-4e3a0639ecaf is 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

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