[GH-ISSUE #3480] [Engine] gfx1200 (RX 9060 XT): prompt speed depends on the draft side stream, 0.2.1 queue priming (-39% with capped HW queues), the 96-slot prompt ring, and SH_STREAM hangs #1421

Closed
opened 2026-11-04 01:51:09 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @shenmintao on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3480

Area

Engine (HIP prompt path, gfx1200)

Desktop app, Terminal or source?

Source build in Docker (ROCm 7.2.3 userspace, hipBLASLt 1.2.2), serve/server.py with strata --serve.

What happened

On an RX 9060 XT (gfx1200) four prompt-path settings decide a large part of the prompt speed, and three of the defaults
are the slow side on this card. Every number is a fresh engine per arm, interleaved with the baseline on the same box,
the run config otherwise identical (IQ2_XS native pack, experts in place with --resident-experts,
--kv q4_0 --max-context 524288 --batch 2 --batch-mtp, MTP on). Answers were unchanged in every arm unless noted.

1. The draft side stream is needed on gfx1200 (since #1240). With the HIP draft priority on (the gfx12 default),
the prompt path is ~35% faster when STRATA_MTP_SIDE_STREAM=1 creates the unused draft side stream. 0.1.44.1, 4K prompt,
median of 3: default 650.6 tok/s, STRATA_MTP_SIDE_STREAM=1 874.8, STRATA_MTP_HIP_PRIO=0 596.3, both off 652.1,
GPU_MAX_HW_QUEUES=4 / =8 597.7 / 596.6. A bisect with the priority injected into the older commits gives
ac52c2c7 (#1240) as the first slow commit (82f46a8c + prio 845.0, 3b499f17 + prio 847.0, ac52c2c7 + prio 632.8, later
commits 632-652). STRATA_PREFILL_TIMING puts the difference in the per-chunk "wait copy". #1240's card was a gfx1201.

2. 0.2.1's queue priming costs 39% here. We also set GPU_MAX_HW_QUEUES=2 (neutral before 0.2.1). Three fresh starts each:

engine 4K prompt tok/s 100K-token document tok/s
0.2.0 + the settings above 1221-1238 1380
0.2.1 default (priming on) 681-753 994
0.2.1, STRATA_HIP_QUEUE_PRIME=0 1188-1238 1386
0.2.1, priming on, GPU_MAX_HW_QUEUES=4 899-1234 (one slow start of three) not run

Decode, two-slot batching and short chat turns were equal in all arms. Our reading (not verified in the runtime):
the two primed normal-priority queues take both hardware queues, so the high-priority draft stream and the side stream of
point 1 share them. Capping the queues is our own setting, so this may only hit people who do the same; the priming could
skip itself (or prime "nh") when GPU_MAX_HW_QUEUES <= 2, or when the draft priority is on.

3. The 96-slot prompt ring is slow for the fused IQ2_XS experts. ring_slots() (prefill.cpp) returns 96 whenever
qsa_prompt_attn_matrix_cores_requested() is true; on gfx12 that is the default even with --kv q4_0, where the int8
WMMA kernel never runs. With STRATA_PF_FUSED=1 on IQ2_XS, 0.2.0:

STRATA_PREFILL_RING 4K prompt 100K document 1.9K-token follow-up at 98K cached
unset (96) 949-962 1169-1179 553-567
384 1164-1185 1269-1275 610-629
1024 1147-1172 1275 619-629

The 96 rule was measured on a 9070 XT with the pinned path; here (fused experts, resident RAM tier) it goes the other way.

4. STRATA_SH_STREAM=1 hangs on gfx1200: strata serve: verify: timed out at layer 1; its GPU waits were released and the GPU finished (#267) on the first decode after start, every time. It is off by default on HIP; setup.sh --calibrate
tries it.

Smaller notes: the shipped tools/hip/gfx1200-hipblaslt-100202.txt has T buckets 256 / 512 / 2560 only, so 8192-token
chunks use the 2560 rows (e.g. bf16 N=2560 K=12288: 14.2 ms, its row retuned at T=8192: 8.9 ms); a retuned table gave +1-2%
end to end. STRATA_PA_FAST=1 on gfx1200: kernel 1.12x but its parity check fails (error 1e-3 of the output scale), no
end-to-end gain - fine as opt-in.

The final configuration (side stream on, priming off, ring 384) is measured with strata bench run in #3481: 4K 1219.5 tok/s, 16K 1507.8, decode 41.6-45.9, sanity 12/12.

Reproduction status

Reproduced locally, repeatedly (fresh engines, interleaved arms). Not tested on gfx1201 or on Windows.

Strata version

0.2.1 (engine 0.1.46.1, upstream 9ae93f7b) for point 2; 0.2.0 for point 3; 0.1.44.1 and the bisect for point 1;
0.2.0 for point 4. Runs with our ten local commits (github.com/shenmintao/Strata branch nas/gfx1200-021); none of them
touches the code paths above.

Graphics card, memory and system

AMD Radeon RX 9060 XT 16 GB (gfx1200) on PCIe 4.0 x8; i7-12700H (no AVX-512); 64 GB DDR4-3200; fnOS (Debian 12 based,
kernel 6.18) host, Docker with ROCm 7.2.3 userspace.

Related: #3481 (standard benchmark of this configuration), #3482 (draft: opt-in Q4_0-KV WMMA prompt attention).

Happy to run other variants on this card. (Prepared with an AI assistant; every number comes from the logged runs.)

Originally created by @shenmintao on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3480 ### Area Engine (HIP prompt path, gfx1200) ### Desktop app, Terminal or source? Source build in Docker (ROCm 7.2.3 userspace, hipBLASLt 1.2.2), `serve/server.py` with `strata --serve`. ### What happened On an RX 9060 XT (gfx1200) four prompt-path settings decide a large part of the prompt speed, and three of the defaults are the slow side on this card. Every number is a fresh engine per arm, interleaved with the baseline on the same box, the run config otherwise identical (IQ2_XS native pack, experts in place with `--resident-experts`, `--kv q4_0 --max-context 524288 --batch 2 --batch-mtp`, MTP on). Answers were unchanged in every arm unless noted. **1. The draft side stream is needed on gfx1200 (since #1240).** With the HIP draft priority on (the gfx12 default), the prompt path is ~35% faster when `STRATA_MTP_SIDE_STREAM=1` creates the unused draft side stream. 0.1.44.1, 4K prompt, median of 3: default 650.6 tok/s, `STRATA_MTP_SIDE_STREAM=1` **874.8**, `STRATA_MTP_HIP_PRIO=0` 596.3, both off 652.1, `GPU_MAX_HW_QUEUES=4` / `=8` 597.7 / 596.6. A bisect with the priority injected into the older commits gives `ac52c2c7` (#1240) as the first slow commit (82f46a8c + prio 845.0, 3b499f17 + prio 847.0, ac52c2c7 + prio 632.8, later commits 632-652). `STRATA_PREFILL_TIMING` puts the difference in the per-chunk "wait copy". #1240's card was a gfx1201. **2. 0.2.1's queue priming costs 39% here.** We also set `GPU_MAX_HW_QUEUES=2` (neutral before 0.2.1). Three fresh starts each: | engine | 4K prompt tok/s | 100K-token document tok/s | |---|---:|---:| | 0.2.0 + the settings above | 1221-1238 | 1380 | | 0.2.1 default (priming on) | 681-753 | 994 | | 0.2.1, `STRATA_HIP_QUEUE_PRIME=0` | 1188-1238 | 1386 | | 0.2.1, priming on, `GPU_MAX_HW_QUEUES=4` | 899-1234 (one slow start of three) | not run | Decode, two-slot batching and short chat turns were equal in all arms. Our reading (not verified in the runtime): the two primed normal-priority queues take both hardware queues, so the high-priority draft stream and the side stream of point 1 share them. Capping the queues is our own setting, so this may only hit people who do the same; the priming could skip itself (or prime "nh") when `GPU_MAX_HW_QUEUES` <= 2, or when the draft priority is on. **3. The 96-slot prompt ring is slow for the fused IQ2_XS experts.** `ring_slots()` (prefill.cpp) returns 96 whenever `qsa_prompt_attn_matrix_cores_requested()` is true; on gfx12 that is the default even with `--kv q4_0`, where the int8 WMMA kernel never runs. With `STRATA_PF_FUSED=1` on IQ2_XS, 0.2.0: | `STRATA_PREFILL_RING` | 4K prompt | 100K document | 1.9K-token follow-up at 98K cached | |---|---:|---:|---:| | unset (96) | 949-962 | 1169-1179 | 553-567 | | 384 | 1164-1185 | 1269-1275 | 610-629 | | 1024 | 1147-1172 | 1275 | 619-629 | The 96 rule was measured on a 9070 XT with the pinned path; here (fused experts, resident RAM tier) it goes the other way. **4. `STRATA_SH_STREAM=1` hangs on gfx1200**: `strata serve: verify: timed out at layer 1; its GPU waits were released and the GPU finished (#267)` on the first decode after start, every time. It is off by default on HIP; `setup.sh --calibrate` tries it. Smaller notes: the shipped `tools/hip/gfx1200-hipblaslt-100202.txt` has T buckets 256 / 512 / 2560 only, so 8192-token chunks use the 2560 rows (e.g. bf16 N=2560 K=12288: 14.2 ms, its row retuned at T=8192: 8.9 ms); a retuned table gave +1-2% end to end. `STRATA_PA_FAST=1` on gfx1200: kernel 1.12x but its parity check fails (error 1e-3 of the output scale), no end-to-end gain - fine as opt-in. The final configuration (side stream on, priming off, ring 384) is measured with `strata bench run` in #3481: 4K 1219.5 tok/s, 16K 1507.8, decode 41.6-45.9, sanity 12/12. ### Reproduction status Reproduced locally, repeatedly (fresh engines, interleaved arms). Not tested on gfx1201 or on Windows. ### Strata version 0.2.1 (engine 0.1.46.1, upstream 9ae93f7b) for point 2; 0.2.0 for point 3; 0.1.44.1 and the bisect for point 1; 0.2.0 for point 4. Runs with our ten local commits (github.com/shenmintao/Strata branch nas/gfx1200-021); none of them touches the code paths above. ### Graphics card, memory and system AMD Radeon RX 9060 XT 16 GB (gfx1200) on PCIe 4.0 x8; i7-12700H (no AVX-512); 64 GB DDR4-3200; fnOS (Debian 12 based, kernel 6.18) host, Docker with ROCm 7.2.3 userspace. Related: #3481 (standard benchmark of this configuration), #3482 (draft: opt-in Q4_0-KV WMMA prompt attention). Happy to run other variants on this card. (Prepared with an AI assistant; every number comes from the logged runs.)
Author
Owner

@Confuzedstuff commented on GitHub (Oct 20, 2026):

Independent: −21% on a 3-card gfx1201 layer split, with the DEFAULT queue count

Confirming point 2 on different hardware — and, more usefully, without capping GPU_MAX_HW_QUEUES.

This answers the open question in your reading. You wrote "Capping the queues is our own setting, so this may only hit people who do the same." It is not limited to that: we run GPU_MAX_HW_QUEUES unset (HIP default 4 — absent from the run config, and absent from the engine's own environ) and priming still costs us ~21%.

Setup. 3× Radeon RX 9070 XT (gfx1201), 62 GB RAM, CachyOS, kernel 7.2.9, ROCm 7.2.4 / hipBLASLt 1.2.0 (100202), source build. Qwen3.8-Flash-Next GSQ-RCO IQ3_S, gpu [1,0,2], layer_split 16,32, --pipeline-windows 2 --spec 4 --kv int8 --kv-resident 32768 --resident-experts, MTP on, --max-context 393216. A fresh engine per boot, four fresh ~22.3k-token prompts per boot; the plateau is the best of the four. This measured the prompt path only — decode was not an endpoint.

engine prime boots mean plateau range
0.1.45.3 (no priming code) — 10 1940 1667–2038
0.1.46.3 (0.2.1) on (default) 4 1533 1438–1618
0.1.46.3 (0.2.1) STRATA_HIP_QUEUE_PRIME=0 6 1954 1776–2068

The ranges do not overlap, and =0 lands on the pre-0.2.1 baseline (+0.7%).

Engagement was verified per boot rather than assumed: each boot's log window either contains strata generate: opened 2 GPU queues in a fixed order or does not — 4/4 with priming, 6/6 without.

Where it differs from your result. Your loss is larger (−39% capped) and you also see it on a 100K document; ours is ~21% and prompts only. Card count may matter: prime_hw_queues() primes device 0 only (dev = STRATA_PRIMARY_DEVICE or 0), while our prompt path spans three stages.

One side effect you may want for point 1. On this rig the priming does make placement deterministic — boot-to-boot SD fell 124 → 74 tok/s — it just pins the slow one. (n=10 vs n=4, so that direction is suggestive only, not significant.)

Workaround in use here: STRATA_HIP_QUEUE_PRIME=0 in six run configs. Happy to test a change to prime_hw_queues() (e.g. skip it on a multi-GPU layer split, or prime each stage's device instead of device 0 only) — a 3-stage gfx1201 rig is a useful third data point beyond your gfx1200 and the R9700.


Reproduction status: reproduced locally. Strata version: 0.2.1 (origin/main 9de04cd4), engine 0.1.46.3, gfx1201.

<!-- gh-comment-id:6304431324 --> @Confuzedstuff commented on GitHub (Oct 20, 2026): ### Independent: −21% on a 3-card gfx1201 layer split, with the DEFAULT queue count Confirming point 2 on different hardware — and, more usefully, **without** capping `GPU_MAX_HW_QUEUES`. **This answers the open question in your reading.** You wrote "Capping the queues is our own setting, so this may only hit people who do the same." It is not limited to that: we run `GPU_MAX_HW_QUEUES` unset (HIP default 4 — absent from the run config, and absent from the engine's own environ) and priming still costs us ~21%. **Setup.** 3× Radeon RX 9070 XT (gfx1201), 62 GB RAM, CachyOS, kernel 7.2.9, ROCm 7.2.4 / hipBLASLt 1.2.0 (100202), source build. Qwen3.8-Flash-Next GSQ-RCO IQ3_S, `gpu [1,0,2]`, `layer_split 16,32`, `--pipeline-windows 2 --spec 4 --kv int8 --kv-resident 32768 --resident-experts`, MTP on, `--max-context 393216`. A fresh engine per boot, four fresh ~22.3k-token prompts per boot; the plateau is the best of the four. This measured the prompt path only — decode was not an endpoint. | engine | prime | boots | mean plateau | range | |---|---:|---:|---:|---| | 0.1.45.3 (no priming code) | — | 10 | 1940 | 1667–2038 | | 0.1.46.3 (0.2.1) | on (default) | 4 | **1533** | 1438–1618 | | 0.1.46.3 (0.2.1) | `STRATA_HIP_QUEUE_PRIME=0` | 6 | **1954** | 1776–2068 | The ranges do not overlap, and `=0` lands on the pre-0.2.1 baseline (+0.7%). Engagement was verified per boot rather than assumed: each boot's log window either contains `strata generate: opened 2 GPU queues in a fixed order` or does not — 4/4 with priming, 6/6 without. **Where it differs from your result.** Your loss is larger (−39% capped) and you also see it on a 100K document; ours is ~21% and prompts only. Card count may matter: `prime_hw_queues()` primes **device 0 only** (`dev = STRATA_PRIMARY_DEVICE or 0`), while our prompt path spans three stages. **One side effect you may want for point 1.** On this rig the priming does make placement deterministic — boot-to-boot SD fell 124 → 74 tok/s — it just pins the slow one. (n=10 vs n=4, so that direction is suggestive only, not significant.) **Workaround in use here:** `STRATA_HIP_QUEUE_PRIME=0` in six run configs. Happy to test a change to `prime_hw_queues()` (e.g. skip it on a multi-GPU layer split, or prime each stage's device instead of device 0 only) — a 3-stage gfx1201 rig is a useful third data point beyond your gfx1200 and the R9700. --- Reproduction status: reproduced locally. Strata version: 0.2.1 (origin/main `9de04cd4`), engine 0.1.46.3, gfx1201.
Author
Owner

@Niko1221 commented on GitHub (Oct 21, 2026):

Point 2: Fixed for 0.2.2, the next release (not out yet). The queue priming is skipped when GPU_MAX_HW_QUEUES is 1 or 2. Points 1, 3 and 4 are not changed: we have no gfx1200 card to measure the side stream, the 96-slot ring or SH_STREAM on.

<!-- gh-comment-id:6308100122 --> @Niko1221 commented on GitHub (Oct 21, 2026): Point 2: Fixed for 0.2.2, the next release (not out yet). The queue priming is skipped when GPU_MAX_HW_QUEUES is 1 or 2. Points 1, 3 and 4 are not changed: we have no gfx1200 card to measure the side stream, the 96-slot ring or SH_STREAM on.
Author
Owner

@shenmintao commented on GitHub (Oct 21, 2026):

Measured the 0.2.2 fix on the gfx1200 from this issue (RX 9060 XT 16 GB, GPU_MAX_HW_QUEUES=2, same run config as above).
Engine: v0.2.2 (011c9e60) + our local commits, none of which touch prime_hw_queues(). Fresh engine per arm,
interleaved, two starts each:

engine / setting 4K prompt tok/s (3 runs per start) diverse 4K prompts
0.2.1, priming on (default then; three starts, from the report above) 681-753 722-738
0.2.2, STRATA_HIP_QUEUE_PRIME unset (the new default rule) 1197-1238 / 1202-1235 1134-1161 / 1122-1142
0.2.2, STRATA_HIP_QUEUE_PRIME=0 1207-1236 / 1206-1229 1140-1146 / 1128-1161

With the variable unset the start-up log says strata generate: GPU queues not primed: GPU_MAX_HW_QUEUES=2 leaves none for the draft stream (STRATA_HIP_QUEUE_PRIME=nn ... and the prompt speed equals the explicit opt-out; decode, two-slot
batching and the bench4k checks were the same in all arms. So the fix works here as intended; we keep running 0.2.2.
(This covers the capped case only; the uncapped three-card gfx1201 case reported above by Confuzedstuff is not affected by the new rule.)

<!-- gh-comment-id:6319071436 --> @shenmintao commented on GitHub (Oct 21, 2026): Measured the 0.2.2 fix on the gfx1200 from this issue (RX 9060 XT 16 GB, `GPU_MAX_HW_QUEUES=2`, same run config as above). Engine: v0.2.2 (`011c9e60`) + our local commits, none of which touch `prime_hw_queues()`. Fresh engine per arm, interleaved, two starts each: | engine / setting | 4K prompt tok/s (3 runs per start) | diverse 4K prompts | |---|---|---| | 0.2.1, priming on (default then; three starts, from the report above) | 681-753 | 722-738 | | 0.2.2, `STRATA_HIP_QUEUE_PRIME` unset (the new default rule) | 1197-1238 / 1202-1235 | 1134-1161 / 1122-1142 | | 0.2.2, `STRATA_HIP_QUEUE_PRIME=0` | 1207-1236 / 1206-1229 | 1140-1146 / 1128-1161 | With the variable unset the start-up log says `strata generate: GPU queues not primed: GPU_MAX_HW_QUEUES=2 leaves none for the draft stream (STRATA_HIP_QUEUE_PRIME=nn ...` and the prompt speed equals the explicit opt-out; decode, two-slot batching and the `bench4k` checks were the same in all arms. So the fix works here as intended; we keep running 0.2.2. (This covers the capped case only; the uncapped three-card gfx1201 case reported above by Confuzedstuff is not affected by the new rule.)
Author
Owner

@codywb commented on GitHub (Nov 2, 2026):

Points 1 and 3 measured on a second RX 9060 XT 16 GB (gfx1200, Linux), with a different setup from this issue's: IQ3_S, experts from the page-cached experts.bin mapping (--mmap-experts, not a resident RAM tier), --kv int8, 0.2.9 (github.com/Niko1221/Strata@c62d5e3a15). Full report: https://github.com/Niko1221/Strata/issues/5001.

Point 3 (ring). With the fused prompt experts on, STRATA_PREFILL_TIMING at 32K: the expert GEMMs drop by 6.3 s against MMQ and "wait copy" rises by 6.6 s (531 to 7,142 ms), so prompt tok/s stays the same. STRATA_PREFILL_RING=512 or =1024 only fits by shrinking the chunk ("prompt chunk auto: 5632 tokens, a 512-slot ring"), and 32K went from 1009 to 930 to 939 tok/s with the copy wait still about 6.9 s. --prefill 16384 gets clamped back to 8192 ("so its buffers fit in every expert cache"). On a 16 GB card with unpinned experts, the copies seem to be the limit rather than the slot count.
Point 1 (side stream). STRATA_MTP_SIDE_STREAM=1 did not speed up prompts on this config, with or without the draft priority (0.2.2: 4K / 32K / 64K 702 / 1017 / 943 without it, 671 / 1002 / 872 with it). The gfx12 default STRATA_MTP_HIP_PRIO on made 0.2.2's 32K and 64K prompts about 21% slower here (795 and 748 tok/s), so this box keeps STRATA_MTP_HIP_PRIO=0.

Fresh engine per arm, one run per size; the timing tables are in the report.

<!-- gh-comment-id:6577341931 --> @codywb commented on GitHub (Nov 2, 2026): Points 1 and 3 measured on a second RX 9060 XT 16 GB (gfx1200, Linux), with a different setup from this issue's: IQ3_S, experts from the page-cached experts.bin mapping (--mmap-experts, not a resident RAM tier), --kv int8, 0.2.9 (https://github.com/Niko1221/Strata/commit/c62d5e3a15b40ea51c96aae9e8d36928965f53ab). Full report: https://github.com/Niko1221/Strata/issues/5001. Point 3 (ring). With the fused prompt experts on, STRATA_PREFILL_TIMING at 32K: the expert GEMMs drop by 6.3 s against MMQ and "wait copy" rises by 6.6 s (531 to 7,142 ms), so prompt tok/s stays the same. STRATA_PREFILL_RING=512 or =1024 only fits by shrinking the chunk ("prompt chunk auto: 5632 tokens, a 512-slot ring"), and 32K went from 1009 to 930 to 939 tok/s with the copy wait still about 6.9 s. --prefill 16384 gets clamped back to 8192 ("so its buffers fit in every expert cache"). On a 16 GB card with unpinned experts, the copies seem to be the limit rather than the slot count. Point 1 (side stream). STRATA_MTP_SIDE_STREAM=1 did not speed up prompts on this config, with or without the draft priority (0.2.2: 4K / 32K / 64K 702 / 1017 / 943 without it, 671 / 1002 / 872 with it). The gfx12 default STRATA_MTP_HIP_PRIO on made 0.2.2's 32K and 64K prompts about 21% slower here (795 and 748 tok/s), so this box keeps STRATA_MTP_HIP_PRIO=0. Fresh engine per arm, one run per size; the timing tables are in the report.
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#1421
No description provided.