Skip to content

Flash Next native: single-stream measures and options (split graphs at the gathers, draft knobs), init fix - #7

Closed
BobClawblaw wants to merge 7 commits into
native-v1.0.4from
int8-perf-v104
Closed

BobClawblaw wants to merge 7 commits into
native-v1.0.4from
int8-perf-v104

Conversation

@BobClawblaw

Copy link
Copy Markdown
Owner

Single-stream measures and options for the native Flash Next engine. Everything is off by default apart from one init fix.

Commits:

  • Init fix: the engine is built field by field, so field defaults never applied. The verify timing flag was whatever the allocator held (0xAA, so on, in the v1.0.4 build), which added two CUDA events and a read-back to every verify. The counters and the split capture's state were also left unset. They are now set at init.
  • TENSORFOLD_FN_PROFILE=<rounds> logs rank 0's backend call times a round (verify, keep, draft, prefill, and host time between calls).
  • TENSORFOLD_FN_CONFIDENCE sets the head's confidence cut, which defaults to 0.70. Both ranks must read the same value.
  • TENSORFOLD_FN_SPLIT_GRAPHS=1 ends each captured graph at a cross-rank gather, which then runs eager between graph segments. The payload, sum and order are unchanged.
  • TENSORFOLD_FN_CHANCES=step|chain|off sets what the window allocator receives for each held draft. step is the current behaviour.
  • TENSORFOLD_ADMIT_GATHER_MS makes an idle lane host wait briefly so requests sent together share one prompt pass.
  • tf-cuda-test fn-gathers times the partial-sum gathers between the ranks: eager, in one graph, and between split graphs.

Gathers between the two GB10s, fp32 partials (us a gather; eager / one graph / split graphs):

Rows Eager One graph Split graphs
1 (10 KiB) 15.9 25.1 15.4
6 (60 KiB) 37.6 44.3 37.3
16 (160 KiB) 33.1 43.8 34.9

NCCL_GRAPH_MIXING_SUPPORT=0 brings graphs close to eager, but it is unsafe here because we mix graph and eager collectives. NCCL_PROTO and channel settings did not help.

Ruler, int8, 256 tokens, one stream (prose / code / structured / list, tok/s), same image and kernel set:

Build prose code structured list
native-integrate (init fixed) 68.0 105.7 84.7 109.4
v1.0.4 as ported 66.4 107.8 87.4 110.7
v1.0.4 with init fix 67.9 109.2 87.3 110.5
native-integrate + split graphs 72.0 112.1 91.8 115.5

v1.0.4 with the init fix at 16 streams: 300.5 / 506.8 / 386.7 / 525.7. The split graphs at 16 streams were not measured.

The fn-native exactness suite was not rerun on these commits; it is needed before any of the switches is turned on.

…; TENSORFOLD_FN_CONFIDENCE sets the draft cut

Development measures for the draft and round tuning: each call kind's ms a round and the host's time
between calls, logged every that many rounds; the head's confidence cut (0.70) as a knob both ranks read.
The engine is built field by field, so a field's default never applies: the verify timing flag (events around
every step when set) and the counters were whatever the allocator's memory held.
…aits for others to share its prompt pass

Requests sent together arrive a few ms apart; the first, admitted alone, held the rest up for its own prompt pass.
…gather (TENSORFOLD_FN_SPLIT_GRAPHS)

The gathers then run eager between the graph segments, the same work in the same order (the payload and the
sum untouched). fn-native's "split" word runs the exactness checks that way.
… each held draft (step, chain or off)

step (as before): the head's probability given the drafts before it; chain: its chance of landing (the product);
off: no per-node chances, the depth rule sizes chains from acceptance by depth as the Python engine's Flash Next does.
@BobClawblaw

Copy link
Copy Markdown
Owner Author

The split graphs shipped through #9 (merged into native-v1.0.4); the draft knobs were measured and nothing beat the default, so they stay off the branch.

ashhart pushed a commit that referenced this pull request Nov 30, 2026
…dy shaders for ashhart#1544

Rewrites the omarchy-derived Vulkan compute shaders from the behavior spec,
from cast/copy through the gated-delta state machines to the argreduce pair.
omarchy_trig.h becomes vulkan_trig.h (single inv_freq helper, Synthena #6),
gated_delta_prefill_ash becomes gated_delta_prefill_oracle, accepting both
-DASH_QWEN35 and -DORACLE_QWEN35. PRESERVE_F32 requests OpExecutionMode
DenormPreserve (f32) via spirv_execution_mode; sdpa_decode_native pins the
single-key bit-exact V transport (Synthena #7) and the 7168-key shared bound.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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