Skip to content

[Docs] AMD_HIP: why STRATA_SH_STREAM goes both ways, and leave it off on Windows - #3895

Open
Vop3p wants to merge 1 commit into
Niko1221:mainfrom
Vop3p:docs-sh-stream-why
Open

Vop3p wants to merge 1 commit into
Niko1221:mainfrom
Vop3p:docs-sh-stream-why

Conversation

@Vop3p

@Vop3p Vop3p commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Problem and result

docs/AMD_HIP.md says STRATA_SH_STREAM "goes both ways on different PCs" and leaves the choice to --calibrate, without saying why. Two new paragraphs say why, and add a Windows observation: on Windows 11 + RX 6900 XT the fork together with KV streaming faulted the engine on its first request.

Related discussion

#816 (RX 6800, Windows, fork on slower), #1272 (2x RX 6900 XT, Linux, fork on faster), 7fd67dd (the HIP default and its R9700 numbers), #1992 (calibration of the switch). Docs only; no default or code changes.

Approach

  • Why it goes both ways: the fork pays only when it has a wait to hide. With CPU experts in the window it forks after the doorbell is published (STRATA_SH_FORK_LATE, src/core/verify.cpp) and runs while the GPU waits for the CPU pool. On a 16 GB card that wait is about half a verify window: STRATA_DECODE_TIMING=1 on one RX 6900 XT under Linux (4,859 slots) gave GPU-reach wait 20.7 of 39.1 ms. With every expert resident there is nothing to hide and the fork is two cross-stream event dependencies per layer (7fd67dd: R9700, --resident-experts, 43.4 vs 62.9 tok/s).
  • Windows: leave it off. Windows 11, i9-10900K, 64 GB, RX 6900 XT, the 0.2.3 rdna2 package (engine 0.1.48) unchanged, Qwen3.8-Flash-Next IQ3_S, 64K context, --kv int8 --kv-resident 32768 --vram-reserve-mib 1536. With STRATA_SH_STREAM=1 the first request failed with "verify: unspecified launch failure" (in other starts first reported by "mtp draft step: unspecified launch failure"; process exit code 0xC0000409). With the fork off, or without --kv-resident, the same setup answered normally.

Validation

Passed:

  • Bisection on the Windows PC above: the same setup plus the switches STRATA_HIP_PROMPT_F16, STRATA_HC_PERSIST, STRATA_HIP_ADAPT_KERNEL_COPY, STRATA_PREFILL_CPU_SHARE=auto, STRATA_PIPED_CONCURRENT, STRATA_PREFILL_STREAM_MIN=2048, STRATA_IO_THREADS=128 and a rocBLAS table, removing one at a time, three short requests each. All set: fault. Each of HC_PERSIST, ADAPT_KERNEL_COPY, PREFILL_STREAM_MIN, the table removed: fault. STRATA_SH_STREAM removed: 3/3 answered. All removed: 3/3 answered.
  • STRATA_SH_STREAM=1 without --kv-resident on the same PC: standard benchmark complete, sanity 12/12 (several runs).
  • Linux, 2x RX 6900 XT, layer split, the same model, STRATA_SH_STREAM=1 and --kv-resident 32768 in production since 0.1.40: no such fault.

Failed:

  • none observed beyond the fault described.

Not run:

  • The faulting kernel was not isolated (AMD_SERIALIZE_KERNEL=3 not tried).
  • Four bisection steps (removing PROMPT_F16, CPU_SHARE, PIPED_CONCURRENT, IO_THREADS) each followed a fault and the engine did not come up within the probe's timeout, so they say nothing either way.
  • Other Windows cards (gfx1031, RDNA3/4); the fork on Windows without the other switches.

Limits

One Windows PC, one card. The Linux timing number is one request on one card.

Developed with an AI coding assistant; every number above was measured on the machines described.

…on Windows

The fork only pays when it has a wait to hide: with CPU experts in the window
it forks after the doorbell (STRATA_SH_FORK_LATE) and fills the GPU's wait for
the CPU pool (Niko1221#1272); with every expert resident it is two cross-stream event
dependencies per layer (7fd67dd, R9700). On Windows 11 + RX 6900 XT (0.2.3
rdna2 package) the fork together with --kv-resident faulted the first request;
bisected to STRATA_SH_STREAM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Niko1221 added a commit that referenced this pull request Oct 27, 2026
…red, never picked, and warned about when set by hand (#3895)

On one Windows RX 6900 XT STRATA_SH_STREAM=1 together with --kv-resident failed the engine on its first request (verify: unspecified launch failure).
setup --calibrate (tools/calibrate.py) no longer measures the fork on Windows when KV streaming is on (the fork is off by default on AMD, so
nothing changes unless the person sets it), strata tune's never-pick list holds the combination (strata_control/tune_knobs.py), and a config that
sets STRATA_SH_STREAM=1 with --kv-resident on Windows HIP gets one warning line when the engine starts (serve/server.py sh_stream_warning). Nothing is refused or
removed: the variable still reaches the engine. Shipped without a hardware run, from one report; the reply to #3895 asks RX 6000 owners on Windows to test
and report. Tests: tests/terminal/test_sh_stream_windows.py.
Niko1221 pushed a commit that referenced this pull request Oct 27, 2026
…f on Windows with KV streaming (#3895)

Two paragraphs from PR #3895 by Vop3p, put under the table row they explain: the fork pays only when it has a CPU-pool wait to hide (4,859 slots on one
RX 6900 XT, GPU-reach wait 20.7 of 39.1 ms; with every expert resident it is 43.4 against 62.9 tok/s on an R9700), and the Windows RX 6900 XT fault with
the fork plus --kv-resident, its bisection and its limits (one PC, kernel not isolated). The text now says what the code does about it and asks RX 6000 owners on Windows to test.
Niko1221 added a commit that referenced this pull request Oct 27, 2026
Ported PRs (authors kept) and our fixes, plus the owner's part-2 items: the restored TROUBLESHOOTING entries with a
link check, #3895 (no shared-expert fork calibration on Windows HIP with --kv-resident; a warning on a hand-set
STRATA_SH_STREAM=1), #3930 (docs), #3421 (Docker stops when models are present and MODEL_PATH is unset), #3570
(launch --show-key reads setup's config), #3311 (engine paragraph only) and #3029 (Strix Halo Windows guide,
re-measured on 0.2.7).
@Niko1221

Copy link
Copy Markdown
Owner

Thank you. The text is in 0.2.7 (docs/AMD_HIP.md) and Windows gfx1151 now has STRATA_SH_STREAM off by default. We have no RX 6000 card to confirm the Windows part for that card. Could you try 0.2.7 and tell us whether the page matches what you see?

Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants