hip_q2_zero fails on gfx1201 (R9700) with ROCm 7.10: Q2_0 signed-zero fix e9a5f8d is gated to gfx1012 / HIP < 7
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
Research direction
Start in src/kernels/cuda/iq_kernels.cu at the dq_q2_0 workaround and compare its HIP guard with the proposed change. Reproduce with the hip_q2_zero test on a HIP build; the issue reports failure on gfx1201 with ROCm 7.10. Done means the signed-zero test passes on the affected setup, while checking whether the change affects other HIP builds.
Written by the indexing model from the issue text.
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:
#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.
- Dominant language
- C++
- Stars
- 11.6k
- Forks
- 1k
- Avg merge
- 7h 46m
- Merged PRs (30d)
- 30
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Niko1221/Strata
-
Add `swift` family support for `IQ3_S` (Swift 1.5 now has an IQ3_S tier)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
expert_cache_segmented_test fails on HIP builds instead of skipping (--vram-elastic is CUDA-only)Possibly taken @nekomario28 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Niko1221/Strata#1463 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Niko1221/Strata#1322 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
Similar issues
-
bug product: very_good_flutter_plugin
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
VeryGoodOpenSource/very_good_templates#654 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug C/C++ code
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
webarkit/WebARKitLib#84 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rr-debugger/rr#4111 ·
Maintainers usually reply within 3 days