mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #482] [CLOSED] Networked Pool support #2659
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#2659
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/482
Author: @fragtion
Created: 10/2/2026
Status: ❌ Closed
Base:
main← Head:pool-support📝 Commits (3)
089cd06build: MSVC compiler probe without debug records; STRATA_RELEASE_PDB option924db57engine: pool - split one model's layers across PCs (--pool-peers / --pool-listen)825a9faserve: Pool tab - share requests between PCs (routing) or split layers (coordinator/worker)📊 Changes
38 files changed (+6868 additions, -82 deletions)
View changed files
📝
CMakeLists.txt(+37 -6)➕
POOL-FIREWALL.bat(+19 -0)➕
POOL-SELFTEST.bat(+14 -0)📝
README.md(+2 -1)➕
docs/POOL.md(+218 -0)📝
include/strata/core/conversation_cache.hpp(+1 -0)📝
include/strata/core/expert_source.hpp(+9 -0)📝
include/strata/core/native_dense.hpp(+6 -1)📝
include/strata/core/verify.hpp(+31 -2)➕
include/strata/pool/link.hpp(+157 -0)➕
include/strata/pool/net.hpp(+82 -0)➕
include/strata/pool/protocol.hpp(+157 -0)➕
include/strata/pool/split.hpp(+60 -0)➕
include/strata/pool/worker.hpp(+36 -0)📝
include/strata/prefill/prefill.hpp(+13 -0)➕
serve/pool.py(+826 -0)➕
serve/route.py(+367 -0)📝
serve/server.py(+218 -15)➕
serve/test_pool.py(+484 -0)📝
serve/web/app.css(+70 -0)...and 18 more files
📄 Description
Title
Pool: use several PCs together — share requests between them, or split one model's layers across them
Description
Hi Niko, this adds an optional Pool tab that lets two or more PCs on a LAN work together. Nothing changes for
anyone who doesn't use it: an engine started without
--pool-*flags and a server whose pool role is Off behaveexactly as before. I've been running it on my own two machines (RTX 3060 12 GB desktop + RTX 5060 8 GB laptop, both
on the Coder IQ1_M). Please treat it as a proposal: take it, take parts of it, or ask for changes.
What it does
There are two modes, chosen per PC in the new Pool tab:
--pool-peers/--pool-listen)The tab says plainly that neither mode adds up the PCs' tok/s, because that is the first thing people expect.
docs/POOL.mdexplains both modes in the same style asMULTI_GPU.md.Share requests (
serve/route.py): each PC runs Strata as usual. A chat request that reaches any PC runs on the PCthat already holds that conversation, recognised from a hash chain over its messages (clients' moving
cache_controlmarkers are ignored), so the prompt cache and parked chats keep working. Otherwise it runs on an idlePC, preferring the one marked primary. A conversation moves off a busy PC only if the other PC would re-read at
most N tokens (default 8,000); a long one waits for its own PC. A PC whose context window is too small for the
request is skipped. If the PCs lose touch, each carries on alone and checks for the others every 3 s. Streams are
relayed as they arrive, and a client that hangs up cancels the request on the other PC (same idea as #430).
Requests between PCs carry an HMAC (pool secret over time, nonce, path and body hash), which replaces the
receiving PC's API key for those requests only.
Split layers: pipeline parallelism with the same cut as the multi-GPU layer split, over TCP instead of pinned RAM.
The coordinator runs layers
[0, K)plus the head, sampler and MTP draft layer. Each worker runs a later range.Each PC loads only its own layers' experts (
ArenaExpertSource::set_layer_range), dense weights (aNativeDenseskip list) and KV/recurrent state. A PC whose RAM can't hold the whole model can still take part.
A verify window crosses the network once out and once back (12,804 floats per token), never per layer. Prompt
chunks go through the workers like a local next stage.
--pool-split autoreuses the multi-GPU cost model, adding a network hop per PC and each PC's RAM and VRAM.The protocol (
include/strata/pool/protocol.hpp):HELLO, then mutual HMAC-SHA256 auth (the secret never crosses the wire);CONFIG/READY, with a model fingerprint check;VERIFY/PREFILLrows in f32 (exact), f16 or bf16;COMMIT,RESETand checkpoint messages.A worker keeps its layers loaded between coordinators, and answers a second coordinator with "busy".
Per-request log line on the coordinator: window time split into this PC, the workers' layers, and the network.
The server side (
serve/pool.py):<config>.pool.json, switched without restarting the server;POOL-FIREWALL.batopens the ports on private networks.Not supported in Split mode yet (refused with a clear message)
--shared-expert-arena--prompt-cache) do work across the poolShare requests has none of these limits.
Commits
build: MSVC compiler probe without debug records; STRATA_RELEASE_PDB option. A small, independent Windowsbuild fix: CMake's compiler probe fails with D8050 on PCs whose process monitors block cl.exe debug records. Happy
to split it into its own PR.
engine: pool - split one model's layers across PCs:src/pool,include/strata/pool, and hooks inVerifier, Prefill, the expert source, NativeDense and generate.cpp (marked
POOL:).serve: Pool tab - share requests ... or split layers ...:serve/pool.py,serve/route.py, the tab, andthe docs.
The diff is large (about 6,800 lines added), but most of it is new files. The changes to existing engine code are
small, opt-in hooks.
Testing
strata-pool-test: hashing, wire formats, frames, handshake, split search.strata-pool-link-test: the coordinator against scripted workers (wrong secret, other model, busy worker,reload, two workers, both wire formats, checkpoints).
serve/test_pool.py: config, supervisor, discovery, role switching, and two routing servers coveringstickiness, the primary, context limits, a streamed relay, signatures, and a peer going away.
CUDA 13.0 on Windows (one engine for sm 75;86;89;120).
single-PC speed.
hit rate went from 55–60% to 70–78%. In that run the laptop's cache was mis-sized, so tok/s stayed level;
commit 2 makes a pool PC always size its cache to its free VRAM. I haven't re-measured since.
src/pool/link.cppuses only CUDA runtime calls thathip_compatcovers, but I haveno AMD card to check.
Trying it
Two PCs with the same model:
POOL-FIREWALL.batonce on each.Found on your network).
POOL-SELFTEST.batchecks the split path on one PC against the model alone.🤖 Generated with Claude Code
https://claude.ai/code/session_0157fjixQD2nRxvCvtXq66DD
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.