diff --git a/docs/prefill-throughput.md b/docs/prefill-throughput.md index c5909c9f..79e9b47e 100644 --- a/docs/prefill-throughput.md +++ b/docs/prefill-throughput.md @@ -346,3 +346,23 @@ gather reads the exact pieces there (`LELEKA_PREFILL_ALIGNED_COPY=0` turns both deferred guard status (`LELEKA_PREFILL_DEFER_GUARDS=1`, experimental, default off; +1.6% in its A/B) is merged. Open: runs of consecutive experts per role in one copy / `cuMemcpyBatchAsync` (50-51 GB/s in the roofline probes), the ~1,100 remaining blocking small copies per chunk, QSA indexer growth with position. + +### Aligned copies in the stream, deferred guards (jobs 970-973, 975) + +- Bit gate (job 970, `LELEKA_TRACE_PREFILL_R=1`, which slows every chunk ~0.3 s: the tok/s of that job are not + comparable): the final residual R hash of every chunk is identical between ring and stream and between aligned and + literal copies (8000 tokens `11c898a92de08a9b`; 16000 tokens `7ea88178bf76c5a1` / `8a27594e2b566315`, 12 runs each), + greedy ids equal. Aligned copies in the stream: DMA 34.9 -> 44.6 GB/s per entry, stream window 1,603 -> 1,457 ms, + +8% tok/s over the literal-layout stream. +- Deferred guard status (job 971, ABBA in separate processes, 16,000 tokens, with the hash trace): 4,349-4,363 -> + 4,553-4,571 tok/s (+4.8%), hashes and ids identical; on by default, `LELEKA_PREFILL_DEFER_GUARDS=0` restores the + immediate guards. +- Clean timings without hashing, stream + aligned copies, deferred guards still off (job 972, tier on, chunk 8192): + 8,000 tokens 4,953-4,987 tok/s vs 4,088 for the (aligned) ring; 16,000 tokens 5,123-5,138 vs 4,215-4,216. +- 180,000 tokens, tier on (job 973): stream 37.8 / 36.8 s (4,756 / 4,895 tok/s) vs ring 45.3 s (3,977 tok/s); the + recorded Original needs 39.4 s. Per chunk at position 8k / 82k / 164k: stream 1,535 / 1,615 / 1,752 ms (gdn 460, qsa + 248 / 374 / 509, moe.ring 434 / 452 / 453, inject 84) vs ring 1,843 / 2,057 / 2,208. +- Where the host blocks at depth 2 (`PREFILL-COPY ... blocking:`): alloc 83 calls / 9 ms, h2d 239 / 12 ms, d2h 761 / + 57 ms, memset 523 / 2 ms, drains 1,536 / 12 ms, stream/event syncs 668 / 860 ms (the real waits for the GPU's + work). Removing all remaining small copies is therefore worth at most ~90 ms of a ~1.55 s chunk; what is left of + the chunk is stage compute (gdn 460, qsa 250 growing with position, ring 434 for ~330 of kernel work).