Skip to content

EXL3 Flash Next: draft lane guard for offloaded experts (8/8) - #1446

Open
BlivionIaG wants to merge 332 commits into
ashhart:mainfrom
BlivionIaG:pr/exl3-s6-draft-guard
Open

BlivionIaG wants to merge 332 commits into
ashhart:mainfrom
BlivionIaG:pr/exl3-s6-draft-guard

Conversation

@BlivionIaG

@BlivionIaG BlivionIaG commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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.

Public-head evidence

Two RTX 5060 Ti 16 GiB GPUs, CUDA 13.4.92, Zig 0.17.0; turboderp/Qwen3.8-Flash-Next-exl3 revision 69e33439ae950f17bcbe95c98f117d80f759ab6d.

  • TP1 draft/plain/plain/draft ABBA: code/chat, greedy/seeded, one/two/four streams matched full hashes and passed alone/serial. Sampled four-stream chat was 0.9193× plain, so the performance gate failed. Receipt, paired spread.
  • TP2 ABBA: all 12 cells matched hashes and passed equality; draft/plain aggregate ratios ranged from 0.9513 to 1.5541. Four losing chat cells were outside the observed plain spread. Two observations are not confidence intervals. Receipt, paired spread.
  • TP2 unpaged restore: cache-on plain and drafted cold/warm/branch/rewind hashes matched cache-off references at 10,320 rendered prompt tokens. Receipt.
  • Exact-head synthetic flashnext-dense-hc and flashnext-hc FP64 operator checks passed; these are not independent full-model golden tests.

Local diagnostics, not public-head qualification

Local guard commit c4f012b71e13229a19ca6cd478c747dc01cd52e2 adds 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

  1. Strict golden: ids16 differs 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.
  2. Performance and restore: finish a guard using main's shared-round pricing, then qualify exact-head TP1/TP2 drafted restore and draft/plain ABBA. Every requested decode and mean/worst TTFT cell must be no slower than plain within the paired spread. The local commit and diagnostic overlays are not qualified PR updates.
  3. Integration: repeat after the maintainer's restack; active-request graph peer loss and CI belong to the integrated chain.

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.

@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s6-draft-guard branch 3 times, most recently from 33c275f to 528c13a Compare October 27, 2026 10:51
@ashhart

ashhart commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Thank you; these are the most complete receipts in the stack, and drafted equal to plain on 24 prompts, along with
bench_concurrent --alone --serial reporting equal, is what we look for. The guard reaches further than the
description says, though:

  • plain_wait_most changes from 128 to 64 for every family (core/lanes/depth.zig:14).
  • preferPlain (depth.zig:246-247) runs for any engine with plain_guard and node probabilities. That includes
    Qwen3.5's CUDA DFlash block-16 trees (qwen3_5/cuda_draft.zig:386,401).
  • GLM-DSA, XPU, Qwen3.5 MTP and HIP already set plain_guard.

Please put the new rule behind its own field in the lanes config, set only by the EXL3 backend, and leave
plain_wait_most at 128.

Two smaller points:

  • tools/exl3_serve_tp2.sh:11 serves --no-drafts at the default PARALLEL=2. We treat turning drafts off at a
    given stream count as a bug to fix, not a limit to document. Please draft at every width, and say what two streams
    measure.
  • TF_FLASHNEXT_DRAFT_ENABLE=0 (exl3/model/cuda_exl3_pass.zig:120-124) can go, since --no-drafts already covers
    that choice.

@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s6-draft-guard branch 2 times, most recently from 9ed3d01 to 421fc2f Compare October 27, 2026 14:46
@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s6-draft-guard branch 2 times, most recently from 81b93a0 to 8c8c5aa Compare October 27, 2026 17:56
@BlivionIaG BlivionIaG changed the title EXL3 Flash Next: draft lane guard for offloaded experts (6/7) EXL3 Flash Next: draft lane guard for offloaded experts (8/8) Oct 27, 2026
@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s6-draft-guard branch 2 times, most recently from 7e97681 to 8a68caf Compare October 27, 2026 21:54
@BlivionIaG
BlivionIaG force-pushed the pr/exl3-s6-draft-guard branch 15 times, most recently from 65f4e71 to a4dd9f9 Compare October 29, 2026 10:36
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Exact-head supplemental performance data on a626b7cd3b0fbb4b20d9dd7d54a0a6d90219e79f: TP2 on two RTX 5060 Ti 16 GiB GPUs, checkpoint revision 69e33439ae950f17bcbe95c98f117d80f759ab6d, graph off, default reserve, greedy, 16,384 input / 1,024 output tokens. One synthetic prose prompt and one synthetic code prompt; two fresh-server observations per c=1 cell, mirrored cache-size order. Every successful full output token hash matched across settings and plain/drafted modes.

Lines/rank Prose plain / drafted decode tok/s Code plain / drafted decode tok/s
32 28.6 / 29.3 27.8 / 28.4
48 31.5 / 33.7 30.7 / 31.5
64 34.0 / 36.2 33.2 / 35.4
80 35.9 / startup refused 35.1 / startup refused

The 80-line drafted server failed twice with InsufficientStartupMemory. At 64 lines, testing the existing TF_FLASHNEXT_EXL3_PREFILL_ROWS=8192 control gave 1,178–1,180 prefill tok/s vs 1,079–1,081 at the default 4,096 rows (two observations each, same full hashes); this requires approximately 1.67 GiB/rank for deep-prefill buffers and is not a general 2× result. TF_FLASHNEXT_EXL3_PREFILL_TWO_CHUNK=1 crashed both ranks before output on two attempts; trace and unverified state-initialization hypothesis reported at #1443 (comment).

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 draft=false on a draft-capable server. Median TTFT ranged 132.9–142.0 s. Token-level ITL percentiles cannot be inferred from chunked drafts. The earlier TP1/c4 performance and golden gates remain separate and unresolved; these measurements do not qualify them.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 ids16 continuation, prove the native arithmetic contract, or justify changing the stored reference; the golden gate remains red.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Exact-head TP1 four-stream diagnostic on a626b7cd3b0fbb4b20d9dd7d54a0a6d90219e79f: excluding sampled streams from the batched draft head did not resolve the sampled-chat loss. Six fresh servers in normal-draft / plain / sampled-heads-off / sampled-heads-off / plain / normal-draft order; 128 output tokens, one observation per arm/cell, 32 uniform lines and default reserve.

Prompt Temperature Normal draft / plain Sampled heads off / plain
Chat 0 0.9842 0.9838
Chat 1 0.9188 0.9232
Code 0 0.9930 0.9933
Code 1 1.0618 1.0538

All four cells passed --alone --serial and matched full token hashes. This does not fix the sampled-chat blocker; raw server and client receipts are retained. A subsequent per-request acceptance probe did not start because another kernel-contract job held the GPU lock, and I did not interrupt that job.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Paired-spread assessment of the existing exact-head TP2 ABBA (a626b7cd3b0fbb4b20d9dd7d54a0a6d90219e79f), using the unrounded aggregate rates in the four original client JSON receipts. All losing cells are chat:

Temperature Streams Draft arms tok/s Plain arms tok/s Draft/plain
0 2 53.765 / 53.833 53.981 / 53.909 0.9973
0 4 86.259 / 87.493 89.599 / 88.879 0.9735
1 2 37.007 / 36.954 38.729 / 38.636 0.9560
1 4 45.163 / 45.418 47.641 / 47.572 0.9514

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 reps[0].aggregate_tps. No hardware rerun or new fix is implied.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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. fn_ple_gate indexes a row value by dimension across four streams.

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.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

I checked those ten value coordinates against a second, coordinate-level CPU oracle: the captured FP16 embedding, the actual checkpoint F16 projection rows, and math.fsum of their products. Native is closer to that FP64 dot product at 8 coordinates; the adapted Python diagnostic is closer at 2. The independently extracted weight rows and per-coordinate values/errors are retained with the capture.

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 ids16 continuation, establish that FP64 rounding is the required kernel contract, or justify changing the stored golden.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Completing the paired-spread assessment for the existing exact-head TP1 ABBA (a626b7cd3b0fbb4b20d9dd7d54a0a6d90219e79f). Values are unrounded client aggregate rates; ranges contain the two observations of each mode. Rows include every cell whose drafted mean was below plain.

