mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1033] [CLOSED] prefill: gather GPU-resident experts in groups on short prompts too #2981
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#2981
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/1033
Author: @brenoperucchi
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:prefill-group-resident📝 Commits (10+)
fa16567setup: an earlier config that does not parse is skipped, not a crash; configs are written atomically (#459)749d957setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446)5a30024calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)9f60d13serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)eb8da1d/metrics: each request's speculative draft counts, and their sums in the totals (#457)6a09387setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)d6a91e2docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)d8d4ad3Merge branch 'f-135-eng' into rel-0.1.357b600d5Merge branch 'f-135-small' into rel-0.1.35d9ab843Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it📊 Changes
1 file changed (+17 additions, -2 deletions)
View changed files
📝
src/prefill/prefill.cpp(+17 -2)📄 Description
#372 (in 0.1.38) gathers an MMQ group's experts in one launch, but only in the streamed walk. A chunk below
stream_all_min()(1024 tokens) still takes the staged walk, where every expert gets its owngather_nativelaunch.@BlueKingMuch noticed this in #372: the 923-token tail of a 64K prompt was not affected.
On our box most short requests are 150-600 tokens with almost every routed expert already in the GPU cache, so this
per-expert launch is where their time goes. With
STRATA_PREFILL_TIMING=1, a ~450-token prompt spends 50-55% of itsGPU timeline in the "dequant" phase, which on the MMQ path is the gather.
The staged walk was left out of #372 because a staged expert sits in the 8-slot staging ring, which is smaller than a
group of 16, so a group cannot hold its slots. Resident experts have no ring slot, no wait and no release. This patch
groups only those:
gather_native_group, the same bytes into the same group slots);it;
STRATA_PREFILL_GROUP_GATHER=0still turns grouping off everywhere.One file,
src/prefill/prefill.cpp, +17/-2.Tested on an RTX 5090 32 GB, Ryzen 9 5950X, 96 GB DDR4, Windows 11 (WDDM), CUDA 13.0, with the Swift IQ3_XXS native pack,
--expert-cache auto,--prefill auto:32768,--kv int8,--max-context 32768. My builds use thesetup.py flags plus
STRATA_PORTABLE=ON. The short-prompt baseline is v0.1.39 built here (it also carries #861, whichdoes nothing unless a request opts in); the other tables compare against the official v0.1.39 exe.
For short prompts I sent chat requests with a ~100-token system prompt (reused from the prompt cache) and a different excerpt of
src/program/generate.cppeach time, 1 token out; 30 requests per size, median of the last 28:The "dequant" phase of a ~500-token chunk went from ~300 ms to ~214 ms.
For longer prompts I ran the official v0.1.39 exe and this build in alternation (A B A B), 1 warm-up and 3 runs each.
They come out the same, which is expected since a 2.6K or 14.7K prompt takes the streamed walk:
To check that the numbers do not change, I compared per-token logprobs (
STRATA_LOGPOS) on teacher-forced text,official exe against this build, alternating, two runs each. All four runs of each text gave the same perplexity:
My first version crashed with an illegal memory access. After a staged expert, the next flush still covered the
staged expert's position, whose group pointer was empty. The second commit (squashed here) starts the group after it.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.