Speed program: what keeping the recorded verifier graphs between requests needs (cost 83 ms/request, gain under 1 % e2e)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
53b1ed39bf
commit
7bee3eb157
@@ -309,3 +309,9 @@ Second attempt (`ab-l3h`, jobs `spd-l3c/d`): variant H = `LELEKA_ORIGINAL_SERVE_
|
||||
| 1,416 | 861 | 601 | 565 | 120 | 83 | 14 |
|
||||
|
||||
For a tail under about 1,500 tokens **72-80 % of the chunk is `moe.ring`**: the per-layer expert copy ring (48 layers, about 7.4 ms per layer even for 238 tokens, 355 ms in all). It barely grows with the tokens (238 -> 1,416 tokens: +210 ms), which is the fixed cost found in the product's profile lines (about 490 ms of read). GDN, QSA and the input stage together are under 120 ms. The prompt stream (`STRATA_PREFILL_STREAM_MIN`, 4096 rows) is off for these chunks. Whether the ring is bandwidth-bound (bytes of the non-resident routed experts at 36-47 GB/s) or latency-bound (48 synchronous per-layer round trips) is not known from the existing counters: `PREFILL-COPY` is only printed for streamed chunks. Code proposal (needs the orchestrator's word): see the report of 2026-11-08.
|
||||
|
||||
### Graph re-recording per request (`decode.assemble`, 2026-11-08): what it would take
|
||||
|
||||
Per request (product profile lines, 30 replayed requests): `decode.assemble` 98-109 ms, of which `assemble.record_all` 83 ms (capture 54-62, instantiate 27-30; nine graphs: windows T = 1..8 and the commit graph, about 6 ms capture + 3 ms instantiate each); `assemble.prepare` 12, `assemble.verifier_new` 2, `assemble.aggregates` 0.75. The decode phase uses every width up to 8 in a long request (`T_hist` of a 2,444-round request: 187/681/635/523/235/85/56/42 for T = 1..8), so recording only the widths used saves little.
|
||||
|
||||
Why the graphs are not kept: a recorded graph holds device pointers, and four things behind them are made per request in `AssembleInputs::assemble` (`original_serve_verifier.rs`): the canonical GDN image (`original_verify_canonical_gdn(states, histories)` allocates and seeds from the session's priors), the verifier bank and its GDN journal (`OriginalVerifier::new`, `bank().gdn_journal`), the per-width head/embedding row views and window resources, and the QSA journal that takes the twelve resident index and mapped K/V owners **by value** from the prompt executor (`take_qsa_owners`) and gives them back in `disassemble`. Keeping the verifier between requests therefore needs (1) a persistent, re-seedable canonical GDN image and bank (seed = upload, no allocation), (2) the QSA owners staying with the journal while the prompt path appends to the same buffers, (3) the `'a` borrows of `DecodeResources` (dense and MoE weight caches) to outlive a request, which is a self-referential shape in the present `OriginalServeStack`, and (4) invalidation when any pointer changes (prefix-cache switch, window-cap fallback, tier reconfigure). Expected gain at best -60..-80 ms per request of about 8,300 (under 1 % end to end); it is a cross-crate ownership change (`cuda-driver` verifier/bank and `engine-qwen35-cuda` stack), not a switch.
|
||||
|
||||
Reference in New Issue
Block a user