Skip to content

docs: Flash Next CUDA recipe, what TF_FLASHNEXT_CHUNK trades: faster prompts against longer decode waits - #1553

Merged
ashhart merged 3 commits into
ashhart:mainfrom
jschmied:docs-flashnext-chunk
Oct 29, 2026
Merged

ashhart merged 3 commits into
ashhart:mainfrom
jschmied:docs-flashnext-chunk

Conversation

@jschmied

@jschmied jschmied commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Docs only (docs/recipes/flash-next-cuda.md):

  • TF_FLASHNEXT_CHUNK is now listed under Run.
  • A new section, Prompt chunk size, explains the trade-off from the code. A prompt of N rows runs in ceil(N / chunk) passes, and every pass reads the weights of each expert its rows route to. So fewer, larger passes make prompts faster, but a stream that is decoding waits up to the whole pass for its next token, and the prompt scratch grows with the chunk.

Receipt

  • Code-backed claims: the range (1 to 16,384, refused before load), the 1,536 default, one chunk per prompt pass, 1.84 MB of gate and up weights an expert, 512 experts, the scratch growing with the chunk, and the 16,384-row paging note in docs/known-issues.md.
  • Measured numbers: none. The first version had a timing table, an nsys comparison and an exactness line; their raw run files are gone, so they are cut. They can come back with a full receipt if the chunk default changes (Flash Next CUDA: prompt chunk size against decode waits, how other engines handle it, and options #1554).
  • Tests run: none needed for a docs change; lean_check 425, the same as main.

@ashhart

ashhart commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. We checked every claim the code can back, and they hold: the range (1 to 16,384, refused before anything loads), the 1,536 default, the startup line, one chunk per prompt step, the 1.84 MB of gate and up weights per expert, 512 experts, scratch growing with the chunk, and the 16,384-row paging note in known issues. Two changes before we land it:

  1. docs/recipes/flash-next-cuda.md:62-63: "a pass runs to its end before other streams decode their next token" reads as a guarantee about scheduling. It's really a cost. Suggested wording: "a pass runs to its end, so a stream decoding during a pass waits up to the whole pass for its next token."
  2. The measured numbers (:205-223): the timing table, the nsys paragraph (1,052 to 914 ms), "about 350 of the 512 experts" and the 64-token exactness line can't be checked from the PR. Could you attach or link the receipt: the requests, the three runs per setting, the wait and memory numbers, and the token hashes? Then they stand as measured. If you'd rather not, cut those lines and keep the code-backed explanation, which is useful on its own. If the pass count stays, give it as arithmetic (1,922 rows is two passes at 1,536 and one at 8,192), since cache marks can change the measured count.

@jschmied

Copy link
Copy Markdown
Contributor Author

Thanks @ashhart. Both done in bc5e0d8:

  1. Lines 62-63 now use your wording: a pass runs to its end, so a stream decoding during a pass waits up to the whole pass for its next token.
  2. I cut the measured numbers: the timing table, the nsys paragraph, "about 350 of the 512 experts" and the 64-token line. Their raw run files are gone, so I can't attach a receipt that stands on its own. The section now keeps the code-backed explanation and gives the pass count as arithmetic (a 1,922-row prompt is two passes at 1,536 and one at 8,192). I updated the PR description to match. If the default changes under Flash Next CUDA: prompt chunk size against decode waits, how other engines handle it, and options #1554, the numbers can come back with a full receipt.

jschmied and others added 3 commits October 29, 2026 21:39
…prompts against longer decode waits

The recipe now names TF_FLASHNEXT_CHUNK under Run and gives a measured table at the default 1,536 rows and at 8,192 on
the FP4-Local checkpoint (one GB10, three streams): first token 12 to 16 % sooner past 1,536 tokens, against a 3.78 s
instead of 0.90 s wait for streams that are decoding while an 8,361-token prompt runs, and about 6 GB more scratch.
@ashhart
ashhart force-pushed the docs-flashnext-chunk branch from bc5e0d8 to d69ac9e Compare October 29, 2026 23:18
@ashhart
ashhart merged commit d2f6b50 into ashhart:main Oct 29, 2026
9 checks passed
@ashhart

ashhart commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Thank you @jschmied. This is in TensorFold 1.2.0, released today: https://github.com/ashhart/TensorFold/releases/tag/v1.2.0

It landed with your commits under your own name, so you're listed as a TensorFold contributor, and it's credited to you in the release notes and the changelog.

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.

2 participants