Prompt Temperature Streams Draft range tok/s Plain range tok/s Draft/plain Ranges overlap?
Code 0 1 20.062–20.068 20.445–20.453 0.9812 No
Code 0 2 38.673–38.771 38.828–38.837 0.9972 No
Code 0 4 68.830–68.889 69.464–69.475 0.9912 No
Chat 0 1 19.709–19.870 19.844–19.849 0.9971 Yes
Chat 0 2 35.363–35.373 35.694–35.717 0.9905 No
Chat 0 4 57.848–57.868 58.672–58.717 0.9858 No
Chat 1 1 20.432–20.453 20.442–20.463 0.9995 Yes
Chat 1 2 22.482–22.516 22.976–23.029 0.9781 No
Chat 1 4 21.629–21.644 23.519–23.552 0.9193 No

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.

@ashhart

ashhart commented Nov 18, 2026

Copy link
Copy Markdown
Owner

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 ids16 reference. There is no qualified full-model reference for Flash Next EXL3 that we can point you to. The per-operator FP64 comparison you posted is the right kind of evidence. We will carry the ids16 question on #1441, so please keep the golden unchanged here.

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:

  1. Have the guard's shared-round choice use main's pricing in shared_price.zig and shared_round.zig, rather than a separate rule.
  2. Re-run the ABBA at TP1 and TP2 on the new head, with every cell at or above plain.
  3. Include the restore check at TP1 as well as TP2.

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.

  • Synthena

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

I tested a local, uncommitted candidate on a626b7cd3b0fbb4b20d9dd7d54a0a6d90219e79f: shared rounds use independently measured count/mode prices and main's warm plain-trial policy rather than the per-stream allPlain choice. This is not the PR head and is not ready to merge.

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.

Rank Decode within plain spread Mean and worst TTFT within plain spread
TP1 5/12 cells 0/12 cells
TP2 11/12 cells 0/12 cells

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 cfac3465dec8fd3fbbee5199d0a3afebe7e3683778b522dae1ed0a8d9d85b0d1; source-file hashes, full request metrics, outputs and logs are preserved locally. TP1/TP2 restore checks on this candidate are running. I am investigating TTFT and the remaining decode loss; no relaxed threshold or cap-only result is being presented as a fix.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Restore follow-up on the same local, uncommitted shared-pricing candidate (cfac3465dec8fd3fbbee5199d0a3afebe7e3683778b522dae1ed0a8d9d85b0d1, ReleaseSafe CUDA binary, based on a626b7cd3b). TP1 and TP2 plain, cache-disabled reference runs completed, as did plain cache-enabled runs. Both drafted, cache-disabled reference servers aborted during the first 10,240-token prompt with panic: integer overflow; the optimized stack reports cuda_exl3_prefill_head.zig:68 (toHost), called from cuda_mtp_ops.zig:110 in prefillChunk. The subsequent cached-draft client could not run its comparison because the required drafted reference file did not exist; that is a downstream harness failure, not an independent cache mismatch.

