Issues / #2055

#2055 gfx1030 / Windows: prompts read 16–20% slower since 0.1.40.2 — bisected to ac52c2c7 (#1240)

closed · @did-technomancer · 1 Kommentare · Auf GitHub

BenchmarksServer & APIAMD / HIPModels & quantsWindows

Beschreibung

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.

Mehr auf der Site

Links zu Install, Modellen, Releases.