[GH-ISSUE #5296] [Engine] gfx1151: unsloth's re-uploaded UD-IQ4_XS ("Better UD 3.1 quants") reads prompts 40-55% slower - its Q5_0 down layers leave the fused prompt path #3159

Open
opened 2026-11-07 14:38:32 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @luckyrider on GitHub (Nov 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5296

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Docker

What happened

On 2026-11-04 unsloth re-uploaded unsloth/Qwen3.8-Flash-Next-GGUF ("Better UD 3.1 quants", now d9620119).
UD-IQ4_XS is now 4 shards instead of 3, and the expert types changed. On Strix Halo the new file set reads prompts
40-55% slower than the one setup.py pins (HF_REVISIONS: 38bb39ee), with the same engine, flags and config.
Going back to 38bb39ee (pack rebuilt with iq_pack.py) restores the old numbers exactly.

Expert types per layer, from each pack's native_experts.txt (48 layers):

revision gate/up down
38bb39ee (setup.py pin) IQ3_S 47, IQ4_XS 1 IQ4_NL 43, Q8_0 5
d9620119 (current main) IQ3_XXS 28, IQ4_XS 17, IQ2_S 3 Q5_0 33, IQ4_NL 13, Q2_0 2

Measurements: single slot with DFlash2, power profile performance. Prompt read in tok/s; decode is 1024 tokens;
"agents" is 4 conversations x 3 turns of 15-20K tokens, run sequentially.

decode T=0 / T=1 (draft accept) 2.5K 4K 11K 23K 48K 100K agents
38bb39ee, 2026-11-03 63.9-66.0 / 62.4-64.3 (0.75 / 0.72) 870 1148 1152 1293 1278 1234 80.1 s
d9620119, run 1 59.6-59.8 / 62.1-62.2 (0.68 / 0.72) 381 529 703 748 760 718 148.2 s
d9620119, run 2 59.5-59.9 / 62.3 (0.68 / 0.72) 387 533 711 744 737 742 145.5 s
38bb39ee again, 2026-11-05 64.4-66.0 / 62.7-64.1 (0.75 / 0.72) 874 1129 1275 1292 1285 1253 80.1 s

On the agents run, first turns take 23-29 s instead of 12-15 s, and later turns (cache hit, ~1K new tokens) take 4.1-5.1 s
instead of 1.5-2.1 s. The decode drop at T=0 seems to be a separate issue: the DFlash2 draft accepts less on the new
weights (0.68 vs 0.75).

Likely cause (the slowdown is measured; this explanation comes from reading the v0.2.10 source and is not profiled):

All of the new gate/up types are in gu_covered() (IQ3_XXS, IQ4_XS, IQ2_S). Q5_0 is not in the down check, though:

  • src/prefill/moe_fused_iq.cu d_covered() on HIP accepts Q2_0 and IQ4_NL, plus Q5_1/Q8_0 only with
    STRATA_PF_FUSED_KQ=1. d_covered_on() adds Q8_0 on gfx1151 through the F16 kernel. Q5_0 is not accepted
    anywhere, and f16_d() has no Q5_0 either.
  • src/prefill/moe_mmq.cu supported() has Q5_0 only under #ifdef STRATA_ORCA_Q4KS_MMQ (#296). The comment
    above run_tab() says the optional Q5_0 experts "keep the gather".

So 33 of 48 layers drop off the fused int8/F16 prompt path. Without STRATA_ORCA_Q4KS_MMQ they also cannot use the
MMQ table, which matches a prompt read that is about 2x slower overall. Q5_0 gained GPU expert kernels for the
decode/native path in #473 (0.1.38), but the fused prompt kernels never got them.

What would help:

  • A Q5_0 down in the fused prompt kernels on HIP (it is symmetric like IQ4_NL: one delta, fixed -16 offset), or at
    least the MMQ table built with Q5_0 by default.
  • Until then, users who run setup.py against main, or re-download, get the new layout. A note in the docs, or a
    warning at pack build when most down layers are outside d_covered, would explain the slowdown.
    setup.py's HF_REVISIONS pin protects fresh installs. An existing pack does not detect that its source shards were
    replaced, though: native_experts.txt holds offsets into shards by file name, and setup only checks that the pack
    files exist.

I can run a build with STRATA_ORCA_Q4KS_MMQ or a patched d_covered, or a profile of one layer, on this machine if
that would help.

Smallest steps or command that reproduce it

  1. Download UD-IQ4_XS at revision d9620119 (current main of unsloth/Qwen3.8-Flash-Next-GGUF) and build the pack:
    iq_pack.py --gguf Qwen3.8-Flash-Next-UD-IQ4_XS-00001-of-00004.gguf --out packs/unsloth-ud-iq4_xs --compat-bf16.
  2. Start the engine with STRATA_PF_FUSED=1 on gfx1151 and send a 4K-23K token prompt with max_tokens 32.
  3. Repeat with revision 38bb39ee (3 shards, pack rebuilt the same way) and the same flags, then compare
    prompt_per_second.

Reproduction status

Reproduced locally

Strata version

Strata 0.2.10 · engine 0.1.56 (Docker image built from the v0.2.10 tag against ROCm 7.14.1)

Graphics card, memory and system

Radeon 8060S (gfx1151, Ryzen AI Max+ 395, unified memory) · 128 GB RAM · Debian 13, Linux 7.2.11

Model, size and settings

Qwen3.8-Flash-Next UD-IQ4_XS (unsloth) · DFlash2, one slot, --prefill 16384 --kv-resident 32768 · env
STRATA_PF_FUSED=1 STRATA_PF_GEMM=1 STRATA_PF_F16=1 STRATA_HIP_WMMA=1 STRATA_PF_SWITCH_MIN_T=2048 STRATA_PREFILL_STREAM_MIN=128 STRATA_GDN_CHUNKED=1 (plus HC/select flags that do not touch experts)

Logs

No errors in the engine log on either revision; the startup line names the pack and the snapshot path. Logs on request.

Originally created by @luckyrider on GitHub (Nov 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5296 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Docker ### What happened On 2026-11-04 unsloth re-uploaded `unsloth/Qwen3.8-Flash-Next-GGUF` ("Better UD 3.1 quants", now `d9620119`). UD-IQ4_XS is now 4 shards instead of 3, and the expert types changed. On Strix Halo the new file set reads prompts 40-55% slower than the one `setup.py` pins (`HF_REVISIONS`: `38bb39ee`), with the same engine, flags and config. Going back to `38bb39ee` (pack rebuilt with `iq_pack.py`) restores the old numbers exactly. Expert types per layer, from each pack's `native_experts.txt` (48 layers): | revision | gate/up | down | | --- | --- | --- | | `38bb39ee` (setup.py pin) | IQ3_S 47, IQ4_XS 1 | IQ4_NL 43, Q8_0 5 | | `d9620119` (current main) | IQ3_XXS 28, IQ4_XS 17, IQ2_S 3 | **Q5_0 33**, IQ4_NL 13, Q2_0 2 | Measurements: single slot with DFlash2, power profile `performance`. Prompt read in tok/s; decode is 1024 tokens; "agents" is 4 conversations x 3 turns of 15-20K tokens, run sequentially. | | decode T=0 / T=1 (draft accept) | 2.5K | 4K | 11K | 23K | 48K | 100K | agents | | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | | `38bb39ee`, 2026-11-03 | 63.9-66.0 / 62.4-64.3 (0.75 / 0.72) | 870 | 1148 | 1152 | 1293 | 1278 | 1234 | 80.1 s | | `d9620119`, run 1 | 59.6-59.8 / 62.1-62.2 (0.68 / 0.72) | 381 | 529 | 703 | 748 | 760 | 718 | 148.2 s | | `d9620119`, run 2 | 59.5-59.9 / 62.3 (0.68 / 0.72) | 387 | 533 | 711 | 744 | 737 | 742 | 145.5 s | | `38bb39ee` again, 2026-11-05 | 64.4-66.0 / 62.7-64.1 (0.75 / 0.72) | 874 | 1129 | 1275 | 1292 | 1285 | 1253 | 80.1 s | On the agents run, first turns take 23-29 s instead of 12-15 s, and later turns (cache hit, ~1K new tokens) take 4.1-5.1 s instead of 1.5-2.1 s. The decode drop at T=0 seems to be a separate issue: the DFlash2 draft accepts less on the new weights (0.68 vs 0.75). **Likely cause** (the slowdown is measured; this explanation comes from reading the v0.2.10 source and is not profiled): All of the new gate/up types are in `gu_covered()` (IQ3_XXS, IQ4_XS, IQ2_S). Q5_0 is not in the down check, though: - `src/prefill/moe_fused_iq.cu` `d_covered()` on HIP accepts Q2_0 and IQ4_NL, plus Q5_1/Q8_0 only with `STRATA_PF_FUSED_KQ=1`. `d_covered_on()` adds Q8_0 on gfx1151 through the F16 kernel. Q5_0 is not accepted anywhere, and `f16_d()` has no Q5_0 either. - `src/prefill/moe_mmq.cu` `supported()` has Q5_0 only under `#ifdef STRATA_ORCA_Q4KS_MMQ` (#296). The comment above `run_tab()` says the optional Q5_0 experts "keep the gather". So 33 of 48 layers drop off the fused int8/F16 prompt path. Without `STRATA_ORCA_Q4KS_MMQ` they also cannot use the MMQ table, which matches a prompt read that is about 2x slower overall. Q5_0 gained GPU expert kernels for the decode/native path in #473 (0.1.38), but the fused prompt kernels never got them. What would help: - A Q5_0 down in the fused prompt kernels on HIP (it is symmetric like IQ4_NL: one delta, fixed -16 offset), or at least the MMQ table built with Q5_0 by default. - Until then, users who run `setup.py` against `main`, or re-download, get the new layout. A note in the docs, or a warning at pack build when most down layers are outside `d_covered`, would explain the slowdown. `setup.py`'s `HF_REVISIONS` pin protects fresh installs. An existing pack does not detect that its source shards were replaced, though: `native_experts.txt` holds offsets into shards by file name, and setup only checks that the pack files exist. I can run a build with `STRATA_ORCA_Q4KS_MMQ` or a patched `d_covered`, or a profile of one layer, on this machine if that would help. ### Smallest steps or command that reproduce it 1. Download UD-IQ4_XS at revision `d9620119` (current `main` of `unsloth/Qwen3.8-Flash-Next-GGUF`) and build the pack: `iq_pack.py --gguf Qwen3.8-Flash-Next-UD-IQ4_XS-00001-of-00004.gguf --out packs/unsloth-ud-iq4_xs --compat-bf16`. 2. Start the engine with `STRATA_PF_FUSED=1` on gfx1151 and send a 4K-23K token prompt with `max_tokens` 32. 3. Repeat with revision `38bb39ee` (3 shards, pack rebuilt the same way) and the same flags, then compare `prompt_per_second`. ### Reproduction status Reproduced locally ### Strata version Strata 0.2.10 · engine 0.1.56 (Docker image built from the v0.2.10 tag against ROCm 7.14.1) ### Graphics card, memory and system Radeon 8060S (gfx1151, Ryzen AI Max+ 395, unified memory) · 128 GB RAM · Debian 13, Linux 7.2.11 ### Model, size and settings Qwen3.8-Flash-Next UD-IQ4_XS (unsloth) · DFlash2, one slot, `--prefill 16384 --kv-resident 32768` · env `STRATA_PF_FUSED=1 STRATA_PF_GEMM=1 STRATA_PF_F16=1 STRATA_HIP_WMMA=1 STRATA_PF_SWITCH_MIN_T=2048 STRATA_PREFILL_STREAM_MIN=128 STRATA_GDN_CHUNKED=1` (plus HC/select flags that do not touch experts) ### Logs No errors in the engine log on either revision; the startup line names the pack and the snapshot path. Logs on request.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Fill in "Area".
  • Fill in "Desktop app, Terminal or source?".
  • Fill in "Reproduction status".
  • Fill in "Strata version".
  • Fill in "Graphics card, memory and system".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6656823113 --> @github-actions[bot] commented on GitHub (Nov 5, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Fill in "Area". - [ ] Fill in "Desktop app, Terminal or source?". - [ ] Fill in "Reproduction status". - [ ] Fill in "Strata version". - [ ] Fill in "Graphics card, memory and system". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6656864456 --> @github-actions[bot] commented on GitHub (Nov 5, 2026): Thanks, this follows the format now.
Author
Owner

@luckyrider commented on GitHub (Nov 5, 2026):

Re-ran on 0.2.11 (engine 0.1.57) with its own UD-IQ4_XS-v31 entry. Setup was --family unsloth --model UD-IQ4_XS-v31 --gguf-dir <d9620119 snapshot>; all four shards passed the SHA-256 check and it built a fresh pack in packs/unsloth-ud-iq4_xs-v31. Machine, flags and bench are the same as in the issue. The prompt-read gap is unchanged:

decode T=0 / T=1 (draft accept) 2.5K 4K 11K 23K 48K 100K agents
38bb39ee, 0.2.10 (control, 2026-11-05) 64.4-66.0 / 62.7-64.1 (0.75 / 0.72) 874 1129 1275 1292 1285 1253 80.1 s
d9620119, 0.2.10 (2 runs) 59.5-59.9 / 62.1-62.3 (0.68 / 0.72) 381-387 529-533 703-711 744-748 737-760 718-742 145.5-148.2 s
d9620119 as UD-IQ4_XS-v31, 0.2.11 61.5-63.3 / 55.9-56.8 (0.74 / 0.65) 381 521 728 746 757 750 147.3 s
  • Prompt reads: within run-to-run noise of 0.2.10, still 40-56% below 38bb39ee. On the agents run, first turns take 23.3-28.8 s and cached turns 4.1-5.1 s, against 12.5-15.4 s and 1.5-2.1 s on 38bb39ee.
  • Cause: this matches the v0.2.11 source, where d_covered() in src/prefill/moe_fused_iq.cu is unchanged (no Q5_0 on HIP) and moe_mmq.cu still takes Q5_0 only under STRATA_ORCA_Q4KS_MMQ. The 0.2.11 notes say Q5_0 is now computed more exactly, but on gfx1151 those layers still miss the fused prompt path.
  • Decode: T=0 is a bit better than on 0.2.10 (draft acceptance 0.74, was 0.68). T=1.0 is worse (0.65, was 0.72). This is one run of two generations per temperature, so I would not read much into it yet.
  • Not run yet: 38bb39ee on 0.2.11.

One side note in case someone hits the same thing. Setup 0.2.11 wrote this config with --expert-cache auto and no --resident-budget-gib; 0.2.10 always wrote the RAM budget on unified memory. Our tuned config forces --expert-cache 24576 (every expert in the GPU cache), and that combination without the budget ran the 128 GB machine out of memory while starting. The log showed experts loaded: 56.24 GiB, and the server was still not ready after 5 minutes. Adding --resident-budget-gib 55 back fixed it: same 56.24 GiB GPU cache, lowest MemAvailable during the run 34 GiB. This is our own override, so it is probably not a bug in setup's plan. The server also still calls this machine a "12 GB card" (it sees the RTX 3060 through nvidia-smi first, detect_hardware → cuda, ['sm_86', 'gfx1151']), though that start changed no arguments.

Happy to run a build with STRATA_ORCA_Q4KS_MMQ or a branch that adds Q5_0 to d_covered on this machine.

<!-- gh-comment-id:6660060822 --> @luckyrider commented on GitHub (Nov 5, 2026): Re-ran on **0.2.11** (engine 0.1.57) with its own `UD-IQ4_XS-v31` entry. Setup was `--family unsloth --model UD-IQ4_XS-v31 --gguf-dir <d9620119 snapshot>`; all four shards passed the SHA-256 check and it built a fresh pack in `packs/unsloth-ud-iq4_xs-v31`. Machine, flags and bench are the same as in the issue. The prompt-read gap is unchanged: | | decode T=0 / T=1 (draft accept) | 2.5K | 4K | 11K | 23K | 48K | 100K | agents | | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | | `38bb39ee`, 0.2.10 (control, 2026-11-05) | 64.4-66.0 / 62.7-64.1 (0.75 / 0.72) | 874 | 1129 | 1275 | 1292 | 1285 | 1253 | 80.1 s | | `d9620119`, 0.2.10 (2 runs) | 59.5-59.9 / 62.1-62.3 (0.68 / 0.72) | 381-387 | 529-533 | 703-711 | 744-748 | 737-760 | 718-742 | 145.5-148.2 s | | **`d9620119` as UD-IQ4_XS-v31, 0.2.11** | 61.5-63.3 / 55.9-56.8 (0.74 / 0.65) | 381 | 521 | 728 | 746 | 757 | 750 | 147.3 s | - **Prompt reads:** within run-to-run noise of 0.2.10, still 40-56% below `38bb39ee`. On the agents run, first turns take 23.3-28.8 s and cached turns 4.1-5.1 s, against 12.5-15.4 s and 1.5-2.1 s on `38bb39ee`. - **Cause:** this matches the v0.2.11 source, where `d_covered()` in `src/prefill/moe_fused_iq.cu` is unchanged (no Q5_0 on HIP) and `moe_mmq.cu` still takes Q5_0 only under `STRATA_ORCA_Q4KS_MMQ`. The 0.2.11 notes say Q5_0 is now computed more exactly, but on gfx1151 those layers still miss the fused prompt path. - **Decode:** T=0 is a bit better than on 0.2.10 (draft acceptance 0.74, was 0.68). T=1.0 is worse (0.65, was 0.72). This is one run of two generations per temperature, so I would not read much into it yet. - **Not run yet:** `38bb39ee` on 0.2.11. One side note in case someone hits the same thing. Setup 0.2.11 wrote this config with `--expert-cache auto` and no `--resident-budget-gib`; 0.2.10 always wrote the RAM budget on unified memory. Our tuned config forces `--expert-cache 24576` (every expert in the GPU cache), and that combination without the budget ran the 128 GB machine out of memory while starting. The log showed `experts loaded: 56.24 GiB`, and the server was still not ready after 5 minutes. Adding `--resident-budget-gib 55` back fixed it: same 56.24 GiB GPU cache, lowest MemAvailable during the run 34 GiB. This is our own override, so it is probably not a bug in setup's plan. The server also still calls this machine a "12 GB card" (it sees the RTX 3060 through `nvidia-smi` first, `detect_hardware` → `cuda, ['sm_86', 'gfx1151']`), though that start changed no arguments. Happy to run a build with `STRATA_ORCA_Q4KS_MMQ` or a branch that adds Q5_0 to `d_covered` on this machine.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3159
No description provided.