Repository navigation
flashnext cuda: opt-in short-row GDN chains on the two-threads-a-row kernel - #4484
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/flashnext-gdn-chain-tpr
branch
3 times, most recently
from
November 24, 2026 01:59
ea476c8 to
d252728
Compare
ashhart
force-pushed
the
lead/flashnext-gdn-chain-tpr
branch
from
November 24, 2026 10:05
d252728 to
603ef55
Compare
ashhart
added a commit
that referenced
this pull request
Nov 24, 2026
ashhart
added a commit
that referenced
this pull request
Nov 24, 2026
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 this changes
Flash Next's CUDA GDN decode/verify chain spends 61,440 warp shuffles and as many reduction adds per token per layer (five butterfly levels per state row). The repository already has
fn_gdn_chain_tpr, which gives each state row two threads and does the within-thread levels first, with the same bit order asfn_gdn_rows_to(its contract compares every output and state byte); today it is used only from 64 rows up.With
TF_FLASHNEXT_GDN_CHAIN_TPR=1, ordinary windows below 64 rows select it too (one shuffle level instead of five: about 80% fewer shuffles). Default off. Only the ordinaryrows/rows_toroute changes; pending (rows_late) semantics and the shared-lane wrapper are untouched. No dtype or arithmetic change.0/1) and counted in the Flash Next table test._h8rank forms compare everyysand state byte with the current path, including planted NaN/Inf and rollback_tostate.Checks
zig fmt --check,ast-check, the 600-line cap and the lean count pass;compile-cuda-testsandtest-flashnext-glue-contract-hostexit 0.Still to run (GB10)
tf-cuda-test kernel-contract fn_gdn_chain_tprbyte equality; chain and whole-window timings at R = 1/4/8/16 A-B-B-A; served drafted decode with tokens compared. Kill on any byte or token difference, a slower R = 1/4, R = 8 and 16 under 10% faster in chain median, or whole drafted decode under +3%.