Repository navigation
lane host: concurrent identical prompts join a filling leader's whole fill - #3693
Conversation
5d500a5 to
9fc3509
Compare
|
Thanks @bikepresentball. Before we review this for landing, one thing in the commits themselves: they are authored and committed under a local machine address rather than an address GitHub links to your account. Merged commits keep their identity in our public history, so please re-author them with your GitHub noreply address (Settings, Emails, "Keep my email addresses private" shows it), for example We'll review the change itself as soon as that's done.
|
|
Thanks @bikepresentball. One thing before this can land: two of the four commits are authored as
We will pick it up again as soon as the new head is up.
|
2a15cbd to
be46dad
Compare
|
Done — all commits re-authored with the noreply address ([email protected]) and force-pushed. Same two commits, same content; head is now be46dad. |
|
I verified the two commits at The first test gap I found is that the description lists four single-flight cases, but I also added the described timeout case locally using the existing fixture, Igor Lessio - AIFLOW LABS |
|
Both gaps are closed at f69cd52 — the four cases in the description are now the four cases in the file. The leader-cancellation case cancels the leader (id 1) on its second prompt chunk via the prefill hook, against the same-shaped no-join run: the leader's reply is the cancellation in both, and each released waiter finishes whole, token for token the no-join run's reply. Counters pin the shape — 3 joins armed, 3 waits, 0 timeouts, and 0 joins in the no-join control. The bound case is your shape exactly — Focused run: 35/35 single-flight tests pass (
|
|
Thanks @bikepresentball for re-authoring the commits. Your re-authoring: the noreply authorship was our only ask, and that part looks done from your reply. We'll confirm it on the commit list when this lands. The change itself: this is our first review of it. It applies cleanly to today's main, and the design is small and well tested. Joined replies equal solo ones in all four host tests, and your GB10 receipts show four byte-identical replies from one fill. One thing to settle before it lands: joining when the leader's fill can't be kept.
|
|
Both halves of the keep question are settled at 55c6dfa: The join now arms only when the leader's fill will keep anything. The arm condition gains the store's own deterministic keep refusals: the join requires the leader to carry fitted marks ( Tests. The cold-cache case flipped to pin this: on a zero budget the join does not arm, the four prompts prefill beside each other ( One scope note: with keeps refused, the pre-existing cut wait (waiting for a mark the leader never keeps) still arms on main's terms — unchanged by this branch, so a too-large prompt behaves exactly as it does on
|
… fill A queued request whose prompt is exactly a filling prompt's — same cache key, same tokens, same spans, the leader's last mark serving it whole — now waits for that fill to end (TENSORFOLD_PREFIX_WAIT_MS still bounds it) instead of waiting for one cut and prefilling the rest beside the leader. Released only when every keep is published, its lookup resumes the leader's deepest kept state; a missed lookup, a failed or cancelled leader or the bound all fall open to prefilling independently. Waits for a shared cut are unchanged.
The join v1 armed only where a filling leader had a planned mark whose wouldServe would serve the waiter — nothing arms it on a cold cache, where no mark is planned and nothing kept (the GB10 receipt: 4x identical 126k cold prompts still prefilled independently). A queued request now joins a filling leader on prompt identity alone: same cache key, same tokens, same spans, no mark and no kept state consulted; waiters per leader are bounded by the admission cap, and every release path (fill done, leader gone, bound passed) still falls open to an independent prefill. The new test drives the identical fanout over a zero-budget store — no marks, nothing kept — and fails on v1 (joins 0 of 3) while passing here.
The description listed four single-flight cases; the file carried two. Adds the leader-cancellation and bound-passage fail-open cases AIFlowML asked for: a released waiter prefills its own prompt and its reply is token for token the no-join run's; the leader's cancellation releases without a timeout, the 1 ms bound against 30 ms chunks releases with one per joiner.
55c6dfa to
fd321ae
Compare
|
Thank you @bikepresentball. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
For #3397 and #3487: concurrent identical prompts join the filling leader's whole fill, on a cold cache and a warm one.
The change
waits()gains a whole-fill arm decided before any mark is consulted: a queued request whose prompt is a filling request's own, by identity alone (cache key, raw tokens and spans), waits for that leader's whole fill instead of prefilling beside it, on a cold cache as on a warm one. The join reuses the prefix wait's machinery — the sameWaitingrecord with awholeflag, the same bound (TENSORFOLD_PREFIX_WAIT_MS), the same release loop — and stays fail-open: the leader's finish, cancellation, failure or the bound passing releases every waiter to prefill on its own, with the number of whole-fill waiters held to the admission cap. The join arms only when the leader's fill will keep anything — its planned marks are the budget's fitted set, so a prompt the store cannot keep (state past the budget, no slots, memory pressure) leaves no join armed and the prompts run side by side, as without the wait. The prefix wait's counters gain ajoinscount of whole-fill joins.A joined reply is token for token a solo run's. The host tests pin that (see below), and the receipts below pin it on the device.
Host tests
lane_host_prefix_join_test.zig(fake backend), four tests:leader_open_most == 1: one identical prompt computes at a time).leader_open_most > 1), replies equal.leader_open_most > 1), replies equal.Full host suite: the branch's failing set equals clean main's on this box (one pre-existing
cli_config_testfixture failure, present onmainhere; every single-flight test passes).Receipts (GB10, Nemotron 3.5 Super-VL 120B NVFP4, greedy, temperature 0)
Identical 75,688-token prompts, four streams arriving together on a cold cache (fresh serve):
9d48014dd568521d9d48014dd568521d× 4TENSORFOLD_PREFIX_WAIT_MS=09d48014dd568521d× 4The joined arm's four first tokens land within 0.4 s of each other at the leader's single fill completing — one prompt's rows computed, four replies — and every arm's replies are byte-identical to the solo run's.