mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2720] [CLOSED] [Engine] --peer-device: the adaptive tier's copies land while the next window runs (opt-in STRATA_ADAPT_OVERLAP=1) #4229
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#4229
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/2720
Author: @bulhenvaster
Created: 10/16/2026
Status: ❌ Closed
Base:
main← Head:pr/peer-adapt-overlap📝 Commits (2)
c0ea1ec--peer-device: the adaptive tier's copies land while the next window runs (opt-in STRATA_ADAPT_OVERLAP=1); opt-in STRATA_PEER_LAUNCH_IN_POOL=1 launches the peer inside the pool's first phase6f3e4c0Merge main (0.2.0-beta,e88ee39d) into pr/peer-adapt-overlap📊 Changes
10 files changed (+226 additions, -25 deletions)
View changed files
📝
docs/DETAILS.md(+8 -0)📝
include/strata/core/expert_source.hpp(+1 -0)📝
include/strata/core/peer_experts.hpp(+25 -0)📝
include/strata/core/verify.hpp(+15 -1)📝
include/strata/kernels/cpu/pool.hpp(+6 -1)📝
src/core/expert_source.cpp(+28 -7)📝
src/core/peer_experts.cpp(+82 -3)📝
src/core/verify.cpp(+8 -2)📝
src/kernels/cpu/pool.cpp(+8 -3)📝
src/program/generate.cpp(+45 -8)📄 Description
Problem and result: in peer mode (
--peer-device)STRATA_ADAPT_OVERLAP=1is refused ("not with --peer-device"), so every decode window first waits for the previous adapt round's copies. On 0.2.0-beta (maine88ee39d) that wait is 5.0-5.2 ms of a 45 ms window. With this change the peer tier joins the overlap and the wait is 0.20-0.23 ms. Decode of 900-token greedy answers on a 161K-token conversation (3 questions x 3 rounds, decode only, medians), two runs each, alternating:main,STRATA_ADAPT_OVERLAP=1(refused)STRATA_PEER_LAUNCH_IN_POOL=1The wait is gone in every run; tokens per window move with the text the drafts find, so ms per token is noisier than the window (mean of the two runs: 11.82 -> 11.18, -5%).
STRATA_PEER_LAUNCH_IN_POOLmeasured no gain over the overlap alone on this build (it gave +1.7% on 0.1.43); I can drop it from this PR if you prefer.Approach: with
STRATA_ADAPT_OVERLAP=1PeerExperts::adaptissues its copies in layer order and signals each layer's landing with the primary's kind of signal (a stream-ordered D2H copy of the layer number into a pinned int, or host functions where the primary uses them), its table takes the swaps at the window's start (flip_pending), and a layer waits for a tier's copies only when that tier swapped in it. Without a peer the per-layer wait is the one it was; without the variable nothing changes. Separately,STRATA_PEER_LAUNCH_IN_POOL=1(opt-in) runs the peer's launch on the host thread right after the CPU pool's first phase is published instead of before the pool starts (with the cold-read path of 0.2.0 it starts before the CPU's batches, as before).STRATA_DECODE_TIMINGgains a line with the peer's launch and wait.docs/DETAILS.md: a paragraph underSTRATA_ADAPT_OVERLAP.Validation (RTX 5060 Ti 16 GB, PCIe 3.0 x8, primary + RTX 3060 12 GB, x16,
--peer-device 1; Xeon E5-2683 v4, 64 GB DDR4 in two channels; Ubuntu, CUDA 13.3, driver 595.91; Qwen3.8-Flash-Next IQ3_XXS pack,--kv int8 --kv-resident 32768 --spec 4 --mtp --adapt-every 1 --adapt-swaps 160 --prompt-cache 14 --pcie-frac 0,STRATA_DECODE_TIMING=1; one engine start per run):cmake --build build --target strata(CUDA, sm_86 + sm_120) on this branch's tree, no errors.mainand this branch, deterministic decode (--spec-min-p 1.01 --suffix-draft 0 --lookup-chain 0 --adapt-swaps 0, so no copies),STRATA_ADAPT_OVERLAP=1, no launch switch, a chain of 12 prompt reads with 64-token answers on a 161K conversation: 14 of 14 answers identical.main, overlap, overlap + launch, then again).mainalready differ: the tier makes the output depend on timing).Limits: one rig measured.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #2720] [Engine] --peer-device: the adaptive tier's copies land while the next window runs (opt-in STRATA_ADAPT_OVERLAP=1)to [PR #2720] [CLOSED] [Engine] --peer-device: the adaptive tier's copies land while the next window runs (opt-in STRATA_ADAPT_OVERLAP=1)