Repository navigation
[Draft] EXL3 Flash Next: drafts on by default for one user, guarded by measured tokens a ms (slice 6, #1419) - #51
Draft
BlivionIaG wants to merge 1 commit into
Draft
BlivionIaG wants to merge 1 commit into
BlivionIaG wants to merge 1 commit into
Conversation
…ed tokens a ms A drafted verify window on offloaded experts costs about 18 ms for its first extra row (the missed experts' PCIe copies), so drafts pay only where they land often. The lane engine's depth rule now keeps, per stream, the tokens a ms of rounds that launched the head's chain and of rounds that did not, runs plain where plain earns more, leaves plain only on a 20% win and probes a drafted round after a growing run of plain ones. The guard applies to offloaded EXL3 engines only; NVFP4 Flash Next and the other families keep their behaviour. Verify-window graphs capture on their 12th sighting (a decode round on its 2nd): a tensor-parallel capture is an instantiation of about 39 ms and most window keys were replayed zero or one time. The serve script drafts by default at PARALLEL=1 only: with two lanes a plain round in a drafting engine costs more than on a no-draft server. TF_FLASHNEXT_DRAFT_ENABLE=0 turns drafts off.
This branch has not been deployed
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.
Draft, slice 6 of the chain in ashhart#1419. Stacked on slice 5; review only the last commit.
What
For one user the serve script now loads the MTP head and drafts by default, and the lane engine's depth rule decides per stream whether a round is drafted:
plain_guardonly then).TF_FLASHNEXT_EXL3_GRAPH_DECODE_AFTERstill overrides both.tools/exl3_serve_tp2.shdrafts by default atPARALLEL=1only: with two lanes a plain round in a drafting engine costs more (about 41 ms for two streams against about 25 ms on a no-draft server), and two concurrent prose streams were 22% slower with drafts.TF_FLASHNEXT_DRAFT_ENABLE=0turns drafts off.Exactness
Drafted output equals
draft: falseoutput:bench_concurrent.py --alone --serialreports equal on every cell (one stream and two), and 24 prompts at temperature 0 are byte-identical to the no-draft run. Concurrent replies equal their solo runs.Measurements (2x RTX 5060 Ti sm_120, PCIe 4.0 x8, EPYC 7452, 251 GB RAM, driver 615.71, CUDA 13.4, Zig 0.17.0, TP=2, one user)
Both rows measured on the two slice trees (build, 294 host tests, kernel-contract tests pass on each); output hashes are identical between them (40 tokens
90e6c65ca5ba, Zig6dfc89b1abb6, docse6834625432c). Client: 192 tokens, temperature 0, second request. TTFT s / decode tok/s / mean ITL ms:Repo clients (
bench_openai.py256 tokens x3 greedy;bench_cache.pyexact token-ID prompts with--require-cold, prompt cache off), drafts on: decode 44.9 tok/s (code prompt) and 49.3 (prose); cold prefill TTFT 2,048 tokens 2.4 s, 8,192 tokens 5.6 s, 30,000 tokens 22.0 s; all repeated and concurrent replies equal the first reply's token hash. Peak process memory: 33.1 GB and 33.8 GB resident (22 GB pinned expert bank), 15.2 / 14.3 GB device used.Costs, stated plainly: drafts add about 5-6% to TTFT and lower prefill on long prompts (the head's prompt pass and 8 fewer expert lines); drafted streaming is bursty (Zig: about 17 tokens every 180 ms, p99 gap 300 ms against 62 ms plain); a 31k-token prompt gets no drafted decode gain; short prose is about equal to plain.
Tests run
zig build native,test-flashnext-exl3-host(294 pass),compile-cuda-tests,test-kernel-contractpass on sm_120; unit tests for the guard incore/lanes/depth.zig. Not run: other architectures, the FP64 references (this slice reorders no arithmetic),test-goldenon a Mac, Linux CI, HIP.Not done in this PR