mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1055] [CLOSED] two-PC: a second PC runs a block of layers as a stage of the layer split (--stage-server / --remote-stage, decode only) #2997
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#2997
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/1055
Author: @mirifiuto135-debug
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:two-pc-stage📝 Commits (10+)
64d0136cache: preserve checkpoints when split allocation failsa0d0056prefill: fused-expert exact wins (table16 via direct selector, float4 moe_combine, LDS alias + occupancy)5f5452bserve: park_current's try covers the checkpoint split too (#752): a host OOM skips parking8b19a38Layer split: --vram-reserve-later-mib, a separate reserve for the later cardsea83d0dResident RAM mode with a layer splitd2d981fsetup: the low-RAM mode's resident variant on several GPUs (#642)cd62e5eserve: a split's stage-0 GPU profile line keeps its text (#848); later stages say which stage0471c5agenerate: residency-table uploads wait for their own copy before the non-blocking streams read the table2d82703generate: res_put syncs stream 0 (HIP has no cudaStreamLegacy) (#550)7cdc521verify: the all-resident graph runs only while every expert is in VRAM; a -1 raises a plan error flag (#871)📊 Changes
1 file changed (+37 additions, -24 deletions)
View changed files
📝
src/program/generate.cpp(+37 -24)📄 Description
What
A second PC can run a block of layers as one more stage of the existing layer split, over plain TCP. Decode only (v1).
Two sides, one flag each, in
src/program/generate.cpp+ a newsrc/core/stage_link.cpp/include/strata/core/stage_link.hpp:--serve --stage-server HOST:PORT --stage-layers A,Bloads and runs layers[A,B)only (its own pack copy, dense weights, experts, session), no head, no drafter, no HTTP of its own. It dials the driver and answers RUN / COMMIT / ZERO for each verify window. With several cards an explicit--layer-split M(A < M < B) splits the stage's layers across them.--serve --remote-stage PORT --remote-layers A,B --layer-split B,…keeps layers[0,A)and[B,n), the head, sampling and the MTP drafter; its stage chain gets one more hop in the middle. The driver's port only accepts the stage; a stranger connecting first is dropped and the driver keeps waiting.StageBridgehook between twoVerifierstages (include/strata/core/verify.hpp): the existing per-window hand-off buffer (host-pinned, ~51 KB per token) is what crosses the cable, in both directions. A loopback bridge (STRATA_BRIDGE_LOOPBACK=N, memcpy only) exists to test the hook on one PC.--layer-split autois not accepted on the stage.v1 limits, enforced, not hidden: prompts go through verify windows only (no
Prefillchaining over the cable yet), checkpoints and the conversation cache are off while a remote stage is attached.Why
A model whose experts do not fit one PC's RAM. The other PC's cards hold its layers' experts; the driver's RAM and cache cover fewer layers. It does not make decode faster (measured below); it moves RAM pressure and raises the driver's card hit rate.
Measured
Windows 11 both sides, direct 2.5 GbE cable. Driver = 3× RTX 5060 Ti 16 GB, 128 GB RAM; stage = 1 or 2× RTX 5060 Ti 16 GB, 64 GB RAM. Qwen3.8 Flash-Next UD-Q6_K_XL converted pack (experts Q8_0),
STRATA_ARENA_MMAP=1, MTP on, three short prompts, 150 tokens each, temperature 0:--layer-split): 19.1 / 17.6 / 24.8 tok/s — same band, not faster; the stage spent 54.9 ms per windowWhy not faster: the layers run one after the other whichever PC holds them; the window time is set by the experts the cards miss, and the stage's CPU is not faster than the driver's. Two PCs buy RAM headroom, not speed, with this split.
Not in this PR
Prompt path over the cable (a 2048-token chunk is ~105 MB each way; estimated +16 % on prefill at 2.5 GbE), checkpoints / conversation cache with a remote stage, the stage loading only what it uses (today it still loads the PLE table and the head). AMD, Linux and single-PC paths are untouched;
STRATA_ARENA_MMAPon Windows is PR #1002, independent of this one.Rebased from 0.1.39 onto v0.1.40 for this PR (three conflict regions in
generate.cpp: the--kv-growblock,--mtpbecoming optional,--pipeline-windows); it builds on v0.1.40 with CUDA 13.3 for sm_89 + sm_120. The measurements above are from the 0.1.39 build; I have not re-run the two-PC test on the v0.1.40 build yet and will say so if asked.Disclosure
The code was written with Claude Code (Anthropic) under my direction; I built and tested it on the hardware above. Happy to adjust anything, or to split it into the bridge hook and the stage/driver halves if that reads better.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.