Repository navigation
Conversation
A Flash Next window pass alternates between a stream's state and its spare from round to round, and its head inputs alternate too, so the one-graph-per-slot cache re-recorded the slot's graph almost every round. Each slot now holds two graphs with least-recently-used eviction: a round replays a graph only when its whole key (pointers, sizes and shapes) matches, otherwise the second way is captured or the older one is re-recorded in place. The total stays capped at 128 held graphs. Kernels, arguments and replies are unchanged; only how often a graph is captured changes.
Owner
Author
|
Device result on one GB10 (Qwen3.8-Flash-Next MLX 4-bit, MTP on, main against this head, base-new-new-base, run 1 dropped): replies identical (0 of 20 prompt rows differ) and decode level. Code and chat at 1, 2, 4 and 8 streams, greedy and sampled, all moved between -0.3% and +0.2%. Holding two graphs per slot doesn't change throughput on this setup, so this stays a draft rather than landing.
|
ashhart
marked this pull request as draft
November 11, 2026 01:57
6 of 8 tasks
Owner
Author
|
Closing: holding two graphs per slot came out level on a GB10 (-0.3% to +0.2%, replies identical), so it doesn't earn its place. The measurement stays here for reference.
|
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.
A Flash Next window pass on CUDA alternates between a stream's state and its spare from round to round, and the head's inputs alternate too, so the one-graph-per-slot
window_graph.Cachere-recorded a slot's graph on 57% of window passes: a recent device log showed 283 graph updates against 212 replays.What changes (
zig/src/families/flashnext/cuda_window_graph.zig): each slot holds two graphs with least-recently-used eviction.run()rather than in a separate function; the tests drive it through a fake driver.clear()drops held graphs, and its every-64 interval counts updates as well as captures.Kernels, arguments and replies are unchanged. Only how often a graph is captured changes.
Checks:
zig build test-flashnext-window-graph-hostpasses, 31/31. The tests cover a two-state ping-pong that hits after the first two captures, a third key evicting the least recently used one, replays only on an exactly matching key, the 128-graph cap, and capture counts before and after.zig build compile-cuda-tests -Dtarget=aarch64-linux-gnupasses,zig fmt --checkis clean, and the lean count is unchanged.Still to run before landing: Qwen3.8-Flash-Next (MLX 4-bit or FP4-Local) on one GB10, where window graphs are on (they're off at TP=2, so the two-GB10 NVFP4 setup can't exercise this). Main against this branch, base-new-new-base with run 1 dropped, MTP drafting on, 1 and 4 streams, chat and code, greedy and seeded. Tokens must be equal on every request, decode at least level, a cold 4K first token level, and graph records per 100 verify rounds down.