perf: pipeline the batched/de-lockstep prefill [A/B pending]#100
Open
leyten wants to merge 1 commit into
Open
Conversation
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
force-pushed
the
perf/batched-prefill-pipeline
branch
from
July 22, 2026 21:58
3dda502 to
2ec50e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_streamshelper 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.