Skip to content

lanes: a shared round prices drafts by their head steps, a batched head by the deepest stream's - #769

Merged
ashhart merged 4 commits into
ashhart:mainfrom
plotarmordev:perf/batched-heads-pricing
Oct 13, 2026
Merged

ashhart merged 4 commits into
ashhart:mainfrom
plotarmordev:perf/batched-heads-pricing

Conversation

@plotarmordev

Copy link
Copy Markdown
Contributor

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: HeadCost and allocateDrafts; allocate wraps 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); budgets prices 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_heads follows draft_streams, and each shared round reports its modeled head time.

Receipt

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
  • No precision traded for speed.
  • Prompt processing is no slower than the last release.
  • The description says which platforms I ran: CUDA GB10 only.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

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.
@ashhart
ashhart merged commit 0c28877 into ashhart:main Oct 13, 2026
2 checks passed
jschmied pushed a commit to jschmied/TensorFold that referenced this pull request Oct 13, 2026
@ashhart

ashhart commented Oct 13, 2026

Copy link
Copy Markdown
Owner

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 (73099a3df), on top of #768's commit, with the same code as your merge with 1.0.8's greedy and sampled overheads. Your head, which also holds #768's, is merged after it with no change to the tree (0c28877c5), so GitHub shows this PR as merged.

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:

  • Nemotron on Metal, whose head drafts one stream at a time, now pays a head step per draft in its shared rounds. Aggregate decode at 2, 4 and 8 streams came out within 3% of the base either way (+1.2%, -1.4% and +1.4% greedy; +2.7%, +2.7% and -1.8% sampled), with two servers of one build differing by up to 2.9%. So it's flat, as you measured on CUDA without batched heads. A lone stream was level (+0.3% greedy, +0.7% sampled over eight prompts). Drafted == plain 17/17 and the same token SHAs as the base.
  • The 27B, whose budgets carry no head steps, was within 1% in every cell, with the same replies.

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 draft_streams, haven't been measured under the new pricing; the 1.0.9 notes say so, and it stays an open check on our side.

BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
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.
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.

2 participants