Skip to content

[BUG] ParoQuant quantization is not reproducible with a fixed opt_seed (±0.3 PPL run-to-run) #4460

Description

@Qubitium

Severity: low-medium. Kind: new; same at def6e61. Confirmed at 489aed6 on an RTX 5090.

paroquant_processor.py:631 derives "deterministic per-module seeds", so run-to-run reproducibility is intended. Two back-to-back runs with the same code, calibration and default opt_seed=0 give different models:

ParoConfig(bits=4, group_size=128, opt_rotation_epochs=1, opt_finetune_epochs=1, opt_train_samples=128, opt_validation_samples=16), 128×512 wikitext-2 calibration, wikitext-2 PPL:

model commit run 1 run 2
Llama-3.2-1B-Instruct 489aed6 22.2025 22.0341
Llama-3.2-1B-Instruct def6e61 22.0206 22.0268
Qwen2.5-0.5B-Instruct 489aed6 21.6264 21.8757
Qwen2.5-0.5B-Instruct def6e61 22.2160 21.8939

The source of the nondeterminism was not localized. Candidates:

  • AMP autocast;
  • atomics in the fused rotation backward;
  • cudagraph staging;
  • unseeded data shuffling in the train/validation split.

This noise also makes it impossible to measure numerics fixes such as 9b11fb3 (#4317) by PPL. Expected: a fixed seed gives a bit-identical checkpoint, or the docs say that ParoQuant is nondeterministic.


Found during an AI-assisted review (Claude Code, round 13) of 489aed6; repros were run at that commit (A/B against def6e61 where noted) on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.

Activity

  1. added
    bug
    on Nov 16, 2026
  2. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    A likely contributor: #4461. The ParoQuant fused rotate_pair_grad_kernel has a shared-memory write-after-read race, so the rotation gradient is sporadically wrong (max abs diff up to 2.5). It was confirmed on ROCm; a one-line barrier makes the output bit-identical.

  3. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Reopening: #4499 auto-closed this, but it only fixes CUDA. Cold-cache repeat ParoQuant runs on CUDA now give bitwise-identical checkpoints.

    Still open on ROCm: two Qwen2.5-0.5B runs give PPL 21.26 vs 21.44.

    • Cause: _needs_deterministic_hessian (models/base.py) keeps hipBLASLt for ParoQuant on ROCm, and hipBLASLt picks GEMM kernels per process.
    • Workaround: with rocBLAS pinned, two runs give bitwise-identical checkpoints.
    • Open decision: whether ParoQuant should pin rocBLAS on ROCm (deterministic but slower).

    Also still open: the ParoQuant rotation autotune knobs are read from GPTQMODEL_PAROQUANT_ROTATE_AUTOTUNE_* environment variables in rotation.cu, which AGENTS.md forbids.

  4. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Claimed by an AI agent for the remaining items: pin a deterministic GEMM path for ParoQuant on ROCm (or document the trade-off) and remove the GPTQMODEL_PAROQUANT_ROTATE_AUTOTUNE_* environment knobs that AGENTS.md forbids.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions