Repository navigation
Conversation
cobra91
force-pushed
the
pr/peer-tail-skip-hot
branch
from
November 20, 2026 10:05
32c933b to
92b907d
Compare
Contributor
Author
|
Rebased cleanly onto v0.2.17 ( Benchmarked in isolation on Strata v0.2.17 with an asymmetric dual-GPU setup (RTX 5080 + RTX 4060 Ti over PCIe Gen4 x2):
Clean and fully mergeable on v0.2.17. |
cobra91
force-pushed
the
pr/peer-tail-skip-hot
branch
from
November 26, 2026 14:01
92b907d to
c234774
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
When
--peer-deviceis used to offload MoE experts across multi-GPU setups (especially asymmetric pairs like RTX 5080 + RTX 4060 Ti, or bandwidth-constrained links such as PCIe Gen4 x2/x4 and eGPU), decode throughput suffers from three compounding issues:generate.cpp:14183,o.peer_device < 0excluded peer configurations from the defaultSTRATA_ROUTE_TAIL_SKIP=7, andexpert_source.cpp:5028hadd.peer == nullptrhard-coded in the skip logic. Consequently, missed experts routed at low rank (ranks 7–9 in top-10) were forced across PCIe to the peer card or host CPU even though their router weight is negligible, inflating PCIe offload traffic to 48.1% of all routed experts.STRATA_PEER_HOTdefaulted to0.45(moving 45% of the first 8,700 ranked experts to the peer card), which was tuned for identical GPUs on symmetrical x16 links. On asymmetric GPUs or narrow PCIe slots, this forced half the most critical experts onto the slower card over the bottlenecked link, with no command-line flags to adjust it (STRATA_PEER_HOTwas an undocumented environment variable only).PeerExperts::finishspun oncudaStreamQuery(stream_)in an empty loop across 48 layers per window, consuming 100% of a CPU core and creating interconnect contention with CPU pool workers.Result:
STRATA_ROUTE_TAIL_SKIP=7) reduces peer PCIe offload from 48.1% down to 26.0%–27.4% and increases primary GPU expert cache hits to 97.0%–97.7%.--peer-hot <frac>and--peer-hot-at <n>CLI flags allows users with asymmetric GPUs to set--peer-hot 0(keeping all top-tier experts on the primary GPU), eliminating PCIe transfer penalties on the critical path._mm_pause()insidePeerExperts::finisheliminates tight CPU spin contention during stream queries.Related discussion
Follow-up to #6303 (
[Engine] allow layer-major prefill super-chunks with --peer-device) addressing the decode bottleneck in asymmetric dual-GPU configurations.Approach
engine/src/core/expert_source.cpp:expert_pool_dispatch_multi: removed.peer == nullptrfrom thetail_rank > 0condition. Tail-skip logic now checkstail_rank > 0 && d.remote_count == 0, inspectingd.host_resto skip low-rank misses on the primary GPU without dispatching them to the peer card or CPU pool.engine/src/core/peer_experts.cpp:PeerExperts::finish: add_mm_pause()insidewhile ((e = cudaStreamQuery(stream_)) == cudaErrorNotReady)(guarded with#if defined(_MSC_VER) || defined(__x86_64__) || defined(_M_X64)) to relieve memory bus and hyper-thread contention during per-layer polling.engine/src/program/generate.cpp:struct Options: adddouble peer_hot = -1.0; int64_t peer_hot_at = -1;.--peer-hot <frac>and--peer-hot-at <n>, with help text inusage().o.peer_hot/o.peer_hot_atwhen provided, falling back to existingSTRATA_PEER_HOT/STRATA_PEER_HOT_ATenvironment variables or default0.45/8700.o.peer_device < 0from lines 14183 and 14188 soSTRATA_ROUTE_TAIL_SKIP=7is enabled by default in peer mode when experts are missed.Validation
Passed:
strata.exe --serve --peer-device 1 --peer-hot 0.0 --vram-reserve-mib 1400pr/peer-tail-skip-hot(branched fromorigin/main58ee322)strata serve: route tail skip: 141249 missed experts skipped (150883 entries) since the start.Failed:
Not run:
Limits
--peer-hot 0.45remains unchanged unless explicitly configured via--peer-hot 0.0orSTRATA_PEER_HOT=0.0.