mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4282] [Engine] Opt-in routed prompt stream: do not copy the streamed experts no token of the chunk routes to #1889
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#1889
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?
Originally created by @bitaccesscomau on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4282
Area
[Engine] (speed, kernels, models, the server and API)
What do you want to do?
Read prompts and conversation turns of about 2K to 32K tokens faster where the experts stream over PCIe, without
changing any output.
A prompt chunk of 1,024 tokens or more streams every non-resident expert of every layer through the prompt ring
(
src/prefill/prefill.cpp), and the issuer thread enqueues each copy as soon as the ring has room. The ring holds moreentries than a layer has, so a layer's copies are on the copy stream before its router has run, and an expert that no
token of the chunk routes to is copied anyway. On an RTX 3090 with the Swift IQ3_XXS pack, the switch below skipped 42%
of the streamed experts of a 1,046-token read, 22% of a 1,979-token follow-up turn and 3% of a 31K read (only entries
not yet issued when their layer's routing was known can be skipped).
Proposed behaviour, opt-in with
STRATA_PREFILL_ROUTED_STREAM=1(off by default): the issuer keeps at most a few copies(default 16) queued ahead of the link, each layer hands the issuer the set of experts its tokens route to as soon as its
router has run, and the issuer skips an entry it has not issued yet when no token routes to it. Every routed expert is
still copied, in the same order, into the same ring slot, so the prompt's results are the same bits. With the variable
unset nothing new runs.
Measured on a working branch (one commit on
main4b9e05a2, v0.2.6; one RTX 3090 24 GB on PCIe 3.0 x16 at 250 W,release defaults, the same binary with the switch off and on, 4 pairs): the read of a 1,790-token follow-up turn on an
18.8K-token conversation took 17.9% less time (3,214 to 2,640 ms; pair ratios 1.209 to 1.225), and fresh reads of 2K,
4K, 6K and 32K tokens ran 19.9%, 8.2%, 2.1% and 5.3% faster. Decode after those prompts moved by -0.8% to +0.5%; in six
64-token chats, which never reach the switch's code, by -2.6% (pair ratios 0.89 to 1.06); in two agent turns by -3.5%,
on texts that differed in every arm (60.6% of drafts accepted against 62.3%). Replies are byte-identical to
mainat 1K to 32K in a deterministic lane, with the switch off and on.Tradeoffs:
prefill.cpp, 142 in a new header holding the walk and the gate) and a 381-lineGPU-free test; one commit, no lines removed.
path publishes no routing (so nothing is skipped there), and experts staged through the Stager's pinned buffers are
never skipped.
1,024-token stream floor.
cudaEventQuery); that host cost was not measured on itsown.
Is this in scope as an opt-in switch? The code, tests and measurements are in a pull request opened with this issue,
which links here; I will rework it or close it if the scope should be different.
What do you do today instead?
Nothing: every streamed expert is copied.
STRATA_PREFILL_RING=8(#225, onmainase258e6ec) stages only the routedexperts but gives up the streamed ring's read-ahead; this proposal keeps the ring and its read-ahead and skips only what
the routing shows is unused.
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.