Repository navigation
hrx: Q3_K and IQ3_S in the K-quant decode kernels - #43
Merged
bong-water-water-bong merged 1 commit intoSep 29, 2026
Merged
Conversation
Extends ops/kquant_decode_f32.loom (both kernels) and its matchers to Q3_K and IQ3_S, the last two types of Unsloth's UD-Q4_K_XL still on the generic decode kernels. - Q3_K: lane (n, j, h) owns one 16-value run with a single 6-bit scale; 2-bit codes and the hmask bit via 16-bit loads (blocks are 2-byte aligned). - IQ3_S: the 512-entry iq3s_grid (ggml-common.h, MIT) cannot live in Loom rodata for amdgpu kernels (no global.load lowering), and a constant-vector lookup would be select chains; each workgroup writes it to 2 KiB of workgroup memory (one 128-entry chunk per wave, then a barrier) only when a weight is IQ3_S. Other formats compile to the same code as before. - Reference paths and check.cases for both (seven cases, access sanitizer). Qwen3.8-27B UD-Q4_K_XL, HRX0 (gfx1151): Q3_K SwiGLU pairs 102-111 -> 189-190 GB/s; the IQ3_S ffn_down 2.83 ms -> in the projection kernel; token busy 89.4 -> 85.4 ms; decode 11.60 -> 12.15 tok/s (Vulkan 12.48); ub1 wikitext PPL 7.1595 (CPU 7.1475). test-backend-ops -o MUL_MAT -b HRX0 passes. ZAYA1-8B decode 94.0 tok/s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
|
The three windows matrix jobs shown as failing were cancelled by the runner (job conclusion |
bong-water-water-bong
merged commit Sep 29, 2026
f81814a
into
1bit/hrx-vulkan-patched
7 of 24 checks passed
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.
Follow-up to #42. Adds Q3_K and IQ3_S to both K-quant decode kernels: the fused SwiGLU gate/up kernel and the projection kernel. These were the last two types in Unsloth's UD-Q4_K_XL that still went through the generic decode kernels.
iq3s_gridfromggml-common.h(MIT).global.loadhas no target-low contract.Results
Qwen3.8-27B UD-Q4_K_XL on HRX0 (gfx1151):
ffn_down: previously 2.83 ms per token on AMD's generic kernel; now handled by the projection kernel.-ub 1): 7.1595; CPU 7.1475.test-backend-ops -o MUL_MAT -b HRX0passes, including the IQ3_S and Q3_K n=1 cases.ZAYA1-8B decodes at 94.0 tok/s.
The 27B on HRX still runs hot: it peaks at 91–93 °C and draws about 130 W, against 99 W on Vulkan. One gate-bench round was stopped by the 93 °C guard.
🤖 Generated with Claude Code