Repository navigation
Flash Next on CUDA: prompts 15-23% faster at --parallel 1 on one GPU - #2246
Merged
Merged
Conversation
3 of 5 tasks
ashhart
force-pushed
the
lead/fn-solo-lone
branch
from
November 5, 2026 17:53
53624b6 to
db55c42
Compare
ashhart
added a commit
that referenced
this pull request
Nov 5, 2026
ashhart
force-pushed
the
lead/fn-solo-lone
branch
from
November 5, 2026 20:11
db55c42 to
2aff2a8
Compare
…2 rows No other stream can wait on a pass there, and fewer passes read each expert fewer times. On one GB10, a 65,536-token prompt's first token goes from 35.5 s to 29.5 s for 3.2 GiB more scratch, with the same replies. TF_FLASHNEXT_CHUNK_SOLO still decides when set; other servers and two ranks keep their passes. The known-issues note on these passes is measured again.
ashhart
force-pushed
the
lead/fn-solo-lone
branch
from
November 5, 2026 20:45
2aff2a8 to
0847c99
Compare
jschmied
added a commit
to jschmied/TensorFold
that referenced
this pull request
Nov 6, 2026
ashhart
pushed a commit
to jschmied/TensorFold
that referenced
this pull request
Nov 6, 2026
ashhart
pushed a commit
to jschmied/TensorFold
that referenced
this pull request
Nov 6, 2026
ashhart
added a commit
that referenced
this pull request
Nov 7, 2026
Step: test-gradient-serving. Old pins: e166f3f. New base: 063d881 (origin/main). Sets the hash of the 46 changed entries in gradient-serving.tsv to 063d881's bytes; paths, modes (all raw) and note columns are unchanged. pocket-serving-approved.tsv needs no edit: its entries for these files have prefix 0, so they never read the manifest hash. No code changes; 1/1 test passes. Recorded, as merged and reviewed: - #1784 (cf63ff6): Flash Next at --tp 2 splits dense output columns with exact FP32 gathers. - #1784 (cde4fe7): the BF16 prompt tile folds a pinned (cut) weight's whole K-slice order. - #1942 (15f118a): a shared round's DeltaNet steps run as one launch over its lanes. - #1792 (52b9f90): the whole shared expert's down writes straight into its output slot. - #2160 (a54748a): beside another open stream a greedy chain stops at 0.6 a draft; wide rounds draft 6 deep. - #2246 (4294752): at --parallel 1 on one GPU a prompt pass takes 8,192 rows. - #2214 (e4d7f13): kept prompt states with drafts across ranks. - #2230 (1f2c993): Gemma 4's PLE kernel in its own image; controls and blob constant. - #2103 (a3962b4, 194115d): synchronous downloads stage through a pinned bounce, on integrated devices only, and the bounce counts in memory use. - #2289 (e9ee738): the remaining synchronous readbacks use that staging; close() releases it. - #2127 (b2c277a): the lane host's KV ledger counts the paged pool's promises. - 4fb2f65, 60d80da, 8cc6ac4, 36a87df, 41ff25d, efdf28f, fcb1529, f3bcb78, ecef17d, 2ebc3c2, 42d3461, a86c31c, 1913a46, 80218cd: comments, verbatim moves, test-block imports, exports, and opt-in or off-by-default paths only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
At
--parallel 1on one GPU, a Flash Next prompt pass now takes up to 8,192 rows instead of 1,536.A larger pass reads each routed expert fewer times, so a prompt gets faster. What it normally costs is a wait for any other stream, because a pass isn't interrupted. At
--parallel 1there's no other stream, so that cost doesn't apply. Two costs remain: about 3.2 GiB more scratch, and a cancel that arrives during a pass waits for that pass to end, about 3.6 s at most instead of 0.8 s by my estimate from the pass rate.This is
TF_FLASHNEXT_CHUNK_SOLO's existing behaviour with a new default for this case only. Setting the variable still decides. Servers with more than one stream, including--parallel auto, and two ranks keep their passes.Numbers
One GB10, MLX 4-bit MTP,
--parallel 1 --context 73728, main against this branch, base-new-new-base. Prompt tok/s on a first run from the start of the corpus:The other 15 cells, from other corpus offsets and repeated prompts, range from +16.4% to +22.8%. Decode speed is level in all 20 cells, within ±0.6%. No token rows differ, and the 65,536-token long-context cell passes on both sides.
How the pass size trades off, 65,536 tokens, three fresh servers each:
8,192 takes most of 16,384's gain for under half its memory.
With the prompt cache full
The known-issues note warned that a large pass could push the n-gram tables out of memory once saved prompt states fill the cache. I measured that at 16,384 rows, the worst case, with seven long chats of about 65,000 tokens filling the default 16 GiB cache, two runs each:
The tables page at both sizes, but the 1.5x swing in the old note doesn't appear: 16,384 rows beat 1,536 on average in both runs, though one turn was level and one resume took 4.6 s against about 0.8 s. Replies and cached counts match in every row. This PR rewrites that note with these numbers. 8,192 rows wasn't run through this test; it uses about half the extra scratch.
FP4
nvidia/Qwen3.8-Flash-Next-FP4-Localon a second GB10, with the same settings and order. Prompt tok/s on a first run from the start of the corpus:The 8,192 row's two runs on this PR were 1,805 and 2,312, so that cell overlaps main. The same prompt repeated goes from 1,908 to 2,308 (+20.9%). The other 15 cells range from +15.2% to +21.4%. Decode speed is level in all 20 cells, within ±0.8%. No token rows differ, and the 65,536-token long-context cell passes on both sides.
Not measured
Other CUDA GPUs with less memory haven't been run: a server that fits today could start with about 3.2 GiB less room, and
TF_FLASHNEXT_CHUNK_SOLO=1536restores today's passes.Tests
A new host test in
cuda_chunk.zigcovers the default and that the variable still decides.test-cuda-hostand the Linuxcompile-cuda-testspass.