Skip to content

qwen4exp: route IQ2_S routed experts to HRX when the HIP add-on exports the kernels (Flash-Next UD-IQ3_XXS fully on HRX) - #144

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/iq2s-mmid-tip
Oct 25, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/iq2s-mmid-tip

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

qwen4exp-hrx-support.h: the routed-expert MUL_MAT_ID guard from #142 sends IQ2_S to HRX when the embedded hrx_prefill_gemm code object exports the IQ2_S kernels (both names looked up in the code object, so the answer does not depend on when the dispatch registry is built); otherwise IQ2_S stays on the CPU as before. Honours GGML_HRX_HIP_IQ2S_MIN_TOKENS (default 1) with the add-on's matcher: every IQ2_S batch goes to HRX, one token included, because the loader's 512-token support check moves the experts into HRX memory and a CPU decode reading them from there collapsed to 0.64 tok/s.

With the private add-on's IQ2_S kernels (gpu-kernels PR, GEAK-authored): Qwen3.8-Flash-Next UD-IQ3_XXS on HRX0 PPL 1.9514 +- 0.0597 (was 1.9634 with IQ2_S on CPU), pp512 85.4 -> 297.3 tok/s, tg128 12.82 -> 25.16; UD-IQ4_XS unchanged (PPL 1.8090, 282.6 / 23.84). One commit on 9705173; loom agent TNVFP4Q20, 2026-10-25.

🤖 Generated with Claude Code

…IQ2_S MUL_MAT_ID GEMM

mul_mat_id_requires_cpu keeps IQ2_S MUL_MAT_ID on the CPU only for K not a multiple of 256, below
GGML_HRX_HIP_IQ2S_MIN_TOKENS (default 1), or when the embedded hrx_prefill_gemm code object lacks
hrx_prefill_mmid_iq2_s_m64_w4 / hrx_prefill_mmid_swiglu_iq2_s_m64_w4 (looked up by export name, independent of
when the dispatch registry is built). Decode runs there too: the loader probes support with a 512-token
MUL_MAT_ID and then keeps the IQ2_S experts in HRX memory, where the CPU decode measured 0.64 tok/s.
Qwen3.8-Flash-Next UD-IQ3_XXS (gfx1151, performance mode): PPL 1.9514 (was 1.9634 with IQ2_S on CPU), pp512
85.4 -> 297.3, tg128 12.82 -> 25.16 tok/s; UD-IQ4_XS PPL 1.8090 unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Author

Kernel side (private add-on): gpu-kernels #38.

@bong-water-water-bong
bong-water-water-bong merged commit e7e5cd0 into 1bit/hrx-vulkan-patched Oct 25, 2026
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/iq2s-mmid-tip branch November 12, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant