mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#2854
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/826
Author: @pugolini
Created: 10/4/2026
Status: ❌ Closed
Base:
main← Head:hip-no-sh-stream-fork📝 Commits (1)
cfcf5b7verify: the shared-expert stream fork starts off on HIP (#816)📊 Changes
1 file changed (+19 additions, -6 deletions)
View changed files
📝
src/core/verify.cpp(+19 -6)📄 Description
What this changes
The shared expert is forked onto a second stream and joined back per layer (
sh_forkinrecord_window). That overlap pays off on CUDA, wherecfd3b72added it. On HIP, the cross-stream event dependency costs more than the shared expert takes to run, so this makes the fork start off on HIP andSTRATA_SH_STREAM=1turns it back on. CUDA's default is unchanged.This is the same shape as
mtp.cpp'sSTRATA_MTP_PREFILL_SYNC(#382): the env var always wins, only the default differs per backend. It also closes a small gap in the join path: the secondcudaStreamWaitEventtested!prof_on_instead of whether the fork actually ran, so it waited on an event that had never been recorded whenever the fork was off.Fixes #816 (same regression on a gfx1030, RX 6800 on Windows, where
STRATA_SH_STREAM=0already removes it). No issue/PR touching the fork's default for HIP existed when I opened this.The regression window lines up with the root cause:
sh_stream_envappears 0 times in v0.1.38 (99f3dbd) and twice in v0.1.39 (6f32ec0), andcfd3b72is an ancestor of6f32ec0but not of99f3dbd. Two independent HIP reports match that window — #816 on a gfx1030, and a comment on #646 from @Burntgogi, who measured an RX 7900 GRE (gfx1100) decoding slower from99f3dbdto6f32ec0with compiler, libraries, model and profile fixed. Neither of them attributed it to the fork; that is what the A/B below adds.Measurements
Radeon AI PRO R9700 (gfx1201), ROCm 6.4.3, Qwen3.8-Flash-Next 176B MoE IQ3_XXS,
--kv int8 --kv-resident 32768 --resident-experts, temperature 0, same machine, same binary per case, same prompt. Prompt is 48,067 tokens so the KV stream path runs; 3 measured runs each, all three reported.STRATA_SH_STREAM=1(force fork on)STRATA_SH_STREAM=0(force fork off)The forcing cases bracket the change:
=1reproduces stock 0.1.39 (43.50 against 43.40) and=0reproduces the new default (63.00 against 62.90), so the switch is still in charge.The list below is the raw run output. Run 1 of each case is slower because it pays the first cold read; runs 2-3 are at 98.5%/99.0% expert cache hit, so the gap is not a cold-cache artefact.
Independent confirmation on the same architecture
After I opened this, @biosynthart posted a second gfx1201 measurement in #816 — same architecture, different card, different model quantisation, engine built from source with
-DSTRATA_ENABLE_HIP=ON -DSTRATA_ENABLE_CUDA=OFF -DCMAKE_HIP_ARCHITECTURES=gfx1201:STRATA_SH_STREAM=0Their IQ3_XXS fork-on figure (44.6) lands on mine (43.40), and their conclusion matches mine:
STRATA_SH_STREAM=0does not just recover 0.1.38, it lands slightly above it on both quantisations. They also hold constant the expert cache sizing (13,217 slots / 25.09 GiB), the decode cache hit rate (94-98%) and the per-run draft acceptance counts (174/244 on both arms), and find prefill unchanged — which isolates the regression to the decode verify path, exactly wheresh_forklives.I did not run their configuration and they did not run mine; the agreement is between two independent setups.
Output is unchanged
The fork is a scheduling change, so the answers must be identical. Four prompts (explanatory, code, technical summary, free paragraph), temperature 0, same model, stock against this change, default env in both (no
STRATA_SH_STREAM):Limitations, honestly
=0and=1keep working exactly as before on both backends.#elsebranch returns exactly what the current code returns (!e || e[0] != '0'), so the CUDA default is bit-for-bit the old behaviour.docs/COMMUNITY_BENCHMARKS.mdI kept this separate from a results-only submission; this PR is the engine change only.Testing
hipError_t-Wunused-resultones inon_device.hppandverify.cpp, unchanged by this patch.6f32ec0for the A/B has sha25625416cee5c483c2f, identical to the binary I was running, so the control is the real release build.sycl/is untouched: itsverify.cpphas nosh_cs_/sh_fork.src/packhas no diff, so existing packs stay compatible.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.