[GH-ISSUE #2055] gfx1030 / Windows: prompts read 16–20% slower since 0.1.40.2 — bisected to ac52c2c7 (#1240) #822

Closed
opened 2026-11-04 01:46:13 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @did-technomancer on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2055

On an RX 6800 (gfx1030) under Windows, prompts have read 16–20% slower since 0.1.40.2, and still do on 0.1.43.
git bisect points at ac52c2c7 (#1240, "HIP does not create the draft's unused shared-expert branch stream and two
events"). With those three lines reverted, 0.1.42 and 0.1.43 read 34–45% faster.

GPU      AMD Radeon RX 6800 16 GB (gfx1030), two monitors on it
CPU      AMD Ryzen 7 5700X3D, 8 cores / 16 threads, AVX2, no AVX-512
RAM      64 GB DDR4-3200 (4x16)
Board    ASUS TUF GAMING B550M-PLUS
Storage  model on XPG Spectrix S40G 2 TB (NVMe PCIe 3.0 x4, DRAM cache, via the B550 chipset)
OS       Windows 11 Pro for Workstations 26H2 (build 26300)
ROCm     10.2.0a20260930 (TheRock), rocBLAS 5.8.0.efafc1c1
Engine   every tag (v0.1.40 … v0.1.43) built here: tools\hip\build_windows.bat, STRATA_HIP_ARCHS=gfx1030
Model    Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS, --kv int8 --kv-resident 32768, 128K context, MTP --spec 4,
         --draft-vocab cyrillic, --prefill 8192 (on 0.1.40–0.1.41 auto picks the same 8192)
Env      STRATA_HIP_PROMPT_F16=1, nothing else

Versions (one session, one server per row; the prompts are serve/server.py's code, temperature 0):

Version 7.9K prompt, tok/s 30.4K prompt, tok/s 3 prompts of ~850 tokens, tok/s Decode en / uk / code, tok/s
0.1.40 (twice) 719 / 728 765 / 760 173–185 48.1–49.6 / 57.3–57.8 / 53.6–56.2
0.1.40.2 609 623 160–168 51.3 / 59.0 / 57.8
0.1.40.3 612 622 159–168 51.6 / 58.9 / 53.7
0.1.40.4 603 619 157–163 48.5 / 55.8 / 52.3
0.1.41 605 620 157–165 50.0 / 57.5 / 54.4
0.1.42 (three times) 602–606 612–619 156–165 47.0–48.4 / 55.0–57.1 / 52.5–55.7
0.1.42 without ac52c2c7 (twice) 810 / 805 854 / 862 159–166 47.3–48.5 / 52.0–53.5 / 50.4–53.3
0.1.43 (twice) 579 / 599 597 / 619 144–165 47.0–50.3 / 52.8–56.9 / 52.3–55.6
0.1.43 without ac52c2c7 (twice) 805 / 826 865 / 869 160–179 47.7–48.5 / 54.2–55.7 / 52.3–55.7

Bisect between v0.1.40.1 and v0.1.40.2: at each step a build, a cold start and two reads of the same 7.9K-token
prompt (first / second, tok/s). The same two reads on the builds above: 0.1.40 gives 697 / 779 and 688 / 780;
0.1.40.2 gives 564 / 614 and 570 / 616.

Commit First / second read
471303d9 779 / 880 good
6d69cd50 574 / 630 bad
423f5893 582 / 634 bad
b56d6e3a 754 / 842 good
3b499f17 780 / 880 good
e01cbf0d 587 / 629 bad
48d2e6ca 583 / 629 bad
ac52c2c7 587 / 633 bad — the first bad commit

ac52c2c7 stops HIP from creating side_, sh_fork_ and sh_join_ in MtpDrafter::load, because nothing uses them
and on an R9700 they slowed prompts after the first request. On this card it is the other way round.

Which of the three (0.1.43 + a local switch in MtpDrafter::load, one server per row):

Created 7.9K prompt, tok/s 30.4K prompt, tok/s Decode en / uk / code, tok/s
nothing (as in 0.1.43) 603 616 47.7 / 56.5 / 53.0
the stream and the two events 815 866 47.7 / 57.5 / 53.5
the side_ stream only 819 866 49.1 / 56.2 / 52.4
the two events only 604 612 49.4 / 58.2 / 53.3

The stream alone is enough, though nothing uses it; the events change nothing.

Where the time goes (STRATA_PREFILL_TIMING=1, the same two prompts; phases that did not move are left out):

Phase, ms 7,861 tokens: no stream with the stream 30,381 tokens: no stream with the stream
GPU timeline 13,060 9,914 50,014 37,406
wait copy 3,081 75 12,642 288
dequant 1,026 890 3,894 3,547
gemm gate/up 1,586 1,626 6,008 6,139
hc read 1,854 1,843 5,172 5,105
qsa attn 1,079 1,068 4,587 4,569

All of the difference is in wait copy: without a second non-blocking stream a quarter of the prompt's time is spent
waiting for copies. I don't know why the stream's existence removes that; this is a measurement, not an explanation.

Still open: short prompts (~850 tokens) have been about 10% slower since 0.1.40.2, and reverting ac52c2c7 barely
changes them, so that has another cause, which I did not look for.

Separately, on 0.1.43: STRATA_ROUTE_TAIL_SKIP=7 set by hand on this card (it is not the default on gfx103x) gives
decode 52.7 / 61.6 / 63.2 tok/s against 47.0–50.3 / 52.8–56.9 / 52.3–55.6 without it; on 0.1.42 the quality suite
with it (22 tasks: 12 hard Python, 4 JS, 3 SQL, 3 regex) was 22/22.

Fix: #2056 — the stream is created on gfx103x only, STRATA_MTP_SIDE_STREAM=0/1 overrides it, and other HIP cards
stay as they are.

Originally created by @did-technomancer on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2055 On an RX 6800 (gfx1030) under Windows, prompts have read 16–20% slower since 0.1.40.2, and still do on 0.1.43. `git bisect` points at `ac52c2c7` (#1240, "HIP does not create the draft's unused shared-expert branch stream and two events"). With those three lines reverted, 0.1.42 and 0.1.43 read 34–45% faster. ```text GPU AMD Radeon RX 6800 16 GB (gfx1030), two monitors on it CPU AMD Ryzen 7 5700X3D, 8 cores / 16 threads, AVX2, no AVX-512 RAM 64 GB DDR4-3200 (4x16) Board ASUS TUF GAMING B550M-PLUS Storage model on XPG Spectrix S40G 2 TB (NVMe PCIe 3.0 x4, DRAM cache, via the B550 chipset) OS Windows 11 Pro for Workstations 26H2 (build 26300) ROCm 10.2.0a20260930 (TheRock), rocBLAS 5.8.0.efafc1c1 Engine every tag (v0.1.40 … v0.1.43) built here: tools\hip\build_windows.bat, STRATA_HIP_ARCHS=gfx1030 Model Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS, --kv int8 --kv-resident 32768, 128K context, MTP --spec 4, --draft-vocab cyrillic, --prefill 8192 (on 0.1.40–0.1.41 auto picks the same 8192) Env STRATA_HIP_PROMPT_F16=1, nothing else ``` **Versions** (one session, one server per row; the prompts are `serve/server.py`'s code, temperature 0): | Version | 7.9K prompt, tok/s | 30.4K prompt, tok/s | 3 prompts of ~850 tokens, tok/s | Decode en / uk / code, tok/s | | --- | --- | --- | --- | --- | | 0.1.40 (twice) | 719 / 728 | 765 / 760 | 173–185 | 48.1–49.6 / 57.3–57.8 / 53.6–56.2 | | 0.1.40.2 | 609 | 623 | 160–168 | 51.3 / 59.0 / 57.8 | | 0.1.40.3 | 612 | 622 | 159–168 | 51.6 / 58.9 / 53.7 | | 0.1.40.4 | 603 | 619 | 157–163 | 48.5 / 55.8 / 52.3 | | 0.1.41 | 605 | 620 | 157–165 | 50.0 / 57.5 / 54.4 | | 0.1.42 (three times) | 602–606 | 612–619 | 156–165 | 47.0–48.4 / 55.0–57.1 / 52.5–55.7 | | **0.1.42 without `ac52c2c7`** (twice) | **810 / 805** | **854 / 862** | 159–166 | 47.3–48.5 / 52.0–53.5 / 50.4–53.3 | | 0.1.43 (twice) | 579 / 599 | 597 / 619 | 144–165 | 47.0–50.3 / 52.8–56.9 / 52.3–55.6 | | **0.1.43 without `ac52c2c7`** (twice) | **805 / 826** | **865 / 869** | 160–179 | 47.7–48.5 / 54.2–55.7 / 52.3–55.7 | **Bisect** between `v0.1.40.1` and `v0.1.40.2`: at each step a build, a cold start and two reads of the same 7.9K-token prompt (first / second, tok/s). The same two reads on the builds above: 0.1.40 gives 697 / 779 and 688 / 780; 0.1.40.2 gives 564 / 614 and 570 / 616. | Commit | First / second read | | | --- | --- | --- | | `471303d9` | 779 / 880 | good | | `6d69cd50` | 574 / 630 | bad | | `423f5893` | 582 / 634 | bad | | `b56d6e3a` | 754 / 842 | good | | `3b499f17` | 780 / 880 | good | | `e01cbf0d` | 587 / 629 | bad | | `48d2e6ca` | 583 / 629 | bad | | `ac52c2c7` | 587 / 633 | bad — the first bad commit | `ac52c2c7` stops HIP from creating `side_`, `sh_fork_` and `sh_join_` in `MtpDrafter::load`, because nothing uses them and on an R9700 they slowed prompts after the first request. On this card it is the other way round. **Which of the three** (0.1.43 + a local switch in `MtpDrafter::load`, one server per row): | Created | 7.9K prompt, tok/s | 30.4K prompt, tok/s | Decode en / uk / code, tok/s | | --- | --- | --- | --- | | nothing (as in 0.1.43) | 603 | 616 | 47.7 / 56.5 / 53.0 | | the stream and the two events | 815 | 866 | 47.7 / 57.5 / 53.5 | | the `side_` stream only | 819 | 866 | 49.1 / 56.2 / 52.4 | | the two events only | 604 | 612 | 49.4 / 58.2 / 53.3 | The stream alone is enough, though nothing uses it; the events change nothing. **Where the time goes** (`STRATA_PREFILL_TIMING=1`, the same two prompts; phases that did not move are left out): | Phase, ms | 7,861 tokens: no stream | with the stream | 30,381 tokens: no stream | with the stream | | --- | --- | --- | --- | --- | | GPU timeline | 13,060 | 9,914 | 50,014 | 37,406 | | **wait copy** | **3,081** | **75** | **12,642** | **288** | | dequant | 1,026 | 890 | 3,894 | 3,547 | | gemm gate/up | 1,586 | 1,626 | 6,008 | 6,139 | | hc read | 1,854 | 1,843 | 5,172 | 5,105 | | qsa attn | 1,079 | 1,068 | 4,587 | 4,569 | All of the difference is in `wait copy`: without a second non-blocking stream a quarter of the prompt's time is spent waiting for copies. I don't know why the stream's existence removes that; this is a measurement, not an explanation. Still open: short prompts (~850 tokens) have been about 10% slower since 0.1.40.2, and reverting `ac52c2c7` barely changes them, so that has another cause, which I did not look for. Separately, on 0.1.43: `STRATA_ROUTE_TAIL_SKIP=7` set by hand on this card (it is not the default on gfx103x) gives decode 52.7 / 61.6 / 63.2 tok/s against 47.0–50.3 / 52.8–56.9 / 52.3–55.6 without it; on 0.1.42 the quality suite with it (22 tasks: 12 hard Python, 4 JS, 3 SQL, 3 regex) was 22/22. Fix: #2056 — the stream is created on gfx103x only, `STRATA_MTP_SIDE_STREAM=0/1` overrides it, and other HIP cards stay as they are.
Author
Owner

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

Thanks for the bisect and for the fix in #2056. The change is right and scoped: HIP creates the drafter's side stream only when the arch starts with gfx103, STRATA_MTP_SIDE_STREAM=1/0 overrides, CUDA is untouched. I checked a gfx1201 (R9700) with and without it: 8K and 30K prompts 1352/1649 tok/s without the stream, 1347/1648 with the patch, so gfx12 is unchanged. As a side measurement, creating extra spare streams at that spot on the R9700 moves prompt speed up and down (one extra: 0%, two: +0.7%/+3.7%, three: -11%/-6.5%), which fits your finding that the stream's existence matters: the number of streams created before the prompt path probably decides which hardware queue its copy and compute streams share. So the gfx103 gate is a good fix for now; the real cure is to pick that stream layout on purpose. It is ported on our 0.1.43.1 branch with your authorship.

<!-- gh-comment-id:6129340376 --> @Niko1221 commented on GitHub (Oct 12, 2026): Thanks for the bisect and for the fix in #2056. The change is right and scoped: HIP creates the drafter's side stream only when the arch starts with gfx103, STRATA_MTP_SIDE_STREAM=1/0 overrides, CUDA is untouched. I checked a gfx1201 (R9700) with and without it: 8K and 30K prompts 1352/1649 tok/s without the stream, 1347/1648 with the patch, so gfx12 is unchanged. As a side measurement, creating extra spare streams at that spot on the R9700 moves prompt speed up and down (one extra: 0%, two: +0.7%/+3.7%, three: -11%/-6.5%), which fits your finding that the stream's existence matters: the number of streams created before the prompt path probably decides which hardware queue its copy and compute streams share. So the gfx103 gate is a good fix for now; the real cure is to pick that stream layout on purpose. It is ported on our 0.1.43.1 branch with your authorship.
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#822
No description provided.