mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[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
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1421
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.pywithstrata --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=1creates the unused draft side stream. 0.1.44.1, 4K prompt,median of 3: default 650.6 tok/s,
STRATA_MTP_SIDE_STREAM=1874.8,STRATA_MTP_HIP_PRIO=0596.3, both off 652.1,GPU_MAX_HW_QUEUES=4/=8597.7 / 596.6. A bisect with the priority injected into the older commits givesac52c2c7(#1240) as the first slow commit (82f46a8c+ prio 845.0,3b499f17+ prio 847.0,ac52c2c7+ prio 632.8, latercommits 632-652).
STRATA_PREFILL_TIMINGputs 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:STRATA_HIP_QUEUE_PRIME=0GPU_MAX_HW_QUEUES=4Decode, 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 wheneverqsa_prompt_attn_matrix_cores_requested()is true; on gfx12 that is the default even with--kv q4_0, where the int8WMMA kernel never runs. With
STRATA_PF_FUSED=1on IQ2_XS, 0.2.0:STRATA_PREFILL_RINGThe 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=1hangs 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 --calibratetries it.
Smaller notes: the shipped
tools/hip/gfx1200-hipblaslt-100202.txthas T buckets 256 / 512 / 2560 only, so 8192-tokenchunks 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=1on gfx1200: kernel 1.12x but its parity check fails (error 1e-3 of the output scale), noend-to-end gain - fine as opt-in.
The final configuration (side stream on, priming off, ring 384) is measured with
strata bench runin #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.)
@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_QUEUESunset (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.STRATA_HIP_QUEUE_PRIME=0The ranges do not overlap, and
=0lands 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 orderor 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=0in six run configs. Happy to test a change toprime_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.@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.
@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 touchprime_hw_queues(). Fresh engine per arm,interleaved, two starts each:
STRATA_HIP_QUEUE_PRIMEunset (the new default rule)STRATA_HIP_QUEUE_PRIME=0With 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-slotbatching and the
bench4kchecks 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.)
@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.Fresh engine per arm, one run per size; the timing tables are in the report.