From dea75159fd103da74ce50405ea5cfa80ef17acd7 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Fri, 13 Nov 2026 09:02:56 +0100 Subject: [PATCH] host-round doc: tier-swap bursts Co-Authored-By: Claude Sonnet 5.5 --- docs/experiments/host-round.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/experiments/host-round.md b/docs/experiments/host-round.md index 83270bb7..cf9bd6f7 100644 --- a/docs/experiments/host-round.md +++ b/docs/experiments/host-round.md @@ -96,4 +96,26 @@ The hook is hidden: a chain step costs the same with and without it (0.485 ms ho (+1.2 %, CI -1.6..+4.0 %), ms/round +0.34 (CI -4.6..+8.5 %), tokens per round +0.11 (CI -5.9..+12.3 %): they resolve nothing, the adaptive window moves tokens per round by more than the 0.134 ms (0.75 % of a 17.4 ms round) is worth. 0.134 ms at 17.4 ms per round and 3.55 tokens per round is +1.4 tok/s (+0.75 %). +## 5. Tier-swap wait (placement policy; not a default before the control gate) + +`round.apply_pending` is `OriginalServePool::apply_pending` -> `OriginalExpertCache::wait_swaps` (`LELEKA_SERVE_SWAP_WAIT`, default wait): the swap copies of the previous round's adaptation +must land before the next window, so that they do not read host memory while the CPU pool streams its experts (job 803) and the resident set does not depend on when the copies finished. +A swap round (every 4th) queues up to 96 swaps = 172 host-to-device copies = about 3.3 ms of copy engine time, started 0.3-0.5 ms into the draft, which lasts 2.2-2.4 ms: +1.5-2.2 ms of the copies outlive the draft and the host waits for them (0.35-0.40 ms per round on average, 0.395 in DP.1 of the owner-default release). + +Proposal (no code, two existing environment variables): adapt every 2 rounds with up to 48 swaps (`T`): the same swap throughput per round, in bursts of about 1.65 ms that fit under the draft. +Arm `TW` (every 2, still 96 swaps: twice the throughput) is the "PW" arm of the 2026-11-12 slots/adapt A/B, re-measured on the owner-default placement. +Job `decode-tier-swap-bursts-every2-swaps48-vs-default-step-profile-pairs` (package 71354841ede0, PROVENANCE git_commit 71354841ede09fc0d0d44e37e68fac4138d639ef, tarball sha256 1b0cdbf0..., arm guard ok on +all 12 arms, the engine's `expert tier adaptation: every N rounds, up to M swaps` line equals the arm), block 1 with the step profile, blocks 1-3 without: + +| arm | `round.apply_pending` ms per round (block 1, profile) | decode tok/s (3 blocks) | vs D | ms/round | tokens/round | VRAM share of routed experts | +| --- | ---: | ---: | --- | ---: | ---: | ---: | +| D (4 rounds, 96) | 0.351 | 206.80 | | 17.38 | 3.59 | 90.97 % | +| T (2 rounds, 48) | 0.098 | 209.96 | **+1.53 %, CI +0.26..+2.79 %** | 17.37 (-0.01, CI -5.7..+5.6 %) | 3.65 | 91.00 % (+0.04) | +| TW (2 rounds, 96) | 0.331 | 209.77 | +1.43 %, CI -0.67..+3.54 % | 16.89 (-0.49, CI -12..+6.4 %) | 3.54 | 91.43 % (+0.46, CI +0.19..+0.83) | + +T removes 0.25 ms of wait per round (-72 %) and the decode gain (+3.2 tok/s) is the size of that (1.4 % of the round). TW keeps the full copy burst, so its wait stays (0.331) and its gain comes +from twice the swap throughput (VRAM share +0.46 points), as in the earlier A/B; T and TW are equal in decode tok/s (-0.09 %, CI -2.8..+2.6 %). As always for the adaptive tier, byte-identical requests +are 4-5 of 90 per pair (placement noise); the quality verdict is the teacher-forced control gate. + RESULTS_PLACEHOLDER