You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] ParoQuant bf16 single-rounding fix covers only the Torch reference; the CUDA/HIP fused op and the Triton rotation still round after each Givens stage (incomplete fix of #4221) #4317
Compare m._rotate_inputs(x) against an FP64 Givens oracle.
Kernels (CUDA and ROCm)
Fixed reference (single rounding)
Rotated-activation rel error
3.6e-3 – 5.6e-3
2.4e-3 – 3.0e-3
Layer output rel error
4.2e-3 – 5.7e-3
2.7e-3 – 3.3e-3
Because of this, the Torch reference used as the test oracle no longer matches what inference actually computes.
Expected: the CUDA/HIP fused op and the Triton rotation accumulate bf16 in FP32 and round once, like the reference.
Found during an AI-assisted review (Claude Code, round 11) of 842d666; repros were run at that commit on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Clarification from a second reviewer: with the original #4221 repro settings, the fused CUDA op, the reference and the vectorized path all sit at the same single-rounding floor (5.06e-3 / 5.10e-3).
The gap described above shows up with krot=8, non-unit channel_scales (0.5–1.5) and θ in ±1 rad, measured against an FP64 Givens oracle. So the kernels match the reference on the original case, but diverge from it on deeper rotation stacks.
Taking this. I'll investigate against current main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.
PR opened: #4365 — fused bf16 rotation now keeps an FP32 shared workspace and narrows once on store. The CUDA/HIP extension cannot be compiled on this host, so the two fused-path tests skip here; static review only for the kernel.
Activity
Qubitium commentedon Nov 16, 2026
Clarification from a second reviewer: with the original #4221 repro settings, the fused CUDA op, the reference and the vectorized path all sit at the same single-rounding floor (5.06e-3 / 5.10e-3).
The gap described above shows up with
krot=8, non-unitchannel_scales(0.5–1.5) and θ in ±1 rad, measured against an FP64 Givens oracle. So the kernels match the reference on the original case, but diverge from it on deeper rotation stacks.Qubitium commentedon Nov 16, 2026
Taking this. I'll investigate against current
main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.Qubitium commentedon Nov 16, 2026
PR opened: #4365 — fused bf16 rotation now keeps an FP32 shared workspace and narrows once on store. The CUDA/HIP extension cannot be compiled on this host, so the two fused-path tests skip here; static review only for the kernel.
fix: round ParoQuant bf16 rotation once in the fused kernel (#4317) (#…