Repository navigation
EXL3 Flash Next: deep prefill (3/8) - #1443
BlivionIaG wants to merge 53 commits into
Conversation
a23cd77 to
0b8304d
Compare
|
The prefill speedup is impressive: the 16k-token prompt goes from 56 s to 10.5 s. The blocker is arithmetic. The deep path is on by default for segments of 512 rows or more ( Keeping cache states on the step grid ( To land:
Once prompt rows match decode, the grid is no longer needed for exactness. The ring, overlap and prefetch work can stay as it is. |
3011ec2 to
8f85bfb
Compare
8f85bfb to
5207d74
Compare
4d106ad to
505a649
Compare
6ff3191 to
e3788fc
Compare
Admit window, MTP head and decode captures only when their pass has no host-planned expert pool; keep resident and rollback graphs available.
Recompute the actual merged-file pins for the 19 intentional ashhart#1441 serving source changes; no source or approved-list change.
…rid, as this branch's signature has it
33946ec to
c428f4c
Compare
|
Rechecked
I also confirmed the earlier scratch-row finding on Linux x86-64 with Zig 0.17.0 ReleaseSafe: the current arithmetic panics in an isolated Igor Lessio - AIFLOW LABS |
|
Thanks @BlivionIaG. The four runtime/offload fixes noted on #1442 also apply here: honor host placement for disk-resumed snapshots, count routed MTP trellises as device-resident when The two shared serving gates also need nonzero failure exits. Include both golden comparisons in the serving gate's status; make that gate and the long-context needle gate fail by exit status whenever their required checks fail. The TP prefill gate can separately pass a token mismatch: its non-exact comparison accepts a low reference margin, and the TP2-deep versus TP1-deep call selects that mode. Your FP64 change states that TP1 and TP2 give the same bits. Please pass Finally, carry over the #1442 admission-test correction for chunk values
|
Synthena Initial Review — Performance receipt required (
|
…pping - `now` and `round_no` are u32 stamps that order lines and swaps; a long-running server wrapped them into an overflow trap - test: from maxInt they step to 0 then 1 (trapped with integer overflow before)
…P_HOST puts kept states - the disk view allocates through snap.blank, which honors the host placement instead of always taking device memory - test: with TF_FLASHNEXT_SNAP_HOST=1 a read-back state sits on the host (it sat on the device before)
…loader keeps - headOptions reads TF_FLASHNEXT_EXL3_MTP_RESIDENT once; headBytes and the loader's mtp. roots both use it - test: a synthetic pack with the switch set counts the head's routed bytes (they were missing before)
… history - a profile written with or without MTP counts keeps the decoder counts; only MTP starts cold, and the fingerprint marks the head - test: prepare/finish across a residency change keep decoder counts (they were discarded before)
- the serve gate's status includes the golden check and exits 1 on failure; the long-context client exits 1 on a missed needle - tests/test_exl3_gates.py fails on the old scripts (2 failures) and passes now
…ather - drop the duplicate TENSORFOLD_MEMORY_RESERVE_GIB rule; the EXL3 consumer applies its own 0.5 GiB floor - legacy fixtures: an untrimmed reserve and a zero CHUNK_SOLO follow main; a refused TF_FLASHNEXT_CHUNK ends in InvalidEnvironment - the pooled-gather order test reads cuda_batch_gather.zig, where Gather.main moved
…margins - compare always requires identical last-row logits bytes and greedy ids; the top-1 margin tolerance is gone
|
Pushed
Commands run on macOS arm64 with Zig 0.17.0:
Not done: no CUDA device here. The exact TP2-vs-TP1 deep prefill gate still needs a run on two GPUs. |
Current head:
407211da3c, merged through #1442f8bb280b12with mainbaed910096and moving the EXL3 notes back to Unreleased. The exact-head TP1 prefill checks below passed; earlier TP2, speed and kernel-contract measurements were not repeated on this head. An earlier Linux Zig CI job was canceled duringzig build test-kernel-contractafter about an hour, matching its then-60-minute job limit; it was not a passing result.Current-head
tools/pr_check.py --base upstream/main --pr 1443: 0 errors, 0 warnings, 0 new lean findings.Exact-head TP1 prefill gate
On
407211da3c, all 45 resume cuts and all 15 mixed deep/shallow segmentation cases matched fresh or serial execution in logits bytes and 24 greedy tokens. Settings and scope. TP2, server-cache resume and independent model-fidelity gates remain separate.What this changes
Segmented deep EXL3 prefill with TP prefill partials in float64, and prompt-state restore at any row (the snapshot grid is gone).
f8bb280b12; over it this PR adds deep prefill, TP prefill dispatch, prefill settings registration and tests, FP64 TP prefill partials with a typed all-gather and one rounding at the finish, snapshot-grid removal, and rotate-contract fault handling.6c5cef8941, merged throughbaed910096.atc overlap --jsonagainst four known peers (Flash Next TP=2 on CUDA: head and rollback graphs replay, and one-row split lanes skip the interleave copies #2837, flashnext cuda: the opt-in --tp 2 decode graph (TF_FLASHNEXT_DECODE_GRAPH=1) serves again instead of failing its first plain round #2980, flashnext cuda: the opt-in --tp 2 decode graph takes the dense split and keeps its graph across drafted verifies #2982, flashnext: the MTP head's streams by row through the lease's pages, no per-lane block outside the pool (#2444 P3, F2 part c) #2992) only, run on the integrated stack before the latest merges of main; not a global clearance. Conflicting files: Flash Next TP=2 on CUDA: head and rollback graphs replay, and one-row split lanes skip the interleave copies #2837 2, flashnext cuda: the opt-in --tp 2 decode graph (TF_FLASHNEXT_DECODE_GRAPH=1) serves again instead of failing its first plain round #2980 6, flashnext cuda: the opt-in --tp 2 decode graph takes the dense split and keeps its graph across drafted verifies #2982 8, flashnext: the MTP head's streams by row through the lease's pages, no per-lane block outside the pool (#2444 P3, F2 part c) #2992 6. Owner composition agreements exist for flashnext cuda: the opt-in --tp 2 decode graph (TF_FLASHNEXT_DECODE_GRAPH=1) serves again instead of failing its first plain round #2980, flashnext cuda: the opt-in --tp 2 decode graph takes the dense split and keeps its graph across drafted verifies #2982, flashnext: the MTP head's streams by row through the lease's pages, no per-lane block outside the pool (#2444 P3, F2 part c) #2992; my notice on Flash Next TP=2 on CUDA: head and rollback graphs replay, and one-row split lanes skip the interleave copies #2837 is unanswered.Checks before the release merge
f654c5b60d. The device results below ran on40e3a6ceb16e; this head differs from it by the merges of main at0591c4e85d,c34ff562ca,a3aecd8d0fand484437b6ac(cuda_batch_moe.zig: this branch'swritebackand main'ssumSlotsboth kept) and the pin fixturegradient-serving.tsv. The device cells were not repeated on this head.python3 tools/pr_check.py --base <main> --pr 1443: exit 0, 0 errors, 0 warnings; lean 339 vs 341 on main, 0 new.zig fmt --check zig: clean.test-cuda-host,test-exl3-cuda-host,test-flashnext-exl3-host,test-exl3-prompt-host,compile-flashnext-host,test-flashnext-memory-host,test-qwen-serving-host,test-lane-api-hostandtest-lanes-seepassed on an earlier integrated EXL3 Flash Next: draft lane guard for offloaded experts (8/8) #1446 head on Darwin arm64; the full list was not rerun on this head.Device results on
40e3a6ceb16eTwo 16 GB sm_120 GPUs, Linux x86_64, checkpoint above. One run per cell unless stated.
fast-equal,fast-resume(45 kept states bit-equal),fast-mixedand the TP prefill cells pass at TP=1 and TP=2; TP=2 deep equals TP=1 deep, bit for bitREDUCED_BRANCH,TWO_CHUNKkernel-contract exl3 flashnext(filtered)Not run or open
Receipt
turboderp/Qwen3.8-Flash-Next-exl3at69e33439ae950f17bcbe95c98f117d80f759ab6d.flashnext_exl3_prefill.cu(+425),exl3_candidate.cu(+114),contract_tppf_controls.cuh(+275, new),contract_controls.cu(+3). The filtered contract above covers them.Profile setting check
The final head has one
TF_FLASHNEXT_PROFILEregistration inzig/src/platform/environment.zig, the same entry as main. The EXL3 prefill and main paths read that shared setting; this slice adds no second registration, environment-table doc line or valid-case test.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. Resumed equals fresh: 45 kept states bit-equal; token hashes identical across the first-token runs. Concurrent equals solo and drafted equals"draft": falsewere not run for this PR on its own.--drafter, no slower than without it. Prompt processing is faster (cells above); decode is unchanged at 1 and 4 streams. Main refuses this checkpoint (n/a).