Skip to content

perf: pipeline the batched/de-lockstep prefill [A/B pending]#100

Open
leyten wants to merge 1 commit into
masterfrom
perf/batched-prefill-pipeline
Open

perf: pipeline the batched/de-lockstep prefill [A/B pending]#100
leyten wants to merge 1 commit into
masterfrom
perf/batched-prefill-pipeline

Conversation

@leyten

@leyten leyten commented Jul 14, 2026

Copy link
Copy Markdown
Owner

DO NOT MERGE until the on-ring TTFT A/B is banked — the change is token-exact (proved on the fake ring) but the actual TTFT win is unmeasured; this is the default serving hot path, so it wants a real-ring depth=1-vs-8 measurement first.

The batch + de-lockstep-rows coordinators did a serial send→blocking-recv per (stream,chunk) — B×chunks sequential ring round-trips of pure TTFT — while solo already pipelined. Shared _prefill_streams helper both call now fires prefill_depth ops in flight and recvs FIFO. Token-identical (stage applies ops in send order → each stream chunk i still reads its own 0..i-1 KV); a depth=1-vs-8 invariance test over multi-chunk B=4 confirms byte-identical output.

Part of task #3 (batched-prefill pipelining). A/B pending the next batched ring session.

The batch + de-lockstep-rows coordinators ran a serial send -> blocking-recv per
(stream, chunk) — B*chunks sequential ring round-trips of pure TTFT — while the
solo path already pipelined. Extract the pipelining into a shared _prefill_streams
helper both call: fire prefill_depth verify(prefill) ops in flight across all
(stream, chunk) pairs, recv in FIFO order. Token-identical to serial because the
single-threaded stage applies ops in send order, so each stream's chunk i still
reads its own 0..i-1 KV before projecting — only the WAN wait is hidden. A
depth=1-vs-8 invariance test over multi-chunk B=4 streams confirms byte-identical
output; the batched/rows fake-ring suite stays green.
@leyten
leyten force-pushed the perf/batched-prefill-pipeline branch from 3dda502 to 2ec50e6 Compare July 22, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant