Merge claude/window-policy: draft-floor ceiling default 0.60 (LELEKA_SPEC_POLICY=legacy restores 0.9), replay-arm policy tooling, spec-trace bar/slope, run-e2e ATTN_DAILY_MTP default
Paired A/B 245k (8 blocks): +1.09% tok/s, se 1.86 (not resolved); replay screening +0.35..+1.72 tok/s; argmax flips 1.9-2.0% vs A/A 1.3-1.55% (<2.8% bound). Not claimed as a speedup. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -218,6 +218,7 @@ tok/round, which moves by +-0.1 between identical arms.
|
||||
must keep its order, so only the two-pass fusion is safe. Not done.
|
||||
* **Draft before commit in the host order** (the draft would start about 48 us earlier): with the fused commit the commit enqueue costs about 10 us, so there is nothing left to win; and the reorder touches the controller's state machine.
|
||||
* **Pipelined chain** (launch step j+1 before the host read of step j): the adaptive window always runs with a confidence floor, and a speculative step past a failed test writes a ring cell; not safe to do bitwise.
|
||||
* Follow-up: [window-policy-5090](window-policy-5090.md) finds why the window narrows (a step function of the draft floor), screens the policy constants on forced text and changes the default draft-floor ceiling 0.9 -> 0.6 (`LELEKA_SPEC_POLICY=legacy` restores it); the fixed-window gain of section 6 was content, not policy.
|
||||
* `LELEKA_SPEC_DRAFT_STEP_MS` (the adaptive window's constant for the cost of one chain step, 0.45 ms) is now closer to the measured step (about 0.42 ms with the attention switch) than before (0.6); it is a policy parameter, not touched.
|
||||
|
||||
## 8. Reproduce
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
# 5090 decode at 245k: the adaptive window answers a faster draft round with narrower windows; the default policy after it (claude/window-policy)
|
||||
|
||||
Date 2026-11-02/03. RTX 5090 (32 GB), Ryzen 9 9950X3D, driver 595.99, CUDA 13.2, server `rnr5090`, one heavy job at a time under `/data/leleka-e2e/gpu.lock`, sealed KAR memfd held by the holder.
|
||||
Base = `main` f9003b7ce (the draft-round merge with `LELEKA_SM120_ATTN_DAILY_MTP=1` in the rtx5090-32g profile). Workload of the end-to-end runs: the frozen 245k corpus, 5 turns, `--max-output 300`, final-turn input 246,885-247,057 tokens,
|
||||
PCIe share pinned 0.45, seed off, upstream ranked profile, auto slots, `LELEKA_CHAIN=all`, prefix cache auto, `--spec-min-p 0`. Labels: M measured in the run named, E estimate.
|
||||
Follows [draft-round-5090](draft-round-5090.md) sections 5-7: the faster MTP draft shortened every round by 0.366 ms (12 of 12 blocks) and tok/s moved by +0.5 % +- 0.6 % only.
|
||||
|
||||
## 1. Result
|
||||
|
||||
| item | class | status | effect |
|
||||
| --- | --- | --- | --- |
|
||||
| **draft-floor ceiling of the adaptive window 0.9 -> 0.6** (request `spec_min_p` 0; `LELEKA_SPEC_POLICY=legacy` or `LELEKA_SPEC_FLOOR_CEILING=0.9` restores it) | speculation policy, verified tokens unchanged in kind (section 5: inside the policy's own run-to-run envelope, not bitwise, cannot be) | **new engine default** (this branch) | paired A/B at 245k, 8 blocks, one binary: tok/s **+1.63 (+1.09 %), se 1.86, 4 of 8 blocks** (n.s.); tok/round **+4.1 %** (6 of 8), ms/round **+0.39 ms (+3.0 %)** (8 of 8 longer), rows/round +5.9 %, chain steps/round +38 % (8 of 8); on the same forced text (replay) +0.35..+1.7 % |
|
||||
| `LELEKA_DRAFT_FUSED_COMMIT=on` as a third arm | bitwise | **stays opt-in, off** | on top of the new default: tok/s -0.67 (-0.39 %), se 1.66, 4 of 8; ms/round -0.13 ms (7 of 8 shorter) but tok/round -1.3 %; against main c - a +0.64 % (n.s.) |
|
||||
| constants tried and NOT adopted: smooth floor, measured rate, `rowq` 0.5 / 0.75, `step` 0.3, exploration off, ceilings 0.5-0.55, fixed windows | | not adopted | all inside +-1.2 % of main on forced text, section 4 |
|
||||
| `LELEKA_SM120_ATTN_DAILY_MTP=1` in `scripts/e2e/run-e2e.sh`; profile -> engine path checked | harness / test | done | section 7 |
|
||||
|
||||
**The honest size of this.** The draft-round finding stands: a faster draft makes the adaptive window narrower, and that gave back most of the 2.7 % shorter round. What this branch finds is that the optimum of the window policy is **flat** at 245k (every ceiling from 0.9 to 0.6, the fixed window and every constant change are within +-1.2 % of each other on identical forced text),
|
||||
so the policy was never far from the best and there is at most +0.3..+1.7 % to recover: the end-to-end A/B measures +1.1 % +- 1.2 % (n.s.; per-block tok/s differences have sd 5 tok/s from the text each run happens to produce, tok/round moves 0.05-0.2 between identical arms). No pooled measurement of the new default is negative (replay pairs 4 of 5 and 3 of 3 positive; e2e tok/round up in 6 of 8, tok/s up in 4 of 8) and moves the policy back to the depth it had before the faster draft;
|
||||
it is a small, switchable default change, not a resolved speedup. The "fixed window +3.0 %" of draft-round section 6 was not a policy gain (section 4, point 3).
|
||||
|
||||
|
||||
|
||||
## 2. Why a faster round gives a narrower window (M, `runs/window-policy-obs`, bin-dr2, `LELEKA_SPEC_TRACE=1`, one 5-turn run per regime)
|
||||
|
||||
The adaptive window (`original_spec_adaptive.rs`, `docs/adaptive-spec.md`) has two halves. `choose` picks, per round, how many of the offered drafts to verify (tokens per ms with the *measured* cost of each width). `draft_plan` decides what the NEXT
|
||||
round is offered: how many chain steps to run and the confidence floor at which the chain stops. The floor is the lower edge of the first probability bucket (edges 0.25 0.4 0.55 0.7 0.8 0.9 0.95) whose calibrated acceptance clears the *bar*
|
||||
`a_req = rate * (row slope + chain step) / survival` (a further draft is worth producing when `survival * a` tokens beat `rate` tokens per ms of its verify row plus its chain step), clamped to `[0.10, ceiling]`, ceiling = the request's `spec_min_p`, 0 meaning 0.9.
|
||||
|
||||
| | legacy policy (ceiling 0.9) | new default (ceiling 0.6) |
|
||||
| --- | --- | --- |
|
||||
| rounds, tok/round, ms/round (one run each, `runs/window-policy-obs2`, bin-wp1) | 725, 2.072, 13.10 | 705, 2.122, 13.64 |
|
||||
| bar `a_req`: mean (p10 / p90), row slope, token rate | 0.682 (0.593 / 0.797), 1.99 ms, 0.154 tok/ms | 0.693 (0.562 / 0.857), 2.05 ms, 0.151 tok/ms |
|
||||
| floor chosen for the next chain (share of rounds) | 0.8: 62 %, 0.7: 22 %, 0.55: 11 %, 0.9: 5 % | 0.6: 74 %, 0.55: 25 % |
|
||||
| drafts produced per round / verified rows | 1.78 / 2.64 | 2.16 / 2.74 |
|
||||
| width shares t = 1 / 2 / 3 / 4 / 5+ | 7 / 51 / 30 / 4 / 8 % | 10 / 42 / 31 / 5 / 12 % |
|
||||
|
||||
And before the faster draft (`runs/window-policy-obs`, bin-dr2, attention switch off, one run each): floor 0.7 in 75 % of the rounds, 0.8 in 5 %, t = 4 in 14 % of the rounds; with the switch on: floor 0.8 in 73 %, 0.7 in 4 %, t = 4 in 4 %. The 12-block draft-round series moved the same way (rows/round -2.4 %, chain steps/round -4 %).
|
||||
|
||||
**Mechanism (M for the floors and the bar, E for the causal chain).**
|
||||
1. The bar `a_req` is about 0.68 +- 0.1 (rate 0.154 tok/ms x (row slope 2.0 ms + chain step 0.45 ms) / survival of the last row about 0.5). That is the calibrated acceptance of the 0.7-0.8 bucket (prior 0.70, learned 0.70-0.8). The floor is a *step function* of the bar: a bar below the 0.7-0.8 bucket's acceptance gives floor 0.7, above it 0.8, and the next bucket
|
||||
jumps 0.1 in probability. Any change of an input of the bar of a few percent moves the floor by a whole bucket. A faster round raises `rate` (same tokens in less time) and the floor goes from 0.7 to 0.8; the content (the learned acceptance of that bucket) does the same.
|
||||
2. A floor of 0.8 instead of 0.7 stops the chain after every draft below 0.8 (a draft is produced only when the one before it had p >= floor); about a third of the drafts have p in 0.55-0.8. The next round is then offered fewer drafts (1.78 against 2.16 per round) and `choose` can only verify what was produced: rows/round and tokens/round fall.
|
||||
3. The cost model that sets the bar charges every produced draft the full verify row (`slope + step`), but only the drafts the next round chooses pay the row: 70 % of the offered drafts are verified, and of the rounds that were offered three drafts 75 % drop the third (`runs/window-policy-obs`). The bar is therefore an upper bound on what a draft must promise, and `choose` (full information: the calibrated acceptance of the actual row) is the better test for the row. Hence a lower
|
||||
ceiling: the chain may go deeper and `choose` prunes.
|
||||
4. The loss is small because the optimum is flat: removing the marginal rows saved little time and cost little: a row near the bar yields tokens at about the rate it costs (the replay pairs, section 4).
|
||||
|
||||
Not the cause (checked): the cost constant `draft_step_ms` 0.45 ms equals the measured chain step now (0.438 ms wall, `mtp.chain_step`; it sat under the old 0.59). Calibrating it to 0.3 *loses* 1.06 tok/s (0 of 3): a cheaper step lowers the bar, but it also lowers the cost subtracted from every width's round time and the choice gets worse.
|
||||
|
||||
|
||||
## 3. Change
|
||||
|
||||
* `original_spec_adaptive.rs`: `FLOOR_CEILING = 0.60` (the chain floor's upper bound when the request carries `spec_min_p` 0, the product profile) replaces the hard-coded 0.90. A request that names a ceiling (`spec_min_p` > 0) keeps it, exactly as before.
|
||||
* Switches (default-changing config with the old behaviour restorable): `LELEKA_SPEC_POLICY=legacy` (also `v1`) restores every constant of the earlier policy (field-by-field unit test); `LELEKA_SPEC_FLOOR_CEILING=<p>` sets the ceiling; in replays `adaptive@0.9` is the old policy and `adaptive@0.6` the new one in the same process.
|
||||
* Option plumbing for the experiments (default off, the plan rule equals the earlier one for every input, unit test against the kept earlier rule): `rowq`, `smooth`, `measured` and the per-arm `~key=value` suffix of `LELEKA_SPEC_ARMS` (`AdaptiveConfig::set_option`).
|
||||
* `DBG spec-trace` prints the bar and the row slope of the policy (`bar=0.682 slope=1.99`) after the next plan.
|
||||
* Not changed: kernels, verification, the draft numerics, `draft_step_ms`, exploration, the profile (`engine_env` takes only `LELEKA_ORIGINAL_SERVE_*`, `LELEKA_SM120_*` and `LELEKA_CHAIN` keys, so the policy default lives in the engine).
|
||||
* Fused commit: stays off (section 6).
|
||||
|
||||
|
||||
## 4. Screening on forced text (M)
|
||||
|
||||
Instrument: `scripts/e2e/decode/windowpolicy-replay.sh` (+ `-summary.py`). One test-binary process (`rt-wp2`, `rt-wp3`) loads the model once and serves a 5-request capture in teacher-forced replay (`LELEKA_REPLAY_FORCE=1`: every arm decodes exactly the recorded text), production decode
|
||||
shape (auto expert slots, seed off, adaptive tier swaps every 4 rounds, chain kernels, upstream ranked profile, PCIe 0.45, prefix cache reply@8192, the CPU pool at its default, draft attention switch on), with several window policies as `LELEKA_SPEC_ARMS`
|
||||
(`adaptive@P` = adaptive window with the request floor ceiling P, `fixedN@P` = the Original's window, `~key=value` = per-arm policy constants, new in this branch). Arms rotate over the repetitions, so every arm meets every cache/tier state, and every arm decodes the same text: the
|
||||
arms differ only in how they speculate and the noise is timing only. Per-pass tok/s is rebuilt from the per-request `decode_ms` (the `REPLAY PASS` line rounds to 0.1 s = 1.2 %).
|
||||
|
||||
**Replay of night5-long-256k** (`runs/window-policy-rp2`, 10 arms x 3 repetitions, 240 forced tokens x 5 requests, prompts 46k..243k; ms/round 15.3 here against 13.2 in the end-to-end runs, because requests start on a cold tier):
|
||||
|
||||
| arm | tok/s | tok/round | ms/round | paired against adaptive@0 (= ceiling 0.9, main) |
|
||||
| --- | ---: | ---: | ---: | --- |
|
||||
| adaptive@0 (ceiling 0.9, main) | 139.09 | 2.131 | 15.32 | |
|
||||
| adaptive@0.7 | 139.54 | 2.167 | 15.53 | +0.44 (se 0.25), 3 of 3 |
|
||||
| **adaptive@0.6** | **140.81** | 2.232 | 15.85 | **+1.72 (se 0.52), 3 of 3** |
|
||||
| adaptive@0.5 | 138.23 | 2.226 | 16.11 | -0.86 (se 0.91), 1 of 3 |
|
||||
| fixed4@0.5 | 138.36 | 2.093 | 15.13 | -0.74 (se 0.26), 0 of 3 |
|
||||
| rowq=0.5 | 138.70 | 2.244 | 16.18 | -0.40 (se 0.17), 0 of 3 |
|
||||
| smooth floor | 138.32 | 2.131 | 15.41 | -0.76 (se 1.08) |
|
||||
| measured rate | 139.01 | 2.145 | 15.43 | -0.09 (se 0.48) |
|
||||
| explore=0 | 140.06 | 2.151 | 15.36 | +0.97 (se 0.71), 2 of 3 |
|
||||
| step=0.3 | 138.03 | 2.147 | 15.55 | -1.06 (se 0.15), 0 of 3 |
|
||||
|
||||
**Replay of the end-to-end workload itself** (`runs/window-policy-cap` is the e2e run that wrote the capture `/data/leleka-e2e/window-policy/capture/corpus245`; `runs/window-policy-rp3c`, 8 arms x 5 repetitions, 300 forced tokens x 5 requests, prompts 46k..247k, ms/round 14.6-15.4):
|
||||
|
||||
| arm | tok/s | sd | tok/round | ms/round | paired against adaptive@0.9 (main) |
|
||||
| --- | ---: | ---: | ---: | ---: | --- |
|
||||
| adaptive@0.9 (main) | 136.24 | 0.38 | 1.990 | 14.61 | |
|
||||
| adaptive@0.7 | 136.81 | 0.62 | 2.046 | 14.95 | +0.57 (se 0.40), 4 of 5 |
|
||||
| adaptive@0.65 | 136.78 | 1.24 | 2.061 | 15.07 | +0.55 (se 0.77), 2 of 5 |
|
||||
| **adaptive@0.6 (the new default)** | 136.59 | 0.69 | 2.089 | 15.29 | +0.35 (se 0.27), 4 of 5 |
|
||||
| adaptive@0.55 | 135.57 | 1.40 | 2.093 | 15.44 | -0.67 (se 0.76), 1 of 5 |
|
||||
| fixed4@0.5 | 136.35 | 0.39 | 2.011 | 14.75 | +0.11 (se 0.16), 3 of 5 |
|
||||
| adaptive@0.6, explore=0 | 136.71 | 0.18 | 2.068 | 15.13 | +0.47 (se 0.24), 4 of 5 |
|
||||
| adaptive@0.9, rowq=0.75 | 136.75 | 0.85 | 2.068 | 15.13 | +0.51 (se 0.54), 4 of 5 |
|
||||
|
||||
Reading: the landscape is **flat**. Every ceiling from 0.9 to 0.55, the fixed window and every constant change are within +-1.2 % of main (pass-to-pass sd 0.4-1.4 tok/s). What the data resolve:
|
||||
1. A lower ceiling buys depth, not speed: tok/round 1.99 -> 2.09 (+5 %) for ms/round 14.6 -> 15.3 (+4.7 %), net +0.3..+0.6 % on the e2e workload and +0.4..+1.7 % on night5 for ceilings 0.7 and 0.6; below 0.6 the extra depth costs more than it gives (0.55 and 0.5 are negative on both).
|
||||
2. The other candidates are not better than the ceiling: the smooth floor, the measured rate, a cheaper chain step (0.3: -1.06, 0 of 3) do nothing or lose; the production-cost factor `rowq` 0.75 is worth about what the ceiling is, 0.5 goes too deep.
|
||||
3. The adaptive window is not worse than the fixed window at 245k with the new draft (fixed4@0.5: -0.74 on night5, +0.11 on the e2e capture): the "fixed window +2.8 %" of draft-round section 6 was content (one deterministic text path, 2.063 tok/round), not policy.
|
||||
4. Exploration off (+0.5..+1.0, 4 of 5 and 2 of 3) is suggestive and not resolved; it is the price of probing widths on real sessions and is left alone.
|
||||
|
||||
|
||||
## 5. Identity
|
||||
|
||||
`scripts/e2e/decode/windowpolicy-id.sh` (`runs/window-policy-id1`, test binary `rt-wp3` = the branch build): teacher-forced replay of night5-long-256k, 5 requests x 240 forced tokens, production shape, **adaptive window** (the draft-round gate of draft-round-5090 section 4 ran a fixed window,
|
||||
`LELEKA_SPEC=4`, whose widths cannot move and so proves nothing about a window policy), `ADAPT_EVERY=4`, 8000 slots, seed off, `LELEKA_TRACE_LOGPROBS=16`, draft attention switch on in both; one process per setting, two identical arms in each (I1, I2). P1 = `LELEKA_SPEC_POLICY=legacy` (ceiling 0.9, main's
|
||||
behaviour), P2 = the new default. Compared: the top-16 (token id, logprob) rows of every window row (`q_pair`: a row is keyed by request, position and the window's inputs up to the row, so windows cut differently still meet on rows of the same context), and their argmax; `q_tail_gate` (Original envelope: d_top1 p99 <= 0.22, max <= 0.43, flips <= 2.8 %).
|
||||
|
||||
**Result: not bitwise identical, and it cannot be.** The adaptive policy chooses widths from measured times, so two runs of the SAME build cut their windows differently, and the verifier rounds a row differently at different batch widths (the batch-rounding envelope of `docs/adaptive-spec.md`). The A/A floor is 518 of 1,159 common rows identical (P1) and 119 of 1,057 (P2), not 100 %. So the gate is read against that floor:
|
||||
|
||||
| comparison | common rows | identical | argmax flips | d_top1 of the differing rows (median / p99 / max) |
|
||||
| --- | ---: | ---: | ---: | --- |
|
||||
| A/A, P1 (legacy), I2 against I1 | 1,159 | 518 | 18 (1.55 %) | 0.0021 / 0.2299 / 0.5727 |
|
||||
| A/A, P2 (new default), I2 against I1 | 1,057 | 119 | 14 (1.32 %) | 0.0039 / 0.1950 / 0.4622 |
|
||||
| new against legacy, arm I1 | 1,012 | 6 | 19 (1.88 %) | 0.0043 / 0.1978 / 0.6390 |
|
||||
| new against legacy, arm I2 | 1,016 | 6 | 20 (1.97 %) | 0.0047 / 0.1997 / 0.5466 |
|
||||
| `q_tail_gate`, P1 (I2 vs I1, rows 1,208) | | | 17 (1.41 %) | p99 0.1768, max 0.5727: outside (max), FAIL |
|
||||
| `q_tail_gate`, P2 (I2 vs I1, rows 1,205) | | | 17 (1.41 %) | p99 0.1674, max 0.3840: within, PASS |
|
||||
|
||||
The new policy against the old one is not distinguishable from the old policy's own run-to-run noise on these rows: p99 0.198-0.200 against 0.230 (A/A legacy), flips 1.9-2.0 % against 1.55 % (A/A legacy) and 1.3-1.4 % (A/A new), all below the 2.8 % bound; the largest single d_top1 (0.639) is above the legacy A/A maximum (0.573).
|
||||
This is the class of every earlier window-shape change (R3, `--spec 2`, in `docs/quality-gate.md`): the policy decides how much is speculated, the emitted token is the verifier's own argmax at its window width. What is exact: (1) the controller unit tests with the new default (`the_adaptive_window_emits_the_same_text_as_a_fixed_one_under_any_drafter`, `output_is_the_greedy_text_for_every_window_shape_noise_and_stop_rule`; fake target, perfect / poor / failing drafters) pass;
|
||||
(2) `AdaptiveConfig` under `LELEKA_SPEC_POLICY=legacy` equals the earlier constants field by field and the plan rule equals the kept earlier rule (unit tests); (3) verification, the draft numerics and the kernels are untouched (the behavioural diff is the ceiling constant). Limits: 5 requests x 240 tokens, 8000-slot tier (the product runs auto slots), greedy only.
|
||||
|
||||
|
||||
## 6. Paired A/B at 245k
|
||||
|
||||
`runs/window-policy-ab1` (the directory names end in `-v2`, an environment tag of the holder), 24 VALID runs, **one binary `dt/bin-wp1`** (claude/window-policy e57562740) for every arm, PCIe 0.45, seed off, upstream ranked profile, `--spec-min-p 0`, frozen corpus, 5 turns x 300 tokens, final-turn input 246,885-247,057, the order rotated over a b c block by block (positions balanced:
|
||||
`windowpolicy-ab.sh`), all arms with the draft attention switch: **a** = `LELEKA_SPEC_POLICY=legacy` (main f9003b7ce's policy), **b** = the new defaults, **c** = new defaults + `LELEKA_DRAFT_FUSED_COMMIT=on`. Validity as in draft-round section 5 (24 of 24 valid; `settle.txt` of every run lists no other job besides the idle holder, load1 0.46-0.64 at the start, 1.38 for the first run). tok/s = tokens over seconds of the five decode windows; tok/round = tokens over rounds; ms/round = decode seconds over rounds.
|
||||
|
||||
| block | order | a tok/s | b tok/s | c tok/s | a / b / c tok/round | a / b / c ms/round | a / b / c rows/round |
|
||||
| ---: | --- | ---: | ---: | ---: | --- | --- | --- |
|
||||
| 1 | a b c | 152.2 | 160.9 | 160.7 | 2.022 / 2.216 / 2.203 | 13.281 / 13.768 / 13.703 | 2.623 / 2.903 / 2.834 |
|
||||
| 2 | b c a | 155.3 | 157.7 | 151.9 | 2.052 / 2.125 / 2.022 | 13.213 / 13.477 / 13.307 | 2.628 / 2.684 / 2.677 |
|
||||
| 3 | c a b | 158.6 | 155.6 | 162.2 | 2.131 / 2.113 / 2.229 | 13.437 / 13.580 / 13.744 | 2.685 / 2.728 / 2.927 |
|
||||
| 4 | a c b | 155.6 | 161.2 | 153.6 | 2.066 / 2.209 / 2.044 | 13.280 / 13.709 / 13.306 | 2.657 / 2.887 / 2.707 |
|
||||
| 5 | c b a | 160.4 | 154.1 | 157.0 | 2.174 / 2.101 / 2.137 | 13.549 / 13.636 / 13.609 | 2.781 / 2.805 / 2.801 |
|
||||
| 6 | b a c | 154.4 | 154.4 | 155.3 | 2.022 / 2.134 / 2.134 | 13.096 / 13.824 / 13.736 | 2.608 / 2.787 / 2.785 |
|
||||
| 7 | a b c | 158.2 | 156.9 | 158.1 | 2.101 / 2.152 / 2.122 | 13.278 / 13.717 / 13.418 | 2.699 / 2.846 / 2.765 |
|
||||
| 8 | b c a | 153.8 | 160.9 | 157.3 | 2.033 / 2.216 / 2.140 | 13.217 / 13.771 / 13.607 | 2.612 / 2.901 / 2.739 |
|
||||
|
||||
| over the 8 blocks | a (legacy) | b (new default) | c (new + fused commit) |
|
||||
| --- | --- | --- | --- |
|
||||
| tok/s | 156.06 (sd 2.78) | 157.69 (sd 2.98) | 157.01 (sd 3.43) |
|
||||
| tok/round | 2.075 (sd 0.056) | 2.158 (sd 0.048) | 2.129 (sd 0.070) |
|
||||
| ms/round | 13.294 (sd 0.140) | 13.685 (sd 0.115) | 13.554 (sd 0.185) |
|
||||
| rows/round, accepted/round, chain steps/round | 2.662, 1.080, 0.900 | 2.818, 1.164, 1.233 | 2.779, 1.134, 1.262 |
|
||||
| `round.draft_committed`, `commit.wait`, `mtp.finish_first_step` (ms/round) | 1.228, 0.465, 0.034 | 1.400, 0.465, 0.035 | 1.349, 0.084, 0.410 |
|
||||
|
||||
| block-paired difference (mean, se) | tok/s | tok/round | ms/round | rows/round | blocks better |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| **b - a** | **+1.63 (+1.09 %), se 1.86** | +0.083 (+4.1 %), se 0.033 | +0.391 (+3.0 %), se 0.076 | +0.156 (+5.9 %) | tok/s 4 of 8, tok/round 6 of 8, ms/round longer in 8 of 8 |
|
||||
| c - a | +0.96 (+0.64 %), se 1.46 | +0.054 (+2.6 %), se 0.029 | +0.260 (+2.0 %), se 0.076 | +0.118 | tok/s 4 of 8, tok/round 5 of 8 |
|
||||
| c - b | -0.67 (-0.39 %), se 1.66 | -0.029 (-1.3 %), se 0.031 | -0.131 (-1.0 %), se 0.061 | -0.038 | tok/s 4 of 8, ms/round shorter in 7 of 8 |
|
||||
|
||||
Per-block b - a tok/s: +8.7 +2.4 -3.0 +5.6 -6.4 -0.0 -1.3 +7.1. **Reading.** The policy does what the replay predicts: it asks for 38 % more chain steps (0.90 -> 1.23 per round, 8 of 8 blocks), verifies 5.9 % more rows, gets 4.1 % more tokens per round for 3.0 % more time per round; the net is +1.1 %, which is inside the noise of 8 blocks (se 1.2 %):
|
||||
not significant, same sign as every replay. The marginal rows now cost 0.39 ms / 0.083 tok = 4.7 ms per token, the average 6.4 ms per token, so they are still worth taking (0.21 tok/ms against the average 0.156). The stopping rule (8 blocks) was fixed before the run; with a paired sd of 5.3 tok/s, resolving 1 % at two standard errors takes about 45 blocks (about 9 GPU-hours for two arms), so no extension.
|
||||
|
||||
**Fused commit** (arm c): on top of the new default it shortens the round by 0.131 +- 0.061 ms (7 of 8 blocks; `commit.wait` 0.465 -> 0.084 ms, the host waits for the first draft graph instead, `mtp.finish_first_step` 0.034 -> 0.410), consistent with draft-round section 6 (-0.024 +- 0.046 ms with the old policy). tok/s does not follow (-0.39 %, 4 of 8): neutral at best. It is bitwise and harmless, and it is not the best variant by this measurement: **it stays opt-in**.
|
||||
|
||||
|
||||
## 7. Harness and profile path
|
||||
|
||||
* `scripts/e2e/run-e2e.sh` now exports `LELEKA_SM120_ATTN_DAILY_MTP=${LELEKA_SM120_ATTN_DAILY_MTP:-1}`, like the rtx5090-32g profile (only the value `1` enables it; `=0` restores the old kernels). `draftround-ab.sh` and the older job scripts `unset` it before their own arm words, so their
|
||||
arms are unchanged.
|
||||
* The profile's `engine_env` reaches the engine: `Profile::builtin("rtx5090-32g")` -> `RunConfig.profile.engine_env` (saved in `leleka.json`) -> `RunConfig::engine_environment()` -> `Supervisor::start_engine` -> `child_env` (`command.env(key, value)` for every pair, also for the `leleka exec-inherit` wrapper that
|
||||
execs the engine). Evidence: unit test `config::tests::the_server_profile_switches_reach_the_engine_environment_through_the_saved_config` (JSON round trip of the saved config; the operator's `engine_env` wins) and
|
||||
`leleka up --dry-run --profile rtx5090-32g` (laptop, WSL), which prints `engine environment: LELEKA_CHAIN=all ... LELEKA_ORIGINAL_SERVE_SEED=off LELEKA_SM120_ATTN_DAILY_MTP=1`. The laptop profile does not carry it.
|
||||
`engine_env` accepts only `LELEKA_ORIGINAL_SERVE_*`, `LELEKA_SM120_*` and `LELEKA_CHAIN` keys; the window policy is therefore an engine default, not a profile key.
|
||||
|
||||
## 8. Reproduce and paths
|
||||
|
||||
* Build: WSL release from an LF worktree (`git ls-files --eol` shows `w/lf` for the `.ptx`; on the laptop `git -c core.autocrlf=false checkout-index` after removing the files, and **edit shell scripts with LF line endings**: a Python text-mode edit on Windows turned two scripts into CRLF and the first replay job died with `set: pipefail: invalid option name`), binaries `dt/bin-wp1` (e57562740) and test binaries `dt/rt-wp1`, `rt-wp2`, `rt-wp3`.
|
||||
* Screening: `windowpolicy-replay.sh` (stubs `wp-rp2.sh` night5, `wp-rp3c.sh` e2e capture; summary `windowpolicy-replay-summary.py`). Identity: `windowpolicy-id.sh` (stub `wp-id1.sh`). A/B: `windowpolicy-ab.sh` + `windowpolicy-analyze.py` (stub `wp-ab1.sh`); inputs installed read-only with a sha256 manifest by `windowpolicy-install.sh`
|
||||
(`/data/leleka-e2e/window-policy/{tools,scripts,MANIFEST.sha256}`). Observation runs: `wp-obs-a/b/c` (bin-dr2), `wp-obs2` (bin-wp1, bar in the trace), capture run `wp-cap`.
|
||||
* Server paths created (all under `/data/leleka-e2e`): `window-policy/{tools,scripts,src,capture/corpus245,MANIFEST.sha256}`, `runs/window-policy-{obs,obs2,scan,cap,rp1,rp2,rp3c,id1,ab1}`, `decode/dt/{bin-wp1,rt-wp1,rt-wp2,rt-wp3}`, stubs `wp-*.sh` in `~/work/gpu-runs/holder2/jobs`. `runs/window-policy-rp1` is the killed replay with a single CPU worker (not the product shape; kept as evidence of that mistake);
|
||||
`runs/window-policy-scan` (fixed-window scan: spec 3 / 5 / 6 at floor 0.5, spec 4 / 5 at floor 0.3) overlaps other agents' cold-load I/O experiments and is indicative only.
|
||||
* Disturbances: between 19:05Z and 19:50Z on 2026-11-02 another agent's `bulk_read_bench` (32 O_DIRECT readers on the KAR file, load average 33) ran during my fixed-window scan (one turn at 22.7 ms/round); the server then lost its Wi-Fi link 21:35-22:46Z (not caused by these jobs). The A/B and the replays above ran after both.
|
||||
|
||||
Reference in New Issue
Block a user