Repository navigation
Conversation
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
c45c1b0 made only the Torch reference accumulate the Givens sweep in FP32 and round once. The fused bf16 op that
ParoLinear._rotate_inputsuses on GPU (andParoQuantTritonLinearinherits unchanged — there is no separate Triton rotation) kept its running activation in an FP16 shared-memory workspace, so it rounded after every one of thekrotstages. Withkrot=8, non-unitchannel_scalesand θ in ±1 rad, that drifts 3.6e-3–5.6e-3 from an FP64 oracle while the fixed reference sits at 2.4e-3–3.0e-3 — the reference was no longer a valid test oracle for what inference computes.What Changed
gptqmodel_ext/paroquant/rotation.cuhRotateAccessBFloat16HalfWorkspace(fp16 workspace, per-stage rounding) withRotateAccessBFloat16FloatWorkspace:load_groupwidens BF16 input × BF16 channel scale into FP32,apply_oneapplies each Givens stage with FP32fmafon float2 row pairs, andstore_groupis the only narrowing point (__floats2bfloat162_rn).RotateAccess<__nv_bfloat16>half-workspace specialization.gptqmodel_ext/paroquant/rotation.curotate_kernel_bf16_float_workspaceuses an__align__(16)FP32 shared array; launcher renamed and theat::kBFloat16dispatch case updated.(CTA_M + ROW_PAD) * GROUP_SIZE * 4= 3 KiB (CTA 4) to 9 KiB (CTA 16) — far below the static limit.tests/test_paroquant_single_rounding_4317.py(new)krot=8/ non-unit scales / θ∈±1 fixture.ParoQuantTritonLinear._rotate_inputsmatch the single-rounding floor instead of the per-stage floor.FP16 and FP32 rotation paths are untouched (their 11-bit significand does not need the wider workspace).
Tests
Not run: the CUDA/HIP extension cannot be compiled on this host (no
nvcc, no built extensions), so the fused-kernel cases skip and the kernel change is verified by static review only (template instantiation set, shared-memory size, alignment, dispatch rename). A GPU host with the extension built should run the two skipped cases to confirm the 2.4e-3–3.0e-3 band.Model Support / Module Plan
N/A — no new model types or registry entries.
Fixes #4317