Repository navigation
flashnext cuda: TF_FLASHNEXT_CHUNK_SOLO, a pass's rows chosen as it starts (#1554 option C) - #1733
Conversation
|
Thanks @jschmied, this is a clear write-up. Option C as an opt-in fits: the arrival cost is plain in your table, and anyone who serves one long prompt at a time can choose it. We've rebased it onto main. One conflict: |
|
First result, @jschmied: with |
|
Second result, @jschmied: the MLX 4-bit Flash Next checkpoint on a GB10, |
…rts (ashhart#1554 option C) A lane's prompt pass takes TF_FLASHNEXT_CHUNK_SOLO rows when no other stream is decoding and TF_FLASHNEXT_CHUNK rows otherwise. Unset, both are TF_FLASHNEXT_CHUNK and nothing changes. The scratch, the drafts' rows and the rank identity size on the larger value; a value below TF_FLASHNEXT_CHUNK is refused at load. The chunk parsers move to cuda_chunk.zig.
…easured trade-off (ashhart#1554)
e406a4d to
581e35f
Compare
|
Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in 1.2.1, credited to you in the changelog and the release notes. |
Option C from #1554: a lane's prompt pass chooses its rows when it starts. It takes the large chunk when no other stream is decoding and the small one otherwise.
What this changes
TF_FLASHNEXT_CHUNK_SOLO(opt-in) is the large chunk. It takesTF_FLASHNEXT_CHUNKto 16,384 rows; a value belowTF_FLASHNEXT_CHUNKis refused at load. Unset, every pass takesTF_FLASHNEXT_CHUNKand nothing changes.stepincuda_lanes.zigpicks the pass's rows from the other lanes as it starts. A lane whose prompt is in counts as decoding; one still filling its prompt does not. A pass is never cut short, so a request arriving during a large pass waits for it, as Flash Next CUDA: prompt chunk size against decode waits, how other engines handle it, and options #1554 describes.cuda_prompt.zigto a newcuda_chunk.zig(it was at 599 lines), with host tests for the parser and the choice.Receipts
GB10 (driver 615.71.09, nvcc 13.0), this branch at 63f1ee5 on main 4b287e3,
nvidia/Qwen3.8-Flash-Next-FP4-Localatb9ce18a6,--parallel 3 --context 40960 --no-drafts --prompt-cache-gib 0, greedy. There were six fresh servers in the order unset, 8192, 4096, 4096, 8192, unset. Each cell is the median over both servers of a setting: 6 requests for first token, 4 runs for decode waits and 6 for arrivals.TF_FLASHNEXT_CHUNK_SOLO=4096=8192MemAvailable10 s after load (both servers)MemAvailablemoved by 2 GB between servers of the same setting on this shared box.zig build test,test-kernel-contract test-golden test-server-security test-pull-security fuzz-cortheon,git diff --checkand a plainzig build native, all green.lean_checkis 425 problems, the same as main, 0 new. Every touched file is at or under 600 lines.prefillChunk, whose buffers are sized on the larger chunk.step. The conflict is one adjacent line (warmAhead) and the moved parsers incuda_prompt.zig; keeping both sides resolves it. Main's 7bf9711 (Python engine features to carry into the native engine #840), which landed while this ran, givesstepa third argument. That is the one conflict with main, and it is also resolved by keeping both sides.notes/tf1554c/and can be uploaded on request.For #1554; whether C becomes the default is the maintainers' call on these receipts.