Skip to content

flashnext cuda: opt-in window graph keyed on the settle buffer parity - #4492

Merged
ashhart merged 6 commits into
mainfrom
lead/flashnext-window-graph-parity
Nov 24, 2026
Merged

ashhart merged 6 commits into
mainfrom
lead/flashnext-window-graph-parity

Conversation

@ashhart

@ashhart ashhart commented Nov 22, 2026

Copy link
Copy Markdown
Owner

What this changes

Draft.settle swaps the state and spare buffers, and the verify-window graph cache keys on neither pointer, so after a full-accept round the cached graph points at the other buffer and is refreshed. With TF_FLASHNEXT_WINDOW_GRAPH_PARITY=1 the pointer parity is part of the graph key, so both graphs stay resident (within the cache's limit) and steady-state rounds replay. Same kernels and arguments; no arithmetic change. A separate commit adds update/replay counters to see the effect.

Checks

  • Host tests on a fake: steady-state graph updates fall to zero with both parities, tokens unchanged; environment strict tests; fmt, ast-check, lean, 600-line cap.

Still to run

One GB10, Flash Next one stream, default drafts: updates/replays with the switch off and on, then A-B-B-A served cells (greedy and sampled, prose and code) with tokens compared.

@ashhart
ashhart force-pushed the lead/flashnext-window-graph-parity branch 3 times, most recently from be05d52 to 6768774 Compare November 24, 2026 01:54
@ashhart
ashhart force-pushed the lead/flashnext-window-graph-parity branch from 6768774 to a2feaf1 Compare November 24, 2026 11:18
Count every cache attempt alongside captures, updates and replays so steady-state graph behavior has a per-round denominator.
Opt into separate graph slots for the two whole-accept state/spare directions. Compare replayed argument bytes, target tokens and full acceptance lengths on the fake CUDA graph driver.
Main already registers the batch GDN switch. Count it and the parity switch together in the strict environment inventory; parsing and inference stay unchanged.
@ashhart
ashhart force-pushed the lead/flashnext-window-graph-parity branch from a2feaf1 to 63d25ab Compare November 24, 2026 12:50
@ashhart
ashhart merged commit c8c8c30 into main Nov 24, 2026
2 of 12 checks passed
@ashhart
ashhart deleted the lead/flashnext-window-graph-parity branch November 24, 2026 12:50
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.

1 participant