Repository navigation
llama --drafter: a probe stays armed until a round verifies its drafts - #2169
Conversation
|
Thanks @BobClawblaw, the diagnosis is right: the look-ahead ask took the probe, so the verify ask a round later came back plain, and a request that stood aside never measured its acceptance again. Moving the reset into |
|
Thanks @ashhart. Done in The new test, |
|
Thanks @BobClawblaw, that's the bound: one plain round for the look-ahead, then it disarms with its gap doubled, and |
|
Thanks @ashhart. The served A/B on Replies. All 72 replies are byte-identical per case across the three builds and three passes: one hash per case, greedy and seeded sampled alike.
In passes 1 and 2, main never stood the stream aside on The other seven cases are level: mean decode of the six sampled and greedy chat/story requests 14.73 on main with the drafter, 14.83 on this head, 12.38 without it; The description is updated to this head. |
|
Thanks @BobClawblaw for the A/B, and especially for making the script wait for an idle Mac: that's what makes pass 3 readable. All 72 replies match per case, the seven other cases are level, and |
e7e4db3 to
5ea28d3
Compare
A lone stream's lane core runs pipelined: each round it asks the proposer once to look ahead (is a copy ahead?) and, when one is, again to verify it with the context a token longer. The drafter counted a probe as made when it answered the look-ahead, so the verify ask was no longer a probe, returned nothing, and the stream went back to plain steps. Every probe paid for its drafter steps and none was verified: a request standing aside never measured its acceptance again. The stand-aside count and the probe's gap now change in round(), when a round verifies drafts. A test walks a probe through a plain round and a verified one.
… round The lane core can trim a priced proposer's drafts to nothing through the copy plan, so a probe armed until a round verifies would draft on every ask. The probe keeps the one plain round of the lone stream's look-ahead; if the round after that verifies nothing too, it disarms and its gap doubles, as on main.
5ea28d3 to
11995e8
Compare
|
Thank you @BobClawblaw. 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. |
|
Thanks @BobClawblaw! This is in TensorFold 1.2.3, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.3 |
What this changes
With
--drafter, allamarequest that stands aside (its drafts cost more than they land) probes the drafter after 64 plain rounds, then after twice as many each time, up to 1,024. On a lone stream those probes were never verified. The lane core asks the proposer once to look ahead and again to verify with the context a token longer, andRequest.proposereset the stand-aside count and doubled the gap when it answered the look-ahead. The verify ask was then no longer a probe and the round went plain, so every probe paid its drafter steps and a request that stood aside never measured its acceptance again.The probe now stays armed (
probing) until a round verifies its drafts, andround()resets the count and the gap there. It keeps the one plain round of the lone stream's look-ahead; if the round after that verifies nothing too (the lane core can trim a priced proposer's drafts to nothing through the copy plan), the probe disarms and its gap doubles, as a probe cost on main. Onlyzig/src/families/llama/drafter.zigchanges, plus two tests.a26fdae91)atc overlap --json: no overlap for this change. Coverage was incomplete (pullFilesUnavailable,timeLimit), so I checked the file lists of all open pull requests by hand: none toucheszig/src/families/llama/drafter.zigor its test.Checks on this head
e7e4db398(40c97348fplus the disarm after a second plain round)e7e4db398, M5 Ultra, macOS, Zig 0.17.0:zig fmt --check,zig build test,test-kernel-contractandtest-goldenexit 0; lean 425 on the base and on this head, 0 new.40c97348f: alsotest-server-security test-pull-security(24/24),fuzz-cortheon,check-release-pathsanddev-toolsexit 0.test-nativeon the base this was first checked on (b331731e6) passes except main's own crash in the Metal Qwen27 draft-sources test, fixed by native tests: the Qwen27 lanes' facts read a dense model's config (test-native crash) #2122.llama drafter: a probe stays armed until a round verifies its drafts, then its gap doubles, walks a probe through a plain round (still armed) and a verified one (gap doubled, count reset); it does not build without the change. The second,llama drafter: a probe whose drafts the lane core cuts disarms after one more plain round, its gap doubled, runs two plain rounds after arming and expects!probing, the stand-aside count reset and the gap doubled.Served: bf16 Nanbeige4.3-33B with Nanbeige4.1-3B drafting
On this head (
e7e4db398)One stream (
--parallel 1, 16,384-token window), a fresh server per run, the eight requests below, 3 passes of main (a26fdae91) with--drafter, this head with--drafterand main without it, with no other GPU work during any pass.All 72 replies are byte-identical per case across the three builds and passes.
chat2, decode tokens a second (drafter rounds, accepted/offered drafts):Main stood
chat2aside only in pass 3, and stayed at plain speed; this head came back to drafting. The other seven cases are level: the six chat and story requests average 14.73 on main with the drafter, 14.83 on this head and 12.38 without it;copyruns 85.2-86.9 with the drafter on both.Earlier, on
40c97348fOne stream (
--parallel 1, 16,384-token window), fresh server each time, eight requests in order: greedy chat, story and copy, four seeded sampled chats and stories at 0.7, then the greedy chat again (chat2). Main (b331731e6) with--drafteragainst this change with--drafter, and main without it.Replies. Every reply is byte-identical across main with the drafter, this change with the drafter and main without it, in every pass (8 cases, 3 passes, and 3 more passes in an earlier run).
The case this fixes is
chat2: the sampled requests before it can stand the stream aside, and on main it then stays at the plain speed. Tokens a second, decode:chat2The other seven cases are level within noise in both runs.
The latest run is noise, not signal. The Mac was shared while I measured: plain decode, normally about 13.5 tokens/s, ran at 6-10 in the last three passes, and in those passes main did not stand aside on
chat2either (rounds and accepted drafts: main 226 and 153/283, 235 and 144/275, 219 and 160/305; this change 226 and 153/286, 222 and 157/311, 225 and 154/286). So those passes show no regression, with the same replies and the same drafting where both draft, but not the fix itself. The speeds above come from the passes where plain decode ran near its normal rate.Receipt
n/a: the change is in the drafter's stand-aside bookkeeping; no kernel or served bit changes.
Checklist