Issues / #1474
#1474 hip_q2_zero fails on gfx1201 (R9700) with ROCm 7.10: Q2_0 signed-zero fix e9a5f8d is gated to gfx1012 / HIP < 7
open · @jkuepker · 0 commentaires · Sur GitHub
Setup & installAMD / HIPNVIDIA / CUDAModels & quantsWindowsLinux
Description
`hip_q2_zero` fails on an R9700 (gfx1201) with setup's default ROCm: ``` index=65 got=0x0000 expected=0x8000 index=69 got=0x0000 expected=0x8000 index=73 got=0x0000 expected=0x8000 index=77 got=0x0000 expected=0x8000 hip_q2_zero: 1024 values, 128 failures ``` It's the symptom e9a5f8d fixed for gfx1012: Q2_0 dequant to half, with a negative scale and code 1, gives +0 instead of −0. The workaround in `dq_q2_0` (`src/kernels/cuda/iq_kernels.cu`) only applies when this holds: ```cpp #if defined(__HIPCC__) && defined(__gfx1012__) && HIP_VERSION_MAJOR < 7 ``` gfx1201 on HIP 7 never takes it, so the compiler still folds `d * 0.0f` to +0 there. **Proposed fix:** drop the arch and version conditions and keep only `__HIPCC__`, so every HIP build keeps the scale's sign for code 1. The branch is one compare on a path that already does per-element work, and it matches the FP32/CPU paths. **Impact:** probably small. Only the sign of zero changes in Q2_0 half dequant (I measured Coder IQ1_M, which doesn't use Q2_0, and its answers are unaffected). But the test fails on a supported card with the default toolchain. **Not checked:** I only ran ctest on the 7.10 build. A 7.14.0a20260612 build of the same tag had no tests built, so I don't know whether the newer compiler does the same. #918 lists ctest results on gfx1151/Windows without `hip_q2_zero` among the failures, so this may depend on the arch or compiler. **Environment:** Strata v0.1.40.3 (d5ea713), Linux (Ubuntu 24.04), AMD Radeon AI PRO R9700 (gfx1201, 32 GB), Ryzen 9 9900X, TheRock ROCm 7.10.0a20251120 (`gfx120X-all` wheels, setup's default), built by `./setup.sh --backend hip`, then `cmake -DSTRATA_BUILD_TESTS=ON` + `ctest --test-dir build-hip`.
Sur le site
Liens install, modèles, releases.