Repository navigation
EXL3 Flash Next: draft lane guard for offloaded experts (8/8) - #1446
BlivionIaG wants to merge 332 commits into
Conversation
33c275f to
528c13a
Compare
|
Thank you; these are the most complete receipts in the stack, and drafted equal to plain on 24 prompts, along with
Please put the new rule behind its own field in the lanes config, set only by the EXL3 backend, and leave Two smaller points:
|
9ed3d01 to
421fc2f
Compare
81b93a0 to
8c8c5aa
Compare
7e97681 to
8a68caf
Compare
65f4e71 to
a4dd9f9
Compare
|
Exact-head supplemental performance data on
The 80-line drafted server failed twice with At c=8, 16,384/1,024 and the normal reserve, 10 lines/rank plus 2,048-row prefill chunks admitted all eight streams; 8 distinct outputs overlapped and matched solo full hashes in each of plain/drafted prose/code. One group per case: median per-request decode 3.63/4.25 tok/s prose and 3.56/4.21 code; aggregate end-to-end output 19.70/20.91 and 19.36/21.02 tok/s, respectively. This is not aggregate decode-only throughput; per-request plain used |
|
Additional offline diagnostic only, not an exact-head qualification or golden replacement: I compared the 16 previously captured native PLE embedding rows and the arithmetic-adapted Python diagnostic against an independent FP64 dot product of those identical captured FP16 inputs and the checkpoint’s actual F16 key/value weights. BF16 comparison rounds the FP64 sum via FP32. The captured embeddings matched the adapted diagnostic byte for byte. For the key projection, native differed from the FP64-rounded value in 99/163,840 BF16 words and the adapted Python diagnostic in 253/163,840; native was closer to the FP64 sum at 179 positions and the adapted diagnostic at 18, with equal error at the rest. For the value projection the counts were 14/40,960 and 19/40,960; native was closer at 8 and the adapted diagnostic at 2. This uses the older native capture and a modified, non-independent Python execution path. It does not test full logits, identify the correct |
|
Exact-head TP1 four-stream diagnostic on
All four cells passed |
|
Paired-spread assessment of the existing exact-head TP2 ABBA (
For each of these cells, even the faster draft arm is below the slower plain arm. The two observations per mode show separation in this run, not a confidence interval or a general statistical no-regression proof. Earlier summary ratios were computed from rounded cell rates; these use |
|
Additional offline localization using the older native capture and the arithmetic-adapted, non-independent Python serial diagnostic: among the first 16 prompt rows, all 36 differing BF16 PLE-gated elements occur at one of the 10 value-projection coordinates where the two executions differ; every differing value coordinate has at least one differing gated stream, and no gated element differs at any other value coordinate. This is an observed bit-coordinate correlation, not an intervention, proof that key differences are irrelevant, an exact-head run, or evidence for replacing the stored golden. The raw captures and the correlation receipt are retained. |
|
I checked those ten value coordinates against a second, coordinate-level CPU oracle: the captured FP16 embedding, the actual checkpoint F16 projection rows, and This ties the earlier value-projection FP64 counts to the 36 observed gated differences, but it remains an older capture, not a full-model or exact-head comparison. It does not determine the correct |
|
Completing the paired-spread assessment for the existing exact-head TP1 ABBA (
Seven of nine losing cells have non-overlapping observed two-arm ranges. These are two observations per mode, not confidence intervals or a statistical guarantee. The sampled four-stream blocker remains red; no hardware rerun or fix is implied. |
|
Thanks @BlivionIaG for the paired-spread tables at TP1 and TP2, and for the FP64 checks on the ten value coordinates. We owe you an answer from 16 Nov, so here it is. The Coordination. You don't need to stop this stack for the coordination check. We track the stack order on our side, and this PR lands last in the stack. What still blocks it. Your TP1 table shows nine cells where drafted is slower than plain, and seven of them have no overlap with plain. These are code as well as chat, greedy as well as sampled, so the guard needs to cover more than sampled chat. The bar is drafted no slower than plain in every cell, within the paired spread. TTFT counts too. Next steps:
There's no need to merge main yet. The branch conflicts with main now, and we will sort out the merge order when the slices below it land.
|
|
I tested a local, uncommitted candidate on Two RTX 5060 Ti 16 GB, 32 expert-cache lines per rank, graphs off, fresh-server draft/plain/plain/draft ABBA, 128 output tokens, one/two/four clients, greedy and seeded, code and chat. On each of TP1 and TP2, all 12 cells had matching complete output hashes across arms and passed the alone/serial checks. The rate comparison uses the mean of the two draft observations against the slower of the two plain observations; TTFT applies the analogous comparison to both mean and worst per-request TTFT. Two observations are an observed spread, not a confidence interval.
Four-client chat, aggregate decode: TP1 greedy draft 56.76–56.78 vs plain 58.50–58.52 tok/s; TP1 sampled draft 20.95 vs plain 23.49 tok/s; TP2 sampled draft 44.78–44.83 vs plain 47.25 tok/s. Mean client TTFT for those cells was respectively 1.765–1.767 vs 1.691 s, 1.753–1.755 vs 1.702 s, and 0.832–0.833 vs 0.762–0.763 s. TTFT includes client/network and admission effects; it does not isolate the cause. These losses fail the requested gate despite token equality. The local lane suite passed 379 tests, one skipped; after the final shared-window change the focused greedy/seeded shared-price test passed. CUDA binary SHA-256 |
|
Restore follow-up on the same local, uncommitted shared-pricing candidate ( The panic happens on both TP1 and TP2. A standalone Linux x86-64 Zig 0.17.0 |
|
Follow-up: with the bounded scratch-row calculation in the same local #1446 shared-pricing candidate, both TP1 and TP2 drafted restore gates completed on the 10,240-token prompt fixture. Binary SHA-256 For each rank count, plain and drafted cache-enabled cold/warm/branch/rewind outputs matched their cache-disabled plain and drafted references, with full SHA-256 hashes, for both request lanes. Warm, branch and rewind restored 10,305–10,315 tokens. In the cold phase one request could reuse the other request's shared prefix; this is not evidence that two cold lanes ran independently. The requests may queue; this is a restore correctness gate, not a simultaneous-throughput test. The arithmetic fix is committed locally on #1445 as |
|
I tested and reverted a local, uncommitted diagnostic that kept the count/mode-specific shared pricing but accelerated its first two unpriced warm/calibration trials from 64-round spacing to 8. The hypothesis was that short four-stream requests could finish before a second calibration; I did not have device instrumentation proving whether ordinary all-plain rounds had already supplied a price. TP1, 32 expert lines, four-stream 128-token draft/plain/plain/draft, greedy and sampled code/chat, one observation per arm: all full token hashes and The earlier 64-round local shared-pricing candidate remains uncommitted and also fails its reported TP1/TP2 decode and TTFT gates. Neither experiment changes the PR head or resolves qualification. |
|
Correction to my preceding local eight-round diagnostic: it did not test working early calibration on Flash Next CUDA. I tested a new local, uncommitted candidate which learns a full round price when no static table exists and uses that measured price in allocation. For an empty-table guarded backend it warms/calibrates at eight-round spacing; static-table paths keep the existing schedule. ReleaseSafe host lane suite: 379 passed, one skipped; the expanded greedy/sampled behavioral test exercises measured slow/fast draft choices both with and without a static table. TP1, 32 expert lines, four streams, 128 outputs, fresh-server draft/plain/plain/draft, greedy and seeded code/chat: full token hashes match across arms and The candidate is not a fix or qualification and is not pushed. The eight-round startup cadence remains experimental; TP2 and restore were not repeated after this change. Binary SHA-256 |
|
Further diagnosis of the uncommitted online-pricing candidate: a trace-only logging build showed four-stream sampled rounds repeatedly assigning zero draft budgets while each stream retained exactly the same prior head-chance values. I have a local candidate that uses the existing rate-guard backoff to occasionally refresh a zero-grant head, bounded by the shared row budget and only for the offload rate guard. A new greedy and seeded behavior test changes head chances after a sustained plain interval, requires useful drafting to resume, and compares final tokens with the plain oracle. It passed on the candidate and failed with |
|
The local online-pricing + bounded zero-grant probe candidate completed a TP1 four-stream draft/plain/plain/draft diagnostic, 32 expert lines, 128 outputs, greedy/seeded chat/code. All full output hashes match both across arms and the preceding unprobed candidate; alone/serial checks pass.
Three decode cells remain below the observed plain range, and mean and worst TTFT remain outside it in all four. Two observations per mode are not confidence intervals. The separately run unprobed candidate scored 22.92 sampled chat and 25.38 sampled code; these were not interleaved with the probe run, so the difference is not an isolated causal comparison. No fixed-percentage waiver is applied. Binary SHA-256 |
|
Diagnostic follow-up on the uncommitted online-pricing + bounded-probe candidate, not a PR-head fix. To test the host-allocation lead already reported on #1442, I used a disposable source overlay: the draft host buffer starts at the top-k/draft-vocabulary size and grows on the full-vocabulary verify path. I have not changed or pushed the shared MTP production files your team owns. TP1, 32 lines, four streams, 128 outputs, fresh-server draft/plain/plain/draft, greedy/seeded chat/code: full token hashes and Compared only as non-interleaved context, the earlier candidate had draft-minus-plain mean TTFT gaps of approximately 39.7/34.1/27.4/31.6 ms; this diagnostic had 14.9/9.5/4.4/6.3 ms for those same cells. This is not a controlled isolated effect. The directly marked full allocation on #1442 took 8.625 ms median per lane. The overlay is not qualified: sampled full-row fallback, masks/grammar, failure cleanup, TP2, graph, paging and restore still need coverage, and performance still fails. A targeted full-row fallback check is running. Binary SHA-256 |
|
Scratch diagnostic follow-up: with |
|
The greedy four-stream trace on the local candidate showed the unpriced bucket granting depth 8 to all four streams in its initial rounds (first-node chance about 0.287); its first and second all-plain calibration trials were on rounds 8 and 16. This suggested measuring the plain cost earlier, not a proven cause by itself. I tested a local, uncommitted variant that starts the two unpriced warm/measurement trials as soon as the shared round is eligible. Static-table cadence is unchanged. It also contains the separate lazy-host MTP scratch diagnostic overlay, so this is not a guard-only result and does not qualify the PR head. TP1, 32 lines, four streams, 128 outputs, one fresh-server draft/plain/plain/draft sequence; full hashes and
All four decode cells clear the observed plain spread in this sequence, but mean and worst TTFT remain outside the plain spread in all four. Two observations per mode are not confidence intervals. The earlier eight-round candidate was measured in a separate non-interleaved sequence and cannot establish an isolated improvement. Full ReleaseSafe lane suite after removing cadence-specific assertions: 380 passed, one skipped; pricing behavior and greedy/sampled token-equality assertions remain. Binary SHA-256 |
|
Guard-only follow-up: I rebuilt the immediate-calibration candidate without the lazy-host MTP diagnostic overlay. TP1, 32 cache lines, four streams, 128 output tokens, fresh-server draft/plain/plain/draft; all full token hashes and
All four decode means are above the observed plain range in this sequence, but mean and worst TTFT still fall outside it in every cell. Draft-minus-plain mean TTFT gaps are approximately 37.5, 37.8, 29.7 and 31.5 ms in table order. Two observations per mode are not confidence intervals. The earlier eight-round candidate was not interleaved with this run, so it is not an isolated A/B attribution. The guard source is local and uncommitted; binary SHA-256 |
|
The same uncommitted immediate-pricing guard candidate, without the lazy-host overlay, also ran TP2 with 32 lines per rank, four streams and 128 outputs: one fresh-server draft/plain/plain/draft sequence. Full token hashes match across every arm and
Three decode cells are below the observed plain range, and mean/worst TTFT fail in all four. Two observations per mode are not a confidence interval. The local candidate is not a fix or qualification, notwithstanding its better TP1 diagnostic. Other widths and final TP1/TP2 restore after guard changes remain open. Binary SHA-256 |
|
TP2 trace-only follow-up on the uncommitted immediate-pricing candidate, same four-stream greedy workload and token hashes as the uninstrumented candidate. The code cell completed in 127 rounds per stream with 0 accepted of 1 proposed draft; the later chat cell completed in 127 rounds per stream with 0 proposed. This is execution/decision tracing, not timing evidence. A source-level lead for the remaining drafted-vs-plain gap: for an It is not safe simply to clear |
|
Thank you @BlivionIaG for the TP2 sequence and the trace detail. We read both as evidence about where the gap sits, not as a qualification: TP1 and TP2 mean and worst TTFT still miss the gates, and the guard is still uncommitted. Your source observation about hidden rows in a mostly zero-grant shared round is noted. It needs a change that coordinates the next draft budget with row availability and proves recovery and token equality; that is not a one-line clear of hidden. What remains is a committed guard plus exact-head TP1 and TP2 performance and restore results with the strict golden unchanged. We are unable to run your RTX 5060 Ti setup here; please post those runs with token hashes matching the plain references and TTFT and decode inside the gates.
|
|
I tested, then removed from the working tree, a hidden-row/budget-coordination experiment: after a zero-priced shared head it omitted eligible one-row hidden output until a bounded probe and forced the corresponding next draft budget to zero. The candidate was local TP2, four streams, 128 outputs, draft/plain/plain/draft, greedy/sampled chat and code: all full token hashes and The shared-pricing guard itself is committed locally, but this hidden-row experiment is not fit to land; the strict TP1/TP2 decode and mean/worst TTFT gates and exact integrated-head restore remain open. |
|
Follow-up hidden-row experiment: to avoid intentionally splitting a shared batch into hidden and plain paths, the candidate omitted hidden rows only when all windows were eligible, capped all next draft budgets at zero, and retained bounded recovery probes. Local TP2 four-stream draft/plain/plain/draft at 128 outputs: full hashes and The grouped experiment was removed from the working tree; it is not fit to land. Integrated-head TP1/TP2 performance and restore remain open. |
|
TP2 diagnostic measurement of the previously reported lazy host-scratch overlay, not a production shared-MTP change:
Sampled chat decode and all four mean/worst TTFT cells failed paired-plain-spread gates. Two observations per mode are not confidence intervals; this is draft versus plain within the diagnostic binary, not an interleaved causal comparison with a non-lazy build. Overlay source, full hashes, per-request data and logs retained. Masks/grammar, allocation failure, TP2 whole-score fallback, paging, graph and restore are not qualified; shared MTP remains maintainer-owned. This is not an integrated-head qualification. |
|
Pre-integration TP1 and TP2 drafted restore diagnostics for the locally committed guard: the runtime core-lane source hashes match local commit For each TP width: graph off, 32 expert lines/rank, tier off, 8 GiB host prompt cache, two distinct 10079-token prompts, greedy drafted 32 outputs, cold/warm/branch/rewind. Both initial cached-server lanes and every cache-disabled reference request reported 0 cached tokens; warm/rewind reused 10074 and branches 10064. All eight full token hashes per TP width matched their same-build cacheless drafted references and the separately run public-head cacheless plain references; the TP1/TP2 hashes matched each other. Each cached-server request logged nonzero proposals and acceptances. All clients exited 0; source/binary hashes, raw JSON and rank logs retained. This does not clear the strict golden, all sampling/restore cases, TP1/TP2 performance gates, or the required integrated head. The guard remains local and is not represented as a qualified PR update. |
|
Additional local diagnostic, not the public or integrated head: TP2 four submitted independent-prefix sampled requests, local guard All 16/16 full token SHA-256 hashes for cold/warm/branch/rewind matched the same-build cache-disabled drafted references. Independently cold lanes cached 0; warm/rewind restored 10,074 tokens each, branch 10,064. All 16 also matched the earlier public |
|
Coordination request: the local shared-pricing guard and two hidden-row/budget experiments did not meet the TP1/TP2 TTFT and decode gates, so I have not pushed them as qualified. The isolated lazy-host-scratch overlay also left all TP2 TTFT cells outside the gate. The remaining first-token cost includes draft admission/head prefill before first emission; moving that work crosses the shared MTP lifecycle and prompt-cache ownership boundary. Can you take or designate the shared-MTP first-token change in the landing stack, or identify an approved branch/interface for me to work against? I can rerun exact-head TP1/TP2 equality, restore and paired performance on the 5060 Ti box once that and the integrated stack are available. Strict |
|
On M5 Max with Zig 0.17.0, public head The trial merge against Igor Lessio - AIFLOW LABS |
Summary
Rate-aware drafting for offloaded EXL3 Flash Next. This PR preserves the family-local guard, balances shared draft depths, excludes transition samples, flushes at
draftMany, and protects requested prompt-cache capacity during pool sizing. No kernel files change.a626b7cd3b0fbb4b20d9dd7d54a0a6d90219e79f, based on EXL3 Flash Next: CUDA graphs and the device planner (7/8) #1445955760d960. It does not include the later EXL3 Flash Next: KV pages from the core pool (4/8) #1444 and EXL3 Flash Next: CUDA graphs and the device planner (7/8) #1445 fixes; the maintainer owns integration and restacking.Public-head evidence
Two RTX 5060 Ti 16 GiB GPUs, CUDA 13.4.92, Zig 0.17.0;
turboderp/Qwen3.8-Flash-Next-exl3revision69e33439ae950f17bcbe95c98f117d80f759ab6d.flashnext-dense-hcandflashnext-hcFP64 operator checks passed; these are not independent full-model golden tests.Local diagnostics, not public-head qualification
Local guard commit
c4f012b71e13229a19ca6cd478c747dc01cd52e2adds independent shared-round pricing and bounded zero-grant recovery. Its performance binary also included the bounded-scratch patch outside that commit. TP1 four-stream decode met the observed paired-spread checks, but all four TTFT cells failed; TP2 missed three decode and all four TTFT cells. Full token hashes and alone/serial checks passed. TP1, TP2. Separate TP1/TP2 drafted restore diagnostics matched cacheless references, but are not the exact commit alone or integrated head. Restore.TP2 four submitted sampled requests also matched all 16 full cold/warm/branch/rewind token hashes against same-build cacheless drafted references, with real prefix restores and positive accepted drafts. Four submissions do not establish overlap or performance. Receipt.
Two hidden-row/budget-coordination experiments were removed after failing TP2 performance gates; their evidence is retained. Per-stream, grouped. A lazy host-scratch overlay is a diagnostic copy, not a production shared-MTP change; its TP2 sampled-chat decode and all TTFT cells failed. Diagnostic.
Open
ids16differs from the stored reference at TP1 and TP2, identically with and without drafts; the other two prompts match. The maintainer owns the reference question on EXL3 Flash Next on CUDA: one rank, offloaded experts, sm_120 gate (1/8) #1441. The golden remains unchanged.Earlier independent model-fidelity testing found 70/72 top-token matches. An older arithmetic-adapted diagnostic first diverged at layer-1 PLE, but does not establish the correct full-model continuation or justify replacing the golden. Scope. No checkpoint weights are distributed; the checkpoint uses Qwen Community License 1.0.