Skip to content

fix(paroquant): deterministic ROCm GEMMs and config-only autotune knobs (#4460) - #4505

Merged
Qubitium merged 1 commit into
mainfrom
fix/paroquant-determinism-4460
Nov 16, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/paroquant-determinism-4460

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

Completes the reproducibility work in #4460 that #4499 started for CUDA.

  1. ROCm determinism. ProcessorStep.PARO now joins the deterministic-BLAS processor set, so _needs_deterministic_hessian() pins rocBLAS for ParoQuant on ROCm instead of letting hipBLASLt pick a different GEMM kernel per process. ParoQuant accumulates no Hessian, so this is about GEMM kernel selection, not Hessian determinism; the slower deterministic GEMMs are accepted for reproducible checkpoints.
  2. No env-var knobs. Removed every GPTQMODEL_PAROQUANT_ROTATE_AUTOTUNE_* std::getenv read from gptqmodel_ext/paroquant/rotation.cu (AGENTS.md forbids new env-var configuration). The previous defaults are now internal constexpr values; behavior stays controlled by KernelConfig.paroquant_rotate_autotune, _cta_m, and _row_pad.

Validation

  • pytest tests/test_rocm_quant_blas.py tests/test_paroquant.py::test_paroquant_has_no_environment_variable_reads -q → 25 passed
  • pytest tests/test_kernel_config.py -q → 22 passed
  • pytest tests/test_rocm_quant_tuning.py tests/test_rocm_backend_gating.py -q → 52 passed, 1 skipped
  • ParoQuant rotation/rounding suites → 34 passed, 2 skipped
  • tests/test_paroquant.py: 216 passed / 23 failed, identical to the 215 passed / 23 failed baseline at 7270345 (the 23 need CUDA_HOME/nvcc, unavailable here)
  • ruff check clean

Limitation

No ROCm device is available in this environment, so the deterministic pin is validated structurally and with a mocked-ROCm test, not by a measured bitwise-identical ROCm run.

Resolves #4460.

…bs (#4460)

ParoQuant checkpoints are meant to be reproducible with a fixed opt_seed. PR #4499 made CUDA bitwise-identical, but ROCm kept hipBLASLt because ParoQuant accumulates no Hessian. hipBLASLt selects GEMM kernels per process, so identically seeded runs produced different checkpoints (21.26 vs 21.44 PPL). Include ProcessorStep.PARO in the deterministic rocBLAS selection and document the accepted speed-for-reproducibility trade-off.

The fused-rotation autotune timing knobs were read from GPTQMODEL_PAROQUANT_ROTATE_AUTOTUNE_* environment variables in rotation.cu, which AGENTS.md forbids. Replace them with internal constants that preserve the previous defaults; KernelConfig.paroquant_rotate_* remains the only control surface.

Tests: a mocked-ROCm selection test and a source-grep test that no ParoQuant environment reads remain. ROCm numerical determinism cannot be executed on this host (no ROCm device); it is validated structurally and with the mocked platform.
@Qubitium
Qubitium merged commit 0e6312c into main Nov 16, 2026
9 checks passed
@Qubitium
Qubitium deleted the fix/paroquant-determinism-4460 branch November 16, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant