Repository navigation
fix(paroquant): deterministic ROCm GEMMs and config-only autotune knobs (#4460) - #4505
Merged
Merged
Conversation
…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.
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
Completes the reproducibility work in #4460 that #4499 started for CUDA.
ProcessorStep.PAROnow 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.GPTQMODEL_PAROQUANT_ROTATE_AUTOTUNE_*std::getenvread fromgptqmodel_ext/paroquant/rotation.cu(AGENTS.md forbids new env-var configuration). The previous defaults are now internalconstexprvalues; behavior stays controlled byKernelConfig.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 passedpytest tests/test_kernel_config.py -q→ 22 passedpytest tests/test_rocm_quant_tuning.py tests/test_rocm_backend_gating.py -q→ 52 passed, 1 skippedtests/test_paroquant.py: 216 passed / 23 failed, identical to the 215 passed / 23 failed baseline at 7270345 (the 23 needCUDA_HOME/nvcc, unavailable here)ruff checkcleanLimitation
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.