mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #789] [CLOSED] prefill: overlap shared-expert work with routed expert uploads #2830
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#2830
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/789
Author: @InB4DevOps
Created: 10/4/2026
Status: ❌ Closed
Base:
main← Head:perf/prefill-expert-streaming-overlap-minimal📝 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 (+34 additions, -8 deletions)
View changed files
📝
src/prefill/prefill.cpp(+34 -8)📄 Description
What
The routed-only prefill path delays expert uploads in two places:
This changes the schedule in
src/prefill/prefill.cpp:The ring size, buffer allocation, expert order, MMQ groups and arithmetic are unchanged. The existing timing attribution is retained.
STRATA_PREFILL_STREAM_AHEAD=0restores the previous schedule; the default is enabled.Scope: routed-only batched prefill, normally chunks below 1,024 tokens, including short final chunks. The large-chunk full-stream schedule and output-token decoding are unchanged.
Measured
RTX 3060 12 GB, Intel i7-12700KF, Linux, Coder IQ1_M, INT8 KV, fixed 4,160-token capacity, resident expert arena and automatic expert cache.
A/B used the same binary, with the environment switch selecting the schedule. Profiling was disabled. Each run started a fresh engine; the reported metric is batched prefill time, excluding model loading, cache refill and final-input-token decoding.
The matrix covered:
25 cases, 200 retained runs: 50 warmup and 150 measured. One initial launcher interruption was handled by rerunning its incomplete measurement pair in full; that excluded attempt is preserved locally.
A requested chunk of 1,024 still exercises routed-only processing when the entire prompt is shorter than 1,024 tokens.
Measurement provenance: this matrix ran on upstream
6f32ec0plus these scheduling changes, before the profiling and benchmark tooling was removed to produce this minimal patch. Profiling was disabled during measurement. The full matrix has not been repeated on the exact final minimal binary; that binary received the correctness checks below.Correctness and build checks
The final minimal patch builds with CUDA for
sm_86.Three fresh A/B correctness cases—six engine runs—passed:
Generated tokens, GDN state hashes and sampled FP32 residual bytes matched in each pair.
The broader matrix also passed output/state, actual chunk-count and expert-placement checks. Benchmark tooling and generated results are kept outside this PR; its diff is one file, 34 insertions and 8 deletions.
Limits
This is a modest scheduling improvement, not an increase in PCIe bandwidth. Larger chunks can avoid much more repeated expert traffic than this change saves.
Measurements cover one NVIDIA/Linux machine and synthetic prompts. Three pairs per case provide limited statistical certainty. Residual checks sample every 64th position rather than comparing every tensor. AMD, Windows and multi-GPU execution remain unvalidated.
Developed with an AI coding assistant; builds, tests and measurements ran locally.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.