The panic happens on both TP1 and TP2. A standalone Linux x86-64 Zig 0.17.0 -O ReleaseSafe reproducer of the scratch-size expression @max(@as(usize, 32), 2 * @min(n, 256)) also panics at n = 1023; a guarded equivalent passes the tested boundary cases. This points to compiler miscompilation of the pre-existing deep-prefill head expression, not to the shared-pricing logic; a source fix is being checked on #1445's owning branch. Full rank logs, client traces, source hashes and plain receipts are preserved locally. The candidate remains unqualified and unpushed; the device restore gate has not yet passed after the fix.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 6b7256ff447c13aebfdd09f49b2cf8d86038f496701ec6c61813d2510a7c0bd.

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 e633d2d9029fef0cf7de4085ad80a7c0be8767b2; the owner-head CUDA build and device check are still pending. The #1446 pricing candidate remains uncommitted and fails the previously reported decode/TTFT performance gate; this restore result does not qualify it. Raw outputs, logs, full hashes, source hashes and the previously failing receipts are preserved locally.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 --alone --serial checks matched. Aggregate draft/plain ratios were greedy chat 0.9610, sampled chat 0.8883, greedy code 0.9326 and sampled code 1.0842. Three of four were below the observed plain range; mean and worst TTFT were outside the plain range in all four. Two observations per mode are not confidence intervals. A 55-test shared-lane host filter passed, but the device result does not support adopting this cadence. I reverted it and preserved its source hashes, binary hash ec6e355f71b9e26eb2f7ec27f4222789d84031e8996c89f9148547114dd966a7, raw clients/server logs and comparison locally.

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.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Correction to my preceding local eight-round diagnostic: it did not test working early calibration on Flash Next CUDA. facts() supplies no static shared/window costs, so the candidate’s calibrate() refused the empty table; observeSharedPrice() would also record NaN without a table entry, and allocation treated the empty table as unpriced. The cadence experiment was therefore inert on that backend.

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 --alone --serial passed. Aggregate draft/plain: greedy chat 1.0330, sampled chat 0.9763, greedy code 0.9837, sampled code 0.9587. Three of four are below the observed plain range, and mean and worst TTFT remain outside it in all four; two observations per mode are not confidence intervals. Seeded chat had 104–115 rounds and 12–23 accepted drafts per request, versus 46–57 rounds and 70–81 accepted in an earlier, non-interleaved candidate run: scheduling changed, but that comparison is not a controlled attribution.

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 6c2464a42de0597cfbea433419ff856445d869c21197391600d81e540a7f3752; build, source hashes, raw outputs and logs are retained. The strict golden is unchanged.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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. windows.allocate preserves those values through zero-row rounds, and a zero budget asks for no new head proposal, so a stream can remain plain indefinitely even if its head predictions later improve. The logged run matched the uninstrumented candidate’s full code/chat token hashes and alone/serial checks; logging perturbs timing, so it is not a performance result.

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 TestUnexpectedResult when the probe was removed in a disposable control copy. Full ReleaseSafe lane suite: 380 passed, one skipped. TP1 device ABBA for this candidate is running; there is no claim yet that it meets decode, TTFT, TP2 or restore gates. The change is uncommitted and not pushed. Raw decision logs and the pre-fix failure are retained.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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.

Cell Draft aggregate tok/s Plain aggregate tok/s Draft/plain
greedy chat 62.368 / 62.382 58.233 / 58.220 1.0713
sampled chat 23.329 / 23.326 23.466 / 23.504 0.9933
greedy code 67.085 / 67.028 68.505 / 68.536 0.9786
sampled code 26.432 / 26.450 26.464 / 26.497 0.9985

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 f8932fe791eff3d5b1d2fe15ec1a57d7d8cc72ac86b705e29c8fa95d03dc9990. Local source remains uncommitted and unpushed; TP2 and restore have not been repeated after this change. Raw inputs, outputs, source/binary hashes, build and server logs are retained. This does not meet the requested performance gate.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 --alone --serial matched. Draft/plain aggregate decode was 1.0793, 1.0004, 0.9840 and 1.0005, respectively. Greedy code remains below the observed plain range; mean and worst TTFT remain outside it in all four. Two observations per mode are not confidence intervals.

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 b128afb35b8a41b7543e7f11c332b3d64bfaa71da77f11476fdf4693b3efdcc9; source hashes, raw data and logs retained.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Scratch diagnostic follow-up: with TF_FLASHNEXT_GPU_TOPK=0, the same uncommitted overlay binary (b128afb35b8a41b7543e7f11c332b3d64bfaa71da77f11476fdf4693b3efdcc9) completed one TP1 drafted and one plain four-stream run, 128 sampled tokens for code and chat. Full token hashes matched, --alone --serial passed, and server logs record accepted drafts. This exercises the sampled full-score fallback, not grammar masking or comprehensive allocator failure/lifecycle behavior. The overlay remains diagnostic only; the decode/TTFT and integrated-head gates remain open. Raw results are saved.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 --alone --serial matched:

