[GH-ISSUE #816] 0.1.39: decode on an RX 6800 (gfx1030, Windows) is 12-22% slower than 0.1.38; STRATA_SH_STREAM=0 removes it #366

Closed
opened 2026-11-04 01:42:21 +07:00 by bsakaguchi · 12 comments
Owner

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

GPU      AMD Radeon RX 6800 16 GB (gfx1030)
CPU      AMD Ryzen 7 5700X3D
RAM      64 GB DDR4-3200
OS       Windows 11 26H2 (build 26300)
Driver   AMD 32.0.21043.10005
ROCm     10.2.0a20260930
Model    IQ2_XS, 128K context, setup's configuration unchanged
  • 0.1.38: release strata-windows-x64-hip.zip; built here the same way as 0.1.39, it gave the same numbers
  • 0.1.39: tag v0.1.39 built here with tools\hip\build_windows.bat, STRATA_HIP_ARCHS=gfx1030; the release zip was
    not run
  • Decode: tok/s from the engine's timings, each value a separate run
Engine English Ukrainian Code Prompt 30.3K
0.1.38 50.5 / 55.2 40.8 / 42.3 57.2 / 55.8 309 / 310
0.1.39 42.6 / 42.5 32.9 / 32.5 49.2 / 50.2 310 / 311
0.1.39 + STRATA_SH_STREAM=0 56.4 / 57.0 / 55.5 / 54.2 43.5 / 44.3 / 43.2 / 43.0 62.7 / 62.9 / 60.5 / 61.5 311

0.1.39's new decode switches, turned off one at a time (1 run each):

Changed English Ukrainian Code
nothing 42.5 32.5 50.2
STRATA_SH_STREAM=0 56.4 43.5 62.7
STRATA_IQ_STAGE_GRID=0 43.5 34.6 51.8
STRATA_PLE_BATCH=0 41.6 33.0 49.0
STRATA_OLD_IQ_MMVQ=1 43.3 32.5 47.9
STRATA_DEC_BATCH=0 40.0 31.8 45.4

On IQ3_XXS (--draft-vocab cyrillic) 0.1.39 + STRATA_SH_STREAM=0 gives 49.2 / 55.2 / 52.0 against 42.2 / 45.7 / 42.8
on 0.1.38. Why the shared expert's second stream costs this much here was not profiled.

Full report, scripts and data: https://github.com/Niko1221/Strata/pull/815

Originally created by @did-technomancer on GitHub (Oct 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/816 ```text GPU AMD Radeon RX 6800 16 GB (gfx1030) CPU AMD Ryzen 7 5700X3D RAM 64 GB DDR4-3200 OS Windows 11 26H2 (build 26300) Driver AMD 32.0.21043.10005 ROCm 10.2.0a20260930 Model IQ2_XS, 128K context, setup's configuration unchanged ``` - 0.1.38: release `strata-windows-x64-hip.zip`; built here the same way as 0.1.39, it gave the same numbers - 0.1.39: tag `v0.1.39` built here with `tools\hip\build_windows.bat`, `STRATA_HIP_ARCHS=gfx1030`; the release zip was not run - Decode: tok/s from the engine's timings, each value a separate run | Engine | English | Ukrainian | Code | Prompt 30.3K | | --- | --- | --- | --- | ---: | | 0.1.38 | 50.5 / 55.2 | 40.8 / 42.3 | 57.2 / 55.8 | 309 / 310 | | 0.1.39 | 42.6 / 42.5 | 32.9 / 32.5 | 49.2 / 50.2 | 310 / 311 | | 0.1.39 + `STRATA_SH_STREAM=0` | 56.4 / 57.0 / 55.5 / 54.2 | 43.5 / 44.3 / 43.2 / 43.0 | 62.7 / 62.9 / 60.5 / 61.5 | 311 | 0.1.39's new decode switches, turned off one at a time (1 run each): | Changed | English | Ukrainian | Code | | --- | ---: | ---: | ---: | | nothing | 42.5 | 32.5 | 50.2 | | `STRATA_SH_STREAM=0` | 56.4 | 43.5 | 62.7 | | `STRATA_IQ_STAGE_GRID=0` | 43.5 | 34.6 | 51.8 | | `STRATA_PLE_BATCH=0` | 41.6 | 33.0 | 49.0 | | `STRATA_OLD_IQ_MMVQ=1` | 43.3 | 32.5 | 47.9 | | `STRATA_DEC_BATCH=0` | 40.0 | 31.8 | 45.4 | On IQ3_XXS (`--draft-vocab cyrillic`) 0.1.39 + `STRATA_SH_STREAM=0` gives 49.2 / 55.2 / 52.0 against 42.2 / 45.7 / 42.8 on 0.1.38. Why the shared expert's second stream costs this much here was not profiled. Full report, scripts and data: https://github.com/Niko1221/Strata/pull/815
Author
Owner

@pugolini commented on GitHub (Oct 4, 2026):

Independent data point on RDNA4 / gfx1201, and I think I found what causes this.

Setup: Radeon AI PRO R9700 32 GB (gfx1201), ROCm 6.4.3, Linux, Qwen3.8-Flash-Next 176B MoE IQ3_XXS, --kv int8 --kv-resident 32768 --resident-experts, temperature 0. Prompt is 48,067 tokens so the KV stream path is running; 3 measured runs per case, same binary per case, same prompt.

Configuration decode t/s (median) range
stock 0.1.39 (fork on, the current default) 43.40 38.90 – 44.60
STRATA_SH_STREAM=1 (fork on) 43.50 39.10 – 45.20
STRATA_SH_STREAM=0 (fork off) 63.00 55.90 – 64.10

So your workaround does the same thing here: +45%, 43.4 → 63.0 t/s. Runs 2 and 3 sit at 98.5%/99.0% expert cache hit, so this is not a cold-cache effect — run 1 is slower in every case because it pays the first cold read.

Cause: the shared-expert stream fork

cfd3b72 ("zero-doorbell resident verify graph, sub-warp expert packing, shared-mem staging") forks the shared expert onto a second stream and joins it back per layer (sh_fork in record_window). It is an ancestor of v0.1.39 (6f32ec0) but not of v0.1.38 (99f3dbd) — sh_stream_env appears 0 times in 99f3dbd and twice in 6f32ec0. That is exactly the window you and Burntgogi measured, and the overlap it buys on CUDA costs more than the shared expert takes to run on HIP, where the cross-stream event dependency serialises it.

Two things hid it:

  • STRATA_SH_STREAM=0 was the only way to see it. The profiler itself turns the fork off to time the stages, so every profiled run silently measured the fast path.
  • Short prompts barely show it. On a short prompt with a 256-token output the same comparison is only 65.4 against 62.7 t/s (~4%), which reads as noise. It takes a large prompt for the KV stream path for the real gap to appear — which is probably why this survived until 0.1.39 shipped.

For reference, that also explains the shape of your numbers: 12-22% rather than a flat figure, since it scales with how much of the run is on the stream path.

Fix

I opened #826, which makes the fork start off on HIP only (STRATA_SH_STREAM=1 forces it back on, as you already use). CUDA's default is unchanged — the #else branch returns exactly what the current code returns.

The fork is a scheduling change only, so output is untouched: four prompts (explanatory, code, technical summary, free paragraph) at temperature 0 come back byte for byte identical, same sha256, with the fork on and off. The forcing cases bracket the change in the table above: =1 reproduces stock 0.1.39 (43.50 against 43.40).

Caveat worth stating: this is one gfx1201 card, from me. Your gfx1030 report is the second data point and gfx1100 is a third, but I have not reproduced your configuration on Windows myself, and I did not profile why the second stream costs this much — the numbers are consistent with the event dependency serialising what CUDA overlaps, but that part is a hypothesis, not a measurement.

If anyone can run this on another HIP card, it settles it: the same long-prompt decode on a v0.1.39 binary with STRATA_SH_STREAM unset versus STRATA_SH_STREAM=0. A large prompt is needed (mine is ~48k tokens); on a short prompt the two are within a few percent and it will look like nothing is wrong.

<!-- gh-comment-id:5983812114 --> @pugolini commented on GitHub (Oct 4, 2026): Independent data point on **RDNA4 / gfx1201**, and I think I found what causes this. Setup: Radeon AI PRO R9700 32 GB (gfx1201), ROCm 6.4.3, Linux, Qwen3.8-Flash-Next 176B MoE IQ3_XXS, `--kv int8 --kv-resident 32768 --resident-experts`, temperature 0. Prompt is 48,067 tokens so the KV stream path is running; 3 measured runs per case, same binary per case, same prompt. | Configuration | decode t/s (median) | range | | --- | --- | --- | | stock 0.1.39 (fork on, the current default) | **43.40** | 38.90 – 44.60 | | `STRATA_SH_STREAM=1` (fork on) | **43.50** | 39.10 – 45.20 | | `STRATA_SH_STREAM=0` (fork off) | **63.00** | 55.90 – 64.10 | So your workaround does the same thing here: **+45%**, 43.4 → 63.0 t/s. Runs 2 and 3 sit at 98.5%/99.0% expert cache hit, so this is not a cold-cache effect — run 1 is slower in every case because it pays the first cold read. ## Cause: the shared-expert stream fork `cfd3b72` ("zero-doorbell resident verify graph, sub-warp expert packing, shared-mem staging") forks the shared expert onto a second stream and joins it back per layer (`sh_fork` in `record_window`). It is an ancestor of v0.1.39 (`6f32ec0`) but **not** of v0.1.38 (`99f3dbd`) — `sh_stream_env` appears 0 times in `99f3dbd` and twice in `6f32ec0`. That is exactly the window you and Burntgogi measured, and the overlap it buys on CUDA costs more than the shared expert takes to run on HIP, where the cross-stream event dependency serialises it. Two things hid it: - **`STRATA_SH_STREAM=0` was the only way to see it.** The profiler itself turns the fork off to time the stages, so every profiled run silently measured the fast path. - **Short prompts barely show it.** On a short prompt with a 256-token output the same comparison is only 65.4 against 62.7 t/s (~4%), which reads as noise. It takes a large prompt for the KV stream path for the real gap to appear — which is probably why this survived until 0.1.39 shipped. For reference, that also explains the shape of your numbers: 12-22% rather than a flat figure, since it scales with how much of the run is on the stream path. ## Fix I opened #826, which makes the fork start **off** on HIP only (`STRATA_SH_STREAM=1` forces it back on, as you already use). CUDA's default is unchanged — the `#else` branch returns exactly what the current code returns. The fork is a scheduling change only, so output is untouched: four prompts (explanatory, code, technical summary, free paragraph) at temperature 0 come back **byte for byte identical**, same sha256, with the fork on and off. The forcing cases bracket the change in the table above: `=1` reproduces stock 0.1.39 (43.50 against 43.40). Caveat worth stating: this is one gfx1201 card, from me. Your gfx1030 report is the second data point and gfx1100 is a third, but I have not reproduced your configuration on Windows myself, and I did not profile *why* the second stream costs this much — the numbers are consistent with the event dependency serialising what CUDA overlaps, but that part is a hypothesis, not a measurement. If anyone can run this on another HIP card, it settles it: the same long-prompt decode on a v0.1.39 binary with `STRATA_SH_STREAM` unset versus `STRATA_SH_STREAM=0`. A large prompt is needed (mine is ~48k tokens); on a short prompt the two are within a few percent and it will look like nothing is wrong.
Author
Owner

@sruggier commented on GitHub (Oct 4, 2026):

Thanks for reporting this: it was cutting my decode rate to roughly half the speed (with an RX 6900 XT, but on an older system with a Xeon E5-1620 v4 and slower system memory), and you saved me time by sharing the most efficient workaround.

Слава Україні!

<!-- gh-comment-id:5983995084 --> @sruggier commented on GitHub (Oct 4, 2026): Thanks for reporting this: it was cutting my decode rate to roughly half the speed (with an RX 6900 XT, but on an older system with a Xeon E5-1620 v4 and slower system memory), and you saved me time by sharing the most efficient workaround. Слава Україні!
Author
Owner

@tomsun66-star commented on GitHub (Oct 4, 2026):

On what type of drive was the NGRAM Table located? NVME Gen5/NVME GEN4/NVME GEN3/SATA-SSD, was the drive connected via Chipset or directly to the CPU (i'm asking because i did the test with the Unsloth IQ3XXS model and there was no measurable difference but at that time i was running around 7 Tokens per second, and under "heavy load" (producing a 1500 word text from a long prompt app. 4K) around 3 Tokens/second. The question behind that is always it is claimed to use a fast NVME, but when does it really matters? When is the speed of the drive hosting the NGRAM-Table really the bottleneck, currently the bottleneck for me is still the DRAM speed. So interesting to see the experience of people using fast DDR5 RAMs and PCI Gen5 Systems if they encounter speed problems if the NGRAM Table is on a slower drive.

<!-- gh-comment-id:5984623902 --> @tomsun66-star commented on GitHub (Oct 4, 2026): On what type of drive was the NGRAM Table located? NVME Gen5/NVME GEN4/NVME GEN3/SATA-SSD, was the drive connected via Chipset or directly to the CPU (i'm asking because i did the test with the Unsloth IQ3XXS model and there was no measurable difference but at that time i was running around 7 Tokens per second, and under "heavy load" (producing a 1500 word text from a long prompt app. 4K) around 3 Tokens/second. The question behind that is always it is claimed to use a fast NVME, but when does it really matters? When is the speed of the drive hosting the NGRAM-Table really the bottleneck, currently the bottleneck for me is still the DRAM speed. So interesting to see the experience of people using fast DDR5 RAMs and PCI Gen5 Systems if they encounter speed problems if the NGRAM Table is on a slower drive.
Author
Owner

@sruggier commented on GitHub (Oct 5, 2026):

In my case, an old DRAM-less SSD, PCIe gen 3. Slow by today's standards, but I'm seeing 25-30 tokens/s on decode, and it stays that way regardless of how full the context window is. I've observed this up to 231k tokens.

<!-- gh-comment-id:5986571835 --> @sruggier commented on GitHub (Oct 5, 2026): In my case, an old DRAM-less SSD, PCIe gen 3. Slow by today's standards, but I'm seeing 25-30 tokens/s on decode, and it stays that way regardless of how full the context window is. I've observed this up to 231k tokens.
Author
Owner

@biosynthart commented on GitHub (Oct 5, 2026):

gfx1201 / Linux: same decode regression, STRATA_SH_STREAM=0 restores it (slightly above 0.1.38)

Setup

  • GPU: AMD gfx1201, 32 GB (RDNA4), single card, desktop also on the box
  • OS: Linux, system ROCm at /opt/rocm; engine built from source with
    cmake -DSTRATA_ENABLE_HIP=ON -DSTRATA_ENABLE_CUDA=OFF -DCMAKE_HIP_ARCHITECTURES=gfx1201
  • Strata: v0.1.38 vs v0.1.39 (tags); the 0.1.38 engine binary was run under the 0.1.39 server with the same config, so both arms saw the same server code
  • Models: Qwen3.8-Flash-Next GSQ-RCO IQ3_S (pack + native GGUF) and orcarouter/Qwen3.8-Flash-Next-Uncensored IQ3_XXS (compat-bf16 pack); both --kv int8, MTP draft head,
    --spec 4 --spec-min-p 0.5
  • Method: same 300-token generations, temperature 0; decode tok/s from the server's timings.predicted_per_second; 3 runs per arm, medians below

Decode, tok/s (median of 3)

Engine IQ3_S IQ3_XXS
0.1.38 74.1 68.9
0.1.39 (defaults) 37.0 44.6
0.1.39 + STRATA_SH_STREAM=0 78.3 71.9

Held constant across arms (engine log + timings): expert cache auto-sized identically (13,217 slots / 25.09 GiB), decode cache hit rate 94–98%, per-run draft acceptance counts
identical (e.g. 174/244 on both 0.1.38 and 0.1.39), long-prompt read ~1,150 tok/s unchanged. The regression is isolated to the decode verify path.

Notes

  • Had Kimi help me investigate this with me.
  • With STRATA_SH_STREAM=0, 0.1.39 lands slightly above 0.1.38 on both models — same direction as the gfx1030 numbers in this issue.
  • Prefill/long-prompt speed is unaffected here, so the #583 ring is not the cause on this card.
  • I'd be happy to run the STRATA_VERIFY_COHERENT=1 / STRATA_DOORBELL_STORE=1 A/Bs if that helps #649 on gfx1201.
<!-- gh-comment-id:5987496242 --> @biosynthart commented on GitHub (Oct 5, 2026): ## gfx1201 / Linux: same decode regression, `STRATA_SH_STREAM=0` restores it (slightly above 0.1.38) **Setup** - GPU: AMD gfx1201, 32 GB (RDNA4), single card, desktop also on the box - OS: Linux, system ROCm at `/opt/rocm`; engine built from source with `cmake -DSTRATA_ENABLE_HIP=ON -DSTRATA_ENABLE_CUDA=OFF -DCMAKE_HIP_ARCHITECTURES=gfx1201` - Strata: `v0.1.38` vs `v0.1.39` (tags); the 0.1.38 engine binary was run under the 0.1.39 server with the same config, so both arms saw the same server code - Models: Qwen3.8-Flash-Next **GSQ-RCO IQ3_S** (pack + native GGUF) and orcarouter/Qwen3.8-Flash-Next-Uncensored **IQ3_XXS** (compat-bf16 pack); both `--kv int8`, MTP draft head, `--spec 4 --spec-min-p 0.5` - Method: same 300-token generations, `temperature 0`; decode tok/s from the server's `timings.predicted_per_second`; 3 runs per arm, medians below **Decode, tok/s (median of 3)** | Engine | IQ3_S | IQ3_XXS | |---|---|---| | 0.1.38 | 74.1 | 68.9 | | 0.1.39 (defaults) | 37.0 | 44.6 | | 0.1.39 + `STRATA_SH_STREAM=0` | **78.3** | **71.9** | **Held constant across arms** (engine log + timings): expert cache auto-sized identically (13,217 slots / 25.09 GiB), decode cache hit rate 94–98%, per-run draft acceptance counts identical (e.g. 174/244 on both 0.1.38 and 0.1.39), long-prompt read ~1,150 tok/s unchanged. The regression is isolated to the decode verify path. **Notes** - Had Kimi help me investigate this with me. - With `STRATA_SH_STREAM=0`, 0.1.39 lands slightly *above* 0.1.38 on both models — same direction as the gfx1030 numbers in this issue. - Prefill/long-prompt speed is unaffected here, so the #583 ring is not the cause on this card. - I'd be happy to run the `STRATA_VERIFY_COHERENT=1` / `STRATA_DOORBELL_STORE=1` A/Bs if that helps #649 on gfx1201.
Author
Owner

@Vop3p commented on GitHub (Oct 5, 2026):

gfx1030 / Linux, 2x RX 6900 XT: no regression here — the fork on is 5–9% faster than STRATA_SH_STREAM=0

A data point in the other direction, same card family as the report (gfx1030), Linux instead of Windows. If #826 turns the fork off for all of HIP, this machine loses 5–9% decode unless it sets STRATA_SH_STREAM=1.

Setup: 2x AMD Radeon RX 6900 XT 16 GB (gfx1030), each PCIe 4.0 x8; Ryzen 5 5600X, 128 GB DDR4-3200; Ubuntu 26.04, kernel 7.0.0-38, ROCm 10.0.0. Source builds, -DSTRATA_ENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx1030 -DSTRATA_PREFILL_MMQ=ON. Qwen3.8-Flash-Next GSQ-RCO IQ3_S, --kv int8 --kv-resident 32768 --max-context 131072, MTP draft, --spec 4 --spec-min-p 0.5. Non-default: --adapt-every 100000 in the long-prompt runs (the #884 workaround; it was not set in the short-prompt runs).

Long prompt (the condition pugolini asked for): 50,517 prompt tokens, past --kv-resident, so the KV stream path is running; "Summarize the document above", 256 tokens, temperature 0; 3 requests per arm on one server, the first cold, the next two reuse the prefix. tok/s from the engine's strata serve: line; ms per verify window from STRATA_DECODE_TIMING=1.

Engine (layer split over both cards) fork on (default) STRATA_SH_STREAM=0
0.1.39 (6f32ec0) 55.6 / 56.4 / 56.4 t/s; 37.5 ms/window (GPU-reach wait 11.9) 51.3 / 51.7 / 51.7 t/s; 40.9 ms/window (GPU-reach wait 13.9)
0.1.39 + #835 + #849 + #854 57.2 / 58.4 / 60.6 t/s; 38.8 ms/window (GPU-reach wait 12.0) 52.9 / 55.6 / 55.6 t/s; 42.2 ms/window (GPU-reach wait 14.0)

In each pair the two arms accepted the same drafts (same output), so the difference is the window time, not the sampling. Prompt read is unaffected (764 tok/s stock, 1,650 with the PRs, both arms).

Short prompt (2026-10-04, 0.1.39 + #835 — a prompt-path-only change; two ~5,000-token prompts, sampled, up to 600 tokens, STRATA_DECODE_TIMING=1, one server per arm):

Mode fork on (default) STRATA_SH_STREAM=0
layer split, 2 cards 36.5 / 33.8 ms/window (60.2 / 62.9 t/s) 40.7 / 38.7 ms/window (55–59 t/s)
expert helper on card 2 59.6 / 58.5 ms/window (39–41 t/s) 62.9 / 61.3 ms/window (36 t/s)

So on this box the second stream buys what it was meant to buy. I have no explanation for why it costs 12–45% on the RX 6800 (Windows) and gfx1201 and nothing here; the obvious differences are the OS and the ROCm version (10.0.0 here, 10.2.0a on the RX 6800, 6.4.3 on the R9700). A per-arch or per-OS default, or leaving the default and documenting the switch, would keep both sides whole.

One related note for the hang hunters: in #884 (gfx1030, Linux) the stuck barrier packet sits at the head of exactly this stream's queue (sh_cs_), but STRATA_SH_STREAM=0 did not stop the hang there (it moved into the prompt read, 1 of 2 runs), so turning the fork off is not a fix for that.

<!-- gh-comment-id:5992870001 --> @Vop3p commented on GitHub (Oct 5, 2026): ## gfx1030 / Linux, 2x RX 6900 XT: no regression here — the fork **on** is 5–9% faster than `STRATA_SH_STREAM=0` A data point in the other direction, same card family as the report (gfx1030), Linux instead of Windows. If #826 turns the fork off for all of HIP, this machine loses 5–9% decode unless it sets `STRATA_SH_STREAM=1`. **Setup**: 2x AMD Radeon RX 6900 XT 16 GB (gfx1030), each PCIe 4.0 x8; Ryzen 5 5600X, 128 GB DDR4-3200; Ubuntu 26.04, kernel 7.0.0-38, ROCm 10.0.0. Source builds, `-DSTRATA_ENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx1030 -DSTRATA_PREFILL_MMQ=ON`. Qwen3.8-Flash-Next GSQ-RCO IQ3_S, `--kv int8 --kv-resident 32768 --max-context 131072`, MTP draft, `--spec 4 --spec-min-p 0.5`. Non-default: `--adapt-every 100000` in the long-prompt runs (the #884 workaround; it was not set in the short-prompt runs). **Long prompt** (the condition pugolini asked for): 50,517 prompt tokens, past `--kv-resident`, so the KV stream path is running; "Summarize the document above", 256 tokens, temperature 0; 3 requests per arm on one server, the first cold, the next two reuse the prefix. tok/s from the engine's `strata serve:` line; ms per verify window from `STRATA_DECODE_TIMING=1`. | Engine (layer split over both cards) | fork on (default) | `STRATA_SH_STREAM=0` | | --- | --- | --- | | 0.1.39 (`6f32ec0`) | 55.6 / 56.4 / 56.4 t/s; 37.5 ms/window (GPU-reach wait 11.9) | 51.3 / 51.7 / 51.7 t/s; 40.9 ms/window (GPU-reach wait 13.9) | | 0.1.39 + #835 + #849 + #854 | 57.2 / 58.4 / 60.6 t/s; 38.8 ms/window (GPU-reach wait 12.0) | 52.9 / 55.6 / 55.6 t/s; 42.2 ms/window (GPU-reach wait 14.0) | In each pair the two arms accepted the same drafts (same output), so the difference is the window time, not the sampling. Prompt read is unaffected (764 tok/s stock, 1,650 with the PRs, both arms). **Short prompt** (2026-10-04, 0.1.39 + #835 — a prompt-path-only change; two ~5,000-token prompts, sampled, up to 600 tokens, `STRATA_DECODE_TIMING=1`, one server per arm): | Mode | fork on (default) | `STRATA_SH_STREAM=0` | | --- | --- | --- | | layer split, 2 cards | 36.5 / 33.8 ms/window (60.2 / 62.9 t/s) | 40.7 / 38.7 ms/window (55–59 t/s) | | expert helper on card 2 | 59.6 / 58.5 ms/window (39–41 t/s) | 62.9 / 61.3 ms/window (36 t/s) | So on this box the second stream buys what it was meant to buy. I have no explanation for why it costs 12–45% on the RX 6800 (Windows) and gfx1201 and nothing here; the obvious differences are the OS and the ROCm version (10.0.0 here, 10.2.0a on the RX 6800, 6.4.3 on the R9700). A per-arch or per-OS default, or leaving the default and documenting the switch, would keep both sides whole. One related note for the hang hunters: in #884 (gfx1030, Linux) the stuck barrier packet sits at the head of exactly this stream's queue (`sh_cs_`), but `STRATA_SH_STREAM=0` did not stop the hang there (it moved into the prompt read, 1 of 2 runs), so turning the fork off is not a fix for that.
Author
Owner

@aswin-dot-R commented on GitHub (Oct 5, 2026):

gfx1201 (RDNA4) / Linux, 2-card layer split: the fork costs ~22% here, and a bisect points at its interaction with the pipelined split

Setup: AI PRO R9700 32 GB + RX 9070 XT 16 GB (both gfx1201), layer split [1, 0] (auto: layers 0-29 / 30-47), Qwen3.8-Flash-Next IQ3_S, 262K context, --kv int8, MTP drafts. Linux 6.17, ROCm 7.2.0, engine built from the tags with setup's flags. R9700 on PCIe 4.0 x4, 9070 XT on 3.0 x4 (OCuLink).

Decode = the engine's own 1200 generated in ... ms line, 1,200-token replies, warm:

build decode
0.1.38 72.3 - 74.4 tok/s
0.1.39 60.3 - 62.6 tok/s
0.1.39 + STRATA_SH_STREAM=0 76.9 - 79.5 tok/s

So on this machine STRATA_SH_STREAM=0 is not only the fix but faster than 0.1.38 - the opposite of the 2x 6900 XT report above.

Bisect (git bisect --first-parent v0.1.38 v0.1.39, same config, best of two runs):

commit decode
cff608c 68.6 (good)
cb97e6c - f-139b-spd merged, fork on 75.2 (good)
1189218 - merge of f-139b-par 63.6 (bad)
8b36fa0 64.1 (bad)

Every commit on f-139b-par by itself (2fbbfa2, 9556298, cef263f, 1a56d71) measures 72.8 - 73.7. So neither side is slow alone: the fork was fine on the spd line, and the regression appears only where it meets the pipelined split.

With STRATA_SPLIT_TIMING=1 STRATA_DECODE_TIMING=1 (which serializes the stages), cb97e6c and 0.1.39 are identical - 58.5 vs 58.1 tok/s, per window: stage 0 GPU wait 13.43 / 13.45 ms, stage 1 13.00 / 13.09 ms, pool + plan and commit within 0.03 ms. The per-stage work did not get slower; what 0.1.39 loses is the overlap between the two cards, and its normal speed (~61) lands almost exactly on the serialized one (~58).

That may be why results differ between machines: on a single GPU (#816's RX 6800) the cross-stream event cost is the whole story, while on a split the fork's join seems to also stall the hand-off between stages. If that is right, #826 turning the fork off by default on HIP fits this machine too, and a split might want it off on CUDA as well - I have no CUDA split to check.

<!-- gh-comment-id:5998643019 --> @aswin-dot-R commented on GitHub (Oct 5, 2026): ## gfx1201 (RDNA4) / Linux, 2-card layer split: the fork costs ~22% here, and a bisect points at its interaction with the pipelined split **Setup**: AI PRO R9700 32 GB + RX 9070 XT 16 GB (both gfx1201), layer split `[1, 0]` (auto: layers 0-29 / 30-47), Qwen3.8-Flash-Next **IQ3_S**, 262K context, `--kv int8`, MTP drafts. Linux 6.17, ROCm 7.2.0, engine built from the tags with setup's flags. R9700 on PCIe 4.0 x4, 9070 XT on 3.0 x4 (OCuLink). Decode = the engine's own `1200 generated in ... ms` line, 1,200-token replies, warm: | build | decode | | --- | ---: | | 0.1.38 | 72.3 - 74.4 tok/s | | 0.1.39 | 60.3 - 62.6 tok/s | | 0.1.39 + `STRATA_SH_STREAM=0` | **76.9 - 79.5 tok/s** | So on this machine `STRATA_SH_STREAM=0` is not only the fix but faster than 0.1.38 - the opposite of the 2x 6900 XT report above. **Bisect** (`git bisect --first-parent v0.1.38 v0.1.39`, same config, best of two runs): | commit | decode | | --- | ---: | | `cff608c` | 68.6 (good) | | `cb97e6c` - f-139b-spd merged, fork **on** | **75.2** (good) | | `1189218` - merge of f-139b-par | **63.6** (bad) | | `8b36fa0` | 64.1 (bad) | Every commit on f-139b-par by itself (`2fbbfa2`, `9556298`, `cef263f`, `1a56d71`) measures 72.8 - 73.7. So neither side is slow alone: the fork was fine on the spd line, and the regression appears only where it meets the pipelined split. With `STRATA_SPLIT_TIMING=1 STRATA_DECODE_TIMING=1` (which serializes the stages), `cb97e6c` and 0.1.39 are identical - 58.5 vs 58.1 tok/s, per window: stage 0 GPU wait 13.43 / 13.45 ms, stage 1 13.00 / 13.09 ms, pool + plan and commit within 0.03 ms. The per-stage work did not get slower; what 0.1.39 loses is the overlap between the two cards, and its normal speed (~61) lands almost exactly on the serialized one (~58). That may be why results differ between machines: on a single GPU (#816's RX 6800) the cross-stream event cost is the whole story, while on a split the fork's join seems to also stall the hand-off between stages. If that is right, #826 turning the fork off by default on HIP fits this machine too, and a split might want it off on CUDA as well - I have no CUDA split to check.
Author
Owner

@Solear commented on GitHub (Oct 5, 2026):

gfx1201 / Linux, 2x R9700 layer split: STRATA_SH_STREAM=0 fixes it here too, and the default is unstable across engine starts

Setup: 2x Radeon AI PRO R9700 32 GB (gfx1201), layer split auto (layers 0-25 / 26-47, 100% of experts resident, PCIe probe 28.7 GB/s), Core Ultra 7 270K Plus (no AVX-512), 192 GB DDR5-5600, Ubuntu 26.04, kernel 7.0.0-38, TheRock wheels rocm 7.10.0a20251120 (hipBLASLt 100200). Qwen3.8-Flash-Next GSQ-RCO IQ3_S, 262K context, --kv int8 --kv-resident 32768, MTP --spec 4, vision on. Engine built by setup (--update) from v0.1.38 (99f3dbd) and 6f32ec0.

Decode = 400-token replies, temperature 0, reasoning_effort: off, 3 requests per engine start (medians), engine restarted between rows:

build code prompt story prompt starts
0.1.38 84-88 tok/s ~48 tok/s stable
0.1.39 default (fork on) 75-77 tok/s or ~100 tok/s 48-50 or ~59 tok/s slow on 7 of 15 starts (1 more mixed)
0.1.39 + STRATA_SH_STREAM=0 98.9-100.0 tok/s 56.9-57.9 tok/s fast on 3 of 3 starts

With the fork on, the speed is stable within one engine start (±2%) but flips between a slow and a fast mode across restarts; startup logs are identical in both (same split, expert placement, PCIe probe, thread affinity) and MTP acceptance is the same (~88% on code), so the difference is the time per verify window. With the fork off every start runs in the fast mode, ~15-20% above 0.1.38. Prefill is unchanged (~1,220 / 1,720 / 1,980 tok/s at 4K / 16K / 32K). STRATA_IQ_STAGE_GRID_MMVQ=1 made no difference.

This matches @aswin-dot-R's bisect: the loss is in the overlap between the stages, and here the fork's join apparently stalls the hand-off on some starts and not on others. +1 for #826 turning the fork off by default on HIP.

<!-- gh-comment-id:6001630775 --> @Solear commented on GitHub (Oct 5, 2026): ## gfx1201 / Linux, 2x R9700 layer split: `STRATA_SH_STREAM=0` fixes it here too, and the default is unstable across engine starts **Setup**: 2x Radeon AI PRO R9700 32 GB (gfx1201), layer split auto (layers 0-25 / 26-47, 100% of experts resident, PCIe probe 28.7 GB/s), Core Ultra 7 270K Plus (no AVX-512), 192 GB DDR5-5600, Ubuntu 26.04, kernel 7.0.0-38, TheRock wheels rocm 7.10.0a20251120 (hipBLASLt 100200). Qwen3.8-Flash-Next GSQ-RCO **IQ3_S**, 262K context, `--kv int8 --kv-resident 32768`, MTP `--spec 4`, vision on. Engine built by setup (`--update`) from `v0.1.38` (99f3dbd) and `6f32ec0`. Decode = 400-token replies, temperature 0, `reasoning_effort: off`, 3 requests per engine start (medians), engine restarted between rows: | build | code prompt | story prompt | starts | | --- | ---: | ---: | --- | | 0.1.38 | 84-88 tok/s | ~48 tok/s | stable | | 0.1.39 default (fork on) | 75-77 tok/s *or* ~100 tok/s | 48-50 *or* ~59 tok/s | slow on 7 of 15 starts (1 more mixed) | | **0.1.39 + `STRATA_SH_STREAM=0`** | **98.9-100.0 tok/s** | **56.9-57.9 tok/s** | fast on 3 of 3 starts | With the fork on, the speed is stable within one engine start (±2%) but flips between a slow and a fast mode across restarts; startup logs are identical in both (same split, expert placement, PCIe probe, thread affinity) and MTP acceptance is the same (~88% on code), so the difference is the time per verify window. With the fork off every start runs in the fast mode, ~15-20% above 0.1.38. Prefill is unchanged (~1,220 / 1,720 / 1,980 tok/s at 4K / 16K / 32K). `STRATA_IQ_STAGE_GRID_MMVQ=1` made no difference. This matches @aswin-dot-R's bisect: the loss is in the overlap between the stages, and here the fork's join apparently stalls the hand-off on some starts and not on others. +1 for #826 turning the fork off by default on HIP.
Author
Owner

@Vop3p commented on GitHub (Oct 5, 2026):

One more data point from the 2x RX 6900 XT machine above, since two of the slow reports are single RDNA2 cards: here the fork is also faster on one card.

Single RX 6900 XT, 50,517-token prompt, 256 tokens, temperature 0, 3 requests per arm (first cold), one server per arm:

engine (one card) fork on (default) STRATA_SH_STREAM=0
0.1.39 (6f32ec0) 38.1 / 38.9 / 38.6 tok/s 36.2 / 37.8 / 36.5 tok/s
0.1.39 + #835 + #849 + #854 38.8 / 40.3 / 40.4 tok/s 35.7 / 38.2 / 38.1 tok/s

Same direction as the split (+5-9%) and the expert-helper mode (+8%) measured earlier: six pairs, all in favour of the fork. Across 11 engine starts at the default settings the fork-on speed has been the same within a few percent (split 55.6-60.6 at a 50K-token context), never a slow mode like @Solear's.

So I have no explanation for the sign: the RX 6800 (Windows) and the RX 6900 XT on the E5-1620 v4 are the same card family and also single cards with CPU experts, and they lose with the fork on while this machine gains in every mode. What is left to differ is the OS, the host platform (DDR4-2133, PCIe 3.0 there) and ROCm (10.0.0 here; 7.2.0 / 7.10 nightly / 10.2.0a on the slow reports, so not a version order). The one thing the data does say is that the sign is a property of the machine and stable on a given one, which argues for keeping the switch and letting the default be measured: calibrate.py already times --pcie-frac and --spec-min-p through one engine; a STRATA_SH_STREAM arm there (it needs a restart per value, like --pool-workers) would set it right on every PC, whichever way #826 goes.

<!-- gh-comment-id:6002499930 --> @Vop3p commented on GitHub (Oct 5, 2026): One more data point from the 2x RX 6900 XT machine above, since two of the slow reports are single RDNA2 cards: here the fork is also faster on **one** card. Single RX 6900 XT, 50,517-token prompt, 256 tokens, temperature 0, 3 requests per arm (first cold), one server per arm: | engine (one card) | fork on (default) | `STRATA_SH_STREAM=0` | | --- | --- | --- | | 0.1.39 (`6f32ec0`) | 38.1 / 38.9 / 38.6 tok/s | 36.2 / 37.8 / 36.5 tok/s | | 0.1.39 + #835 + #849 + #854 | 38.8 / 40.3 / 40.4 tok/s | 35.7 / 38.2 / 38.1 tok/s | Same direction as the split (+5-9%) and the expert-helper mode (+8%) measured earlier: six pairs, all in favour of the fork. Across 11 engine starts at the default settings the fork-on speed has been the same within a few percent (split 55.6-60.6 at a 50K-token context), never a slow mode like @Solear's. So I have no explanation for the sign: the RX 6800 (Windows) and the RX 6900 XT on the E5-1620 v4 are the same card family and also single cards with CPU experts, and they lose with the fork on while this machine gains in every mode. What is left to differ is the OS, the host platform (DDR4-2133, PCIe 3.0 there) and ROCm (10.0.0 here; 7.2.0 / 7.10 nightly / 10.2.0a on the slow reports, so not a version order). The one thing the data does say is that the sign is a property of the machine and stable on a given one, which argues for keeping the switch and letting the default be measured: `calibrate.py` already times `--pcie-frac` and `--spec-min-p` through one engine; a `STRATA_SH_STREAM` arm there (it needs a restart per value, like `--pool-workers`) would set it right on every PC, whichever way #826 goes.
Author
Owner

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

Fixed in 0.1.40: the shared-expert stream fork is off by default on HIP (PR #826), except on gfx1151. STRATA_SH_STREAM=1 restores the 0.1.39 behaviour if you want to compare. Please tell us if decode is back to 0.1.38 speed on your card.

<!-- gh-comment-id:6010862231 --> @Niko1221 commented on GitHub (Oct 6, 2026): Fixed in 0.1.40: the shared-expert stream fork is off by default on HIP (PR #826), except on gfx1151. STRATA_SH_STREAM=1 restores the 0.1.39 behaviour if you want to compare. Please tell us if decode is back to 0.1.38 speed on your card.
Author
Owner

@Vop3p commented on GitHub (Oct 6, 2026):

The 2x RX 6900 XT (gfx1030, Linux) data above goes the other way - the fork is faster there, 5-13% of decode on 0.1.40.1 - so I opened #1272 with the measurements, and the #884 stall data with the fork on and off.

<!-- gh-comment-id:6026279142 --> @Vop3p commented on GitHub (Oct 6, 2026): The 2x RX 6900 XT (gfx1030, Linux) data above goes the other way - the fork is faster there, 5-13% of decode on 0.1.40.1 - so I opened #1272 with the measurements, and the #884 stall data with the fork on and off.
Author
Owner

@sruggier commented on GitHub (Oct 6, 2026):

Fixed in 0.1.40: the shared-expert stream fork is off by default on HIP (PR #826), except on gfx1151. STRATA_SH_STREAM=1 restores the 0.1.39 behaviour if you want to compare. Please tell us if decode is back to 0.1.38 speed on your card.

I can confirm that I'm no longer seeing this problem on Strata 0.1.40.1 (on RX 6900 XT, gfx1030).

<!-- gh-comment-id:6026638932 --> @sruggier commented on GitHub (Oct 6, 2026): > Fixed in 0.1.40: the shared-expert stream fork is off by default on HIP (PR [#826](https://github.com/Niko1221/Strata/pull/826)), except on gfx1151. STRATA_SH_STREAM=1 restores the 0.1.39 behaviour if you want to compare. Please tell us if decode is back to 0.1.38 speed on your card. I can confirm that I'm no longer seeing this problem on Strata 0.1.40.1 (on RX 6900 XT, [gfx1030](https://llvm.org/docs/AMDGPUUsage.html#id22)).
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#366
No description provided.