Repository navigation
lanes: a shared round prices drafts by their head steps, a batched head by the deepest stream's - #769
Conversation
Each head level runs one forward with a row per stream still drafting (Head.chains), where each stream's head ran its levels one row at a time; a lone drafting stream keeps its captured levels. Drafts and confidences equal the one-at-a-time ones to the bit, greedy and sampled.
…hed head by the deepest stream's The overhead learned from each round held the head steps of the depths it ran, so it favoured those depths; it now keeps them apart, and allocation adds each draft's step (or the deepest stream's when one batch drafts every stream).
…nd sampled overheads 1.0.8 keeps a shared round's overhead apart for rounds with and without sampled streams; each list now keeps its fixed part and its head steps apart, and budgets price drafts on the list the round's streams take.
|
Thank you, @plotarmordev. Taking the head steps out of the learned overhead removes a bias toward whatever depths the overhead was measured at, and pricing a batched head by its deepest stream matches what #768 actually runs. It landed in 1.0.9 under your name ( Since the pricing lives in the shared lane core, we checked it on the Macs too, on an M3 Ultra, base and tip in a mirrored order:
On a GB10 the pricing only shows together with #768, #770 and #771: 4.4-5.5% more aggregate decode at 2 streams, 9.4-11.6% at 4 and 11.8-14.7% at 8 over the build without them, every reply equal to its solo run. Your test (overhead measured at depths 1 and 3 gives the same budgets) runs in the host suites. GLM-5.3-Flash and GLM-5.3, the other families that set |
The contributor's pricing commit landed above with the same code, on top of ashhart#768's; this keeps the PR's head, which also holds ashhart#768's, in the history with no change to the tree.
What this changes
On top of #768 (its commit comes first here; this pull request adds the last two). A shared round's draft budget prices each stream's drafts by the head steps they take, apart from the round's own overhead. A head that drafts every stream in one batch costs the deepest stream's steps. Until now the learned overhead also held the head steps of the depths it was measured at, so it favoured those depths.
core/lanes/allocate.zig:HeadCostandallocateDrafts;allocatewraps it with no head cost.core/lanes/depth.zig: each overhead list (1.0.8's sampled and greedy) keeps its fixed part and its head part apart (fixedMs,headMs);budgetsprices drafts on the fixed part plus their steps. A new test: a round's drafts come out the same whichever depths its overhead was measured at. It fails on the old pricing.core/lanes/engine.zig:batched_headsfollowsdraft_streams, and each shared round reports its modeled head time.Receipt
Environment: as Nemotron CUDA: a shared round's MTP heads draft every stream in one batch #768 (GB10, Nemotron 3.5 Lightning MLX-4bit,
--context 16384 --parallel 8, 400-token replies, distinct prompts), against Nemotron CUDA: a shared round's MTP heads draft every stream in one batch #768's build.Exactness: replies have the same
token_shaat every concurrency. Draft budgets only change speed.Speed, makespan, Nemotron CUDA: a shared round's MTP heads draft every stream in one batch #768 → this change:
At 4 streams the 1.0.7 sessions separated. The 1.0.8 medians moved the same way, but their ranges overlap. The gain comes from fewer drafts that miss (a 4-stream reply drafted 379 nodes against 389), not deeper chains.
Tests run:
zig build test617/622 (5 skipped);test-cuda-host25/25 steps; server tests 155/155 and 96/96; goldens 309/319 with 0 unexpected differences;zig fmt;lean_checkas on Nemotron CUDA: a shared round's MTP heads draft every stream in one batch #768.Not run, and why: GLM, the other
draft_streamsfamily, is not measured. There is no GLM CUDA on main, and its Metal pair needs Macs I don't have. Without batched heads (main as it is) the pricing measured flat on 1.0.7.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.