Cell Draft aggregate tok/s Plain aggregate tok/s Draft/plain
greedy chat 62.747 / 62.729 58.179 / 58.248 1.0777
sampled chat 23.891 / 23.847 23.458 / 23.484 1.0170
greedy code 72.492 / 72.473 68.488 / 68.556 1.0578
sampled code 27.496 / 27.501 26.459 / 26.488 1.0387

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 8b7ba630870c1eba2a87d0a5de9426055b8c26a8bb72fa85f5efb0cb3c4deba8. TP2, restore, other widths and integrated-head qualification remain open; the strict golden is unchanged.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 --alone --serial checks match.

Cell Draft aggregate tok/s Plain aggregate tok/s Draft/plain
greedy chat 62.525 / 62.419 58.231 / 58.240 1.0728
sampled chat 23.640 / 23.624 23.480 / 23.475 1.0066
greedy code 72.104 / 72.073 68.561 / 68.565 1.0514
sampled code 27.593 / 27.584 26.483 / 26.484 1.0417

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 679ae219f863611698384a0ba1b465dc0e9f4e0a3795f3188b0d8c0f872e4d99. ReleaseSafe lane suite 380 passed, one skipped. TP2, restore, other widths and final integrated-head no-regression checks remain open. This does not meet the TTFT gate and does not touch the shared MTP production files.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 --alone --serial passes.

Cell Draft aggregate tok/s Plain aggregate tok/s Draft/plain
greedy chat 87.438 / 87.452 88.111 / 88.119 0.9924
sampled chat 46.573 / 46.331 47.179 / 47.234 0.9840
greedy code 98.007 / 98.101 99.193 / 99.418 0.9874
sampled code 52.560 / 51.523 50.533 / 50.622 1.0290

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 679ae219f863611698384a0ba1b465dc0e9f4e0a3795f3188b0d8c0f872e4d99. Full raw inputs, per-request metrics, hashes and rank logs are retained.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 independent shared round, roundStreams calls win.build directly, so its Window.hidden retains the default true. Only rate_guard_round.build currently invokes rowsWanted to omit hidden rows for a plain guarded round. cuda_lanes_draft.plainRound requires hidden == false to take its plain path; otherwise a zero-budget draft request can enter the stash path. So a mostly-zero-grant shared round may still pay hidden-row/stash overhead even though the guard chooses plain. The trace does not separately measure that cost, and I am not claiming this explains all of the TP2 gap.

It is not safe simply to clear hidden: the next draft budget is chosen after verification, and probes, copied proposals, grammar, finished lanes and cancellation still need the correct rows. A scheduler change needs to coordinate the next budget with hidden-row availability and prove recovery and token equality. I have not changed the shared MTP backend files your team owns. Trace source, full output hashes and rank logs are retained.

@ashhart

ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

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.

  • Synthena

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 c4f012b71e13229a19ca6cd478c747dc01cd52e2 plus that uncommitted change and the bounded-scratch patch, binary SHA-256 b576e088fa817de3e84ba7f3434a693a66a40c6394a35d4ca1d198b14f75aad2; not a public or integrated head. Host suite: 380 passed, 1 skipped; the fake-backend recovery test checked no positive draft with omitted hidden rows and eventual resumption.

TP2, four streams, 128 outputs, draft/plain/plain/draft, greedy/sampled chat and code: all full token hashes and --alone --serial passed, but every decode and TTFT paired-spread gate failed. Draft/plain aggregate decode means were 0.9721× greedy chat, 0.9228× sampled chat, 0.9613× greedy code and 0.8696× sampled code. Two observations per arm are not confidence intervals; these are draft-vs-plain comparisons within this candidate, not an interleaved causal comparison to the prior candidate. Raw per-request metrics, source and logs are retained. No lazy-host overlay was used.

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.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 c4f012b71e13229a19ca6cd478c747dc01cd52e2 plus this uncommitted experiment and the bounded-scratch patch; binary SHA-256 80112fe4c0cb17e79902b02ba642821f0de580c93ee174816e45a8733d510159. Not a public or integrated head. Host suite 380 passed, 1 skipped; fake backend checked all-or-none, no positive draft without hidden rows and eventual recovery.

TP2 four-stream draft/plain/plain/draft at 128 outputs: full hashes and --alone --serial all passed. Draft/plain aggregate decode means were 0.9652× greedy chat, 0.9647× sampled chat, 0.9602× greedy code and 1.0226× sampled code. Three decode cells and all four mean/worst TTFT cells missed paired-plain-spread gates. Two observations per arm are not confidence intervals; this is draft versus plain within this candidate, not an interleaved causal comparison to the preceding experiment. Raw per-request metrics, source and logs retained. No lazy-host overlay was used.

The grouped experiment was removed from the working tree; it is not fit to land. Integrated-head TP1/TP2 performance and restore remain open.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

TP2 diagnostic measurement of the previously reported lazy host-scratch overlay, not a production shared-MTP change: a626b7cd3b0fbb4b20d9dd7d54a0a6d90219e79f plus immediate pricing, bounded scratch and diagnostic lazy-host scratch, binary SHA-256 8b7ba630870c1eba2a87d0a5de9426055b8c26a8bb72fa85f5efb0cb3c4deba8; no hidden-row skip. TP2, four streams, 128 outputs, draft/plain/plain/draft, greedy/sampled chat/code. All full token hashes and --alone --serial passed.

Cell Draft/plain aggregate decode mean Draft minus plain mean TTFT
greedy chat 1.1393× +18.45 ms
sampled chat 0.9908× +18.71 ms
greedy code 1.0243× +15.22 ms
sampled code 1.0488× +13.58 ms

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.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Pre-integration TP1 and TP2 drafted restore diagnostics for the locally committed guard: the runtime core-lane source hashes match local commit c4f012b71e13229a19ca6cd478c747dc01cd52e2, with a bounded head-scratch patch outside that commit; binary SHA-256 679ae219f863611698384a0ba1b465dc0e9f4e0a3795f3188b0d8c0f872e4d99. Therefore this is not the exact commit alone or an integrated PR head. No hidden-row or lazy-host experiment is included.

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.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Additional local diagnostic, not the public or integrated head: TP2 four submitted independent-prefix sampled requests, local guard c4f012b71e13229a19ca6cd478c747dc01cd52e2 runtime core plus the separate bounded-scratch patch (binary SHA-256 679ae219f863611698384a0ba1b465dc0e9f4e0a3795f3188b0d8c0f872e4d99). Graph off, KV host tier off, 16 expert lines/rank, 12,288 context, four distinct 10,079-token prompts, temperature 1, seeds 1234–1237, 32 output tokens.

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 a812682 plain cache-disabled references for these fixtures; this cross-build comparison is extra evidence, not a substitute for same-head plain equality. Rank 0 logged positive accepted drafts for every response. Four submissions do not prove a particular overlap or establish performance. The strict golden, paired TP1/TP2 decode and mean/worst TTFT gates, and integrated-head tests remain open. Raw client JSON, rank logs, source/binary hashes and scripts retained.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

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 ids16 golden remains unchanged.

@AIFlowML

Copy link
Copy Markdown
Contributor

On M5 Max with Zig 0.17.0, public head a626b7cd passed 301/301 with zig build test-flashnext-exl3-host test-flashnext-exl3-trace-writer-host -Dcpu=apple_m1 -Doptimize=ReleaseSafe -j5 --summary all. As a control in scratch, I changed facts() in cuda_lanes.zig so guard eligibility depended only on whether drafting was enabled. The command then failed the guard test for dense drafting, confirming that the named target exercises the offloaded-expert condition.

The trial merge against 6a8faeed reported 23 conflicts. This head also predates the current public #1444 and #1445 heads, so the host result applies to this layer as published. Once the shared MTP first-token boundary is agreed, the reproducible follow-up is to rerun this host command on the integrated SHA and attach the equality, restore and paired timing results for that same SHA as hardware is available. The #1445 hardware update leaves TP2 coverage open. I verified guard activation here. TTFT and decode performance still need the device run described above.

Igor Lessio - AIFLOW LABS

This branch has not been deployed

No deployments
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.

3 participants