From 65074758c96bc42c714795bc3cecade013ff4b22 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Sat, 24 Oct 2026 02:03:29 +0200 Subject: [PATCH] docs: decode parity round 2 --- docs/decode-parity.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/decode-parity.md b/docs/decode-parity.md index 20e3d5e5..e855c595 100644 --- a/docs/decode-parity.md +++ b/docs/decode-parity.md @@ -83,3 +83,32 @@ Prompt phase of the port: prefill read 550 ms + lent-slot refill 44 ms (+ 63 ms * Draft + commit 1 ms/round above the Original (GPU-bound MTP step graph). * Per-request verifier assembly + teardown (about 75 ms): needs a verifier that persists across requests. * VRAM reserve: the auto-sized cache holds 1151 fewer slots than the Original's. + +# Round 2 (auto-sized cache, contention, controller, draft, assembly) + +Reference (fixed, recorded): Original shipped 68.8 / 84.0, tuned (pcie 0.35) 72.8 / 89.1, auto-sized cache 94.4 / 129.1 tok/s +(pass 0 / pass 1; no Original run was repeated). Since round 1 the integrated head added the prompt-routing seed and +prefix/memory work: the port's own previous head at the auto-sized cache moved from 84.3 / 110.1 to 104.4 / 122.4. + +* **VRAM (jobs 987/988/989, free-VRAM notes, `LELEKA_SERVE_PROFILE=1`):** 32 110 MiB visible; embedding 324, native head 506, dense + 4 640, MoE prompt arena 942, prompt executor + MTP drafter 920-1 068, expert cache, then the per-request verifier assembly takes only + ~450 MiB (also at 180k tokens, capacity 8192). The decode reserve of 1024 MiB left ~550 MiB idle. Default is now 300 MiB: + 8820 -> 9144 slots (+324; 9104 with 450 MiB in the 180k smoke, prefill 3873 -> 3913 tok/s, free after assembly 701 MiB). The + Original's 9971 slots are not reached: the remaining ~800 slots are the port's larger resident set (MoE prompt arena, drafter + buffers, KV window); not shrunk. +* **PCIe stage under contention (job 987-b, microbenchmark, 15 CPU streaming workers):** PCIe drops from 48 to 31.5-34.5 GB/s + while the CPU gets 42 GB/s (one DRAM ceiling); contiguous blobs vs three tensors, 4 KiB vs THP, and kernel vs DMA differ by <= 3 % + (DMA best). The in-window PCIe stage is therefore bounded by the host memory system, not by the port's layout or kernel. + The optimal share is P/(P+C) = 0.45 (schedule agent, job 909): default now 0.45 (auto cache, 3 interleaved repetitions: + 128.2 vs 122.4 tok/s pass 1, +4.7 %; pass 0 104.9 vs 104.4; equal at 2048 slots). +* **Controller `LELEKA_PCIE_AUTO=lag`** (flag-B wait after the CPU leg): no gain (104.2 / 121.5 vs 104.4 / 122.4); the old hill + climber (`=on`) is also no better than the fixed 0.45. Both stay off. +* **Draft + commit (2.2 vs 1.2 ms/round):** the chain-step graph has 113 nodes (round graph 155-186) and is GPU-bound at 0.68 ms + (events). The ledger agent attributes ~0.4-0.5 ms/round to the smokes and the daemon not binding the MTP draft-vocabulary subset + (`--mtp-rt-dir`, 106 299 rows instead of the 248 320-row head): jobs 991/992 carry the arm `R` + (`LELEKA_ORIGINAL_SERVE_RT_DIR`). +* **Verifier persistence: not done.** The prompt executor's QSA layers own the index/KV objects the verifier journal also wraps + (`take_qsa_owners` / `adopt_qsa_owners`, session lineage witnesses, `prepare<'index>` borrows); keeping graphs across requests + needs the executor to use the owners through the journal. Assembly (63 ms) + teardown (10 ms) stay: 7-9 % of a pass-1 + request at the auto-sized cache (serve-only 134 vs phase 123 tok/s). +* **Not helpful:** opened-expert cache (`LELEKA_OPEN_CACHE=on`, no change), `min_p` 0.3 / 0.7 (both below 0.5), KV window 4096.