Repository navigation
EXL3 Flash Next: deep prefill (3/8) - #1443
BlivionIaG wants to merge 45 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
Use the family offload attachment before the shared one-layer oracle forwards, retaining its existing FP64 gates and layer ownership.
Migrate the shared real-weight layer oracle to the MTP-aware signature introduced by this slice.
Real sm_120 checkpoint proof on 2806f61: all 45 cold/resumed states equal fresh logits bytes and24greedy IDs at512/1024/2048 steps. Remove the option, environment rule, loaded-grid override, helper and obsolete grid-only tests. Preserve other families static cache grids.
…to f32 at the finish tf_exl3pf_tp_combine stores each rank's block value in double (the shared fn_exl3_leaf_value_f64 of the decode kernels), the all-gather carries the doubles, and tf_exl3pf_tp_finish merges them in double and rounds once to float. A lone rank goes through the same finish, so TP1 and TP2 give the same bits. The prefill scratch holds the doubles (rows x 2560 x 8 a partial). The CPU leaf oracle and the TP prefill contract (fixtures, controls, host gates) follow: partials and the finish's inputs are f64 words, two new controls (f32 partials in the combine and in the finish), and regressions for the cancelling products an f32 tree or an f32 transit rounds away. The combine and finish's f32 nvcc receipts are dropped until the f64 kernels are measured.
The two-rank EXL3 exchange keeps each rank's subtree partials as 8-byte doubles: the gather buffer, per-rank offsets and the finish's stride count doubles, the all-gather is a typed FP64 NCCL copy (no rounding or reduction), and the root output stays f32. Adds the family collective's gatherF64 and bit-exact transport and partition regressions.
Leaves and the binary tree accumulate in double through one shared device helper (fn_exl3_leaf_value_f64). fn_exl3_leaf_tree rounds once to float; the new fn_exl3_leaf_partial stores the double value and fn_exl3_leaf_finish merges double partials, so a rank split cannot reintroduce f32 roundings. Host exl3_canon.subtree/finish are f64; the contract adds an f64 accumulator kind, f64 partial/finish fixtures, f32-partial controls and the f32 cancellation regression (old tree 0, slot chain 1, exact 2). The reduction's nvcc 13.4 receipts are pending until the f64 kernels are measured.
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 |
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).