Skip to content

Flash Next on CUDA: TF_FLASHNEXT_FUSED_SPLIT runs wide split-K decode calls on the fused form - #3475

Merged
ashhart merged 13 commits into
ashhart:mainfrom
BadAd84:flashnext-fused-split-up
Nov 21, 2026
Merged

ashhart merged 13 commits into
ashhart:mainfrom
BadAd84:flashnext-fused-split-up

Conversation

@BadAd84

@BadAd84 BadAd84 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Terms used below: main is upstream TensorFold at d2b3722. The branch is that main plus this one change, on fork branch flashnext-fused-split-up, whose head is a6dc2f2.

What this changes

With TF_FLASHNEXT_FUSED_SPLIT=1, a Flash Next lane call on CUDA that would split K over a cluster and has 2,048 or more output columns runs on qmmf's fused form instead: one block a 64-column tile adds its K slices in the cluster's slice order, so the outputs keep the cluster kernel's bits. Unset, blank or 0, the default, keeps every call on main's kernels; Metal and HIP stop the start on 1 by name, and any other value stops the start.

Problem

On CUDA chips with clusters (sm_90 and later), a lane call of fewer than 256 rows whose K is split runs each K slice in its own block of a cluster, and the first block adds the other blocks' sums through the cluster's shared memory (main's zig/src/cuda/qmmf.zig:85-88 and zig/kernels/cuda/qmmf_body.cuh:253-283). For Flash Next on a GB10 these are decode calls: out_proj and o_proj (MXFP8 [2560, 6144], 8 K slices) and the drafter's 2,560-column BF16 projections.

qmmf already has a fused form, where one block a 64-column tile walks its K slices and adds them in slice order (main's zig/kernels/cuda/qmmf_body.cuh:119-131 and 243-251). The lane takes it only from 256 rows, at row tile 64 (main's zig/src/cuda/qmmf.zig:16 and 86), so on main every split-K lane call of fewer than 256 rows runs on the cluster kernel, at row tile 16, 32 or 64.

Behaviour and how to verify it

TF_FLASHNEXT_FUSED_SPLIT=1, default 0: on CUDA, a Flash Next lane call that would split K over a cluster and has 2,048 or more output columns runs on the fused form instead (this head's zig/src/cuda/qmmf.zig:296-320). zig/kernels/cuda/qmmf.cu gains the fused instances at row tiles 16 and 32, MXFP8 and BF16, bf16 and fp32 out (qmmf.cu:201-214); row tile 64 uses the instance main already has. The fused form adds the slices in the order the cluster adds them, so the outputs keep the cluster kernel's bits. Unset, blank or 0 keeps every call on main's kernels, because the lane's threshold stays 0 (zig/src/cuda/qmmf.zig:145, zig/src/families/flashnext/fused_split.zig:20-22, zig/src/families/flashnext/cuda_prompt.zig:145). Metal and HIP stop the start on 1 by name (zig/src/families/flashnext/engine_load.zig:50, zig/src/families/flashnext/hip/load.zig:396), and any other value stops the start (fused_split.zig:11-13).

How to verify it, and all three ran (results under Receipt):

  • Kernel contract: each fused form against the cluster kernel's K slices at the served shapes and two narrow split shapes, with a planted control (the fused form at a 1.5x tensor scale posing as the cluster kernel).
  • Served exactness on main and on the branch with the setting 1, unset and blank: drafted against "draft": false, resumed against fresh, concurrent against solo, prompt cache on and off, and the branch's replies against main's.
  • Decode, main against the branch with the setting 1 and unset, alternating arms, at 1 to 8 streams, greedy and sampled; cold prompts with tools/bench_cache.py --require-cold.

Scope

CUDA lane calls of fewer than 256 rows, MXFP8 and BF16 weights, 2,048 output columns or more. FP4 and FP8 weights keep their kernels. Passes of 256 rows or more and the prompt tile are untouched. Chips without clusters (sm_80, sm_86, sm_89) never take it. The setting is read by Flash Next only, and stays off by default.

Compatibility, API and security

One new setting, TF_FLASHNEXT_FUSED_SPLIT, exactly 0 or 1, default 0, with a row in docs/environment.md. Unset, blank or 0 keeps main's kernels. No endpoint, default or stored data changes. The qmmf image gains eight kernel instances.

Alternatives

Not measured: thresholds other than 2,048 columns, and the fused form on by default.

Related pull requests

I merged every open pull request that shares a file with this change (223 of the 393 open at 21:34 UTC, fetched from each pull request's head) into this head and into main, with git merge-tree --write-tree, so nothing was checked out or written. Where the two merges differ:

Checks on this head

  • Head commit: a6dc2f2
  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: as the workflow runs it, each tree checked from its own root with this head's copy of the checker, which is byte-identical to main's: the base, main d2b3722 extracted from git, has 6,511 files and 341 problems; this head has 6,513 files and 341 problems; python3 tools/zig/lean_new.py prints lean: 341 problems, 341 on the base, 0 new. The head's two extra files are zig/src/families/flashnext/fused_split.zig and zig/src/core/contract/lane_fused_records.zig. The same pair on the aarch64 machine under Tests gives the same counts and the same 0 new. python3 tools/pr_check.py --base main on this head prints merge base d2b37227a8b4431a71d87bf093786aadcfa35b62; 23 changed files; lean 341 vs 341, 0 new and 0 error(s), 0 warning(s) with --pr 3475, now that the CHANGELOG.md line names this pull request.
  • Tests run, with the command and pass, fail and skip counts: on 62b2817, which differs from this head by one changed line of CHANGELOG.md (the pull request number in the entry) and the trimmed docs/receipts/flashnext-fused-split/limits.txt, the no-GPU workflow's steps, natively on an aarch64 Ubuntu 24.04.5 machine (an NVIDIA GB10's 20 CPUs, Zig 0.17.0, -j8 --maxrss 6000000000, umask 022 as on the workflow's runner, no GPU visible to the tests), one zig build at a time, on fresh git archive trees of this head and of main, each checked file by file against its commit (11,637 and 11,628 files; none missing, extra or different):
    • zig build -Dfixed-cpu test-gradient-serving test-qwen-serving-host: exit 0, 7 of 7 steps, 3 of 3 tests; on main the same. No re-pin was needed: main changed none of the 169 pinned files between 964174e and d2b3722.
    • zig build -Dfixed-cpu test-gradient-serving test-environment-host test-env-defaults-host test-flashnext-fused-split-host: exit 0, 16 of 16 steps, 144 of 144 tests.
    • zig build -Dfixed-cpu test-kernel-contract: exit 0, 32 of 32 steps, 242 of 242 tests.
    • zig build compile-config-server -Dtarget=aarch64-linux-gnu: exit 0, 7 of 7 steps; zig build compile-cuda-tests -Dtarget=aarch64-linux-gnu: exit 0, 10 of 10 steps.
    • zig build -Dfixed-cpu test-host --test-timeout 20m: exit 1 on this head, 2,090 of 2,095 steps and 14,865 of 14,968 tests passed, 102 skipped, 1 failed; exit 1 on main, 2,087 of 2,092 steps and 20,467 of 20,606 tests passed, 138 skipped, 1 failed. The one failure is the same on both, listener.zig's "accepted IPv4 and IPv6 TCP streams disable Nagle for incremental responses", because this machine boots with ipv6.disable=1. The head's three extra steps are test-flashnext-fused-split-host's; the test totals differ because the head's run came after its other steps, so binaries those had run report as cached.
    • zig build -Dfixed-cpu test --test-timeout 10m: exit 1, 715 of 718 steps and 9,635 of 9,714 tests passed, 78 skipped, 1 failed, the same IPv6 test.
    • zig build -Dfixed-cpu test-golden: exit 0, 5 of 5 steps, 322/335 equal to server goldens, 0 unexpected differences and 55/55 equal to server goldens, 0 unexpected differences.
    • zig build -Dfixed-cpu test-server-security test-pull-security: exit 0, 14 of 14 steps, 47 of 47 tests. zig build -Dfixed-cpu fuzz-cortheon: exit 0, 3 of 3 steps, 23 of 23 tests. zig build -Dfixed-cpu check-release-paths: exit 0, 10 of 10 steps.
    • zig fmt --check build.zig zig: exit 0, no output. git diff --check main against this head: exit 0.
    • The workflow's Python steps on this head: python -m unittest discover -s tools/tests -p "test_bench*.py" -v, 149 tests OK; the same with -p "test_evidence*.py", 32 OK; tools/zig/cuda_common_check.py and tools/zig/cuda_fragment_check.py, exit 0, and cuda_common_check_test.py, 9 OK; build_options_test.py, 5 OK; flashnext_batch_serve_test.py, 8 OK. In place of pytest, stdlib unittest discovery gives the same results on main and on this head: tools/zig 188 tests with 2 failures and 10 skipped, tools/tests 267 OK and tools 41 OK. The two failures are the same on both, zig_cache_restat_test's test_only_a_real_change_misses and test_prune_keeps_one_build, the CI cache tool's own tests, which the workflow runs only when that tool changes.
    • Mutants, zig build -Dfixed-cpu test-flashnext-fused-split-host on a copy of this head: 3 of 3 tests pass unmutated, and each of five planted defects makes it fail, 2 of 3 passing: the reader's off value giving the threshold, a malformed value read as off, the Metal refusal removed, the HIP refusal removed, and the CUDA lane never reading the setting. Each anchor matched exactly once, the file was restored byte for byte after each, and the restored copy passes 3 of 3 again.
  • CI on a6dc2f28e2 (this head), run on this pull request: fmt, zig, zig-windows, pytest, benchmark-clients (ubuntu and windows), release-paths and zig-macos-dev-tools all completed successfully; host-nightly-linux and host-nightly-macos are skipped by their own conditions.
  • Not run, and why: the release chips other than GB10: sm_80, sm_86 and sm_89 have no clusters, so their plans never take the fused form, and sm_120, the other release chip with clusters, was not run; Metal and HIP refusing 1 is covered by host tests, not on that hardware. Of the workflow: the zig-windows job and the Windows leg of benchmark-clients, because the only Windows machine here does not compile (the four zig-windows steps ran on Linux above); zig-macos-dev-tools, for want of a macOS machine; the two NFKD steps, which need Python 3.14 where the machine has 3.12 (this change touches no NFKD file); and pytest itself, which the machine does not have (stdlib unittest discovery stands in for it above). Every zig step ran on aarch64, where the workflow's ubuntu-latest runner is x86_64. "Restored cache regressions" and "Host test graph regressions" skip themselves on this head: none of their inputs changed (git diff --quiet exit 0 for both).

Receipt

Full receipt: docs/receipts/flashnext-fused-split/ (README.md, rule5.md, cells.csv, prompt.csv, exactness.md, contract.txt, limits.txt).

  • Main against branch: one GB10, one fresh server an arm, alternating M1 F1 U1 M2 U2 F2, where F is the setting 1 and U is unset, --parallel 8, 32,768-token window, bf16 KV, prompt cache on; tools/bench_openai.py greedy at one stream and tools/bench_concurrent.py --alone --serial at 1, 2, 4, 6 and 8 streams, greedy and temperature 1.0 with seed 1234, 256 tokens, 3 reps. With the setting 1, decode is 1.0 to 1.8% faster than main in 14 of 22 cells and level in the other 8 (+0.2% to +0.9%). No cell is slower. The five cells over 1.5% are all at 6 and 8 streams: greedy code 313.0 and 311.5 against 307.6 and 306.7 tok/s (+1.7%) and 378.1 and 377.4 against 371.8 and 371.6 (+1.6%); greedy chat +1.8% at both, 212.8 and 212.7 against 210.0 and 208.1 at 6 and 260.5 and 260.3 against 257.2 and 254.2 at 8; temperature 1.0 code +1.8% at 8, 187.4 and 187.0 against 184.8 and 182.8. Unset, the branch is level with main in 21 cells and reads +1.1% in one (temperature 1.0 chat at one stream), so the cells near 1% are at the edge of the noise. Tokens a round are main's in every cell.
  • Boxes it reaches: CUDA lane calls of fewer than 256 rows that split K over a cluster and have 2,048 or more output columns, MXFP8 and BF16 weights, at row tiles 16, 32 and 64. On this checkpoint: out_proj and o_proj (MXFP8 [2560, 6144], 8 K slices) and the drafter's 2,560-column BF16 projections.
  • New switch? TF_FLASHNEXT_FUSED_SPLIT, default 0 (off), accepts exactly 0 or 1 (unset or blank is 0, anything else stops the start), row in docs/environment.md. Not in a profile.
  • Environment, with the TensorFold commit, Zig and backend toolchain, machine and GPU, checkpoint and revision: main 41a72fd and branch commit 4df765a (that main plus the change, its first receipt, its launch records and its host-test step), each built from its own commit with zig build -Dnvcc=/usr/local/cuda/bin/nvcc -Doptimize=fast fatbins install native in nvcr.io/nvidia/pytorch:26.07-py3: Zig 0.17.0, nvcc 13.3 (V13.3.73). One NVIDIA GB10 (sm_121), driver 580.178.04, Ubuntu 24.04.5 LTS, 128 GB unified memory. nvidia/Qwen3.8-Flash-Next-FP4-Local at revision b9ce18a6887e18c089fdea8509a33e63429a3300, with its MTP drafter. Server: tensorfold-native serve CHECKPOINT --context 32768 --parallel 8 --max-tokens 32768 --temperature 1.0 --top-p 0.95 --top-k 20 --thinking --kv-cache bf16. Of the settings main reads, two differ from main's defaults, the same in every arm: TF_FLASHNEXT_WARM_AHEAD=1 and TENSORFOLD_MEMORY_RESERVE_GIB=9.
  • Why those numbers describe this head, so the receipt was not retaken: every file that differs between the measured branch commit 4df765a and this head is either one of the seven receipt files or one of the 111 files main changed between 41a72fd and d2b3722 (git diff --name-only). Of those 111, this change touches two, CHANGELOG.md (other changes' entries) and docs/environment.md (another setting's row), and no file of the fused split-K path moved: zig/src/cuda/qmmf.zig, zig/kernels/cuda/qmmf.cu, zig/kernels/cuda/qmmf_body.cuh, zig/kernels/cuda/common/qmm_frag.cuh, every file under zig/src/families/flashnext/, zig/src/platform/environment.zig, zig/src/core/contract/registry.zig and registry_joins.zig, the two contract tests this change edits (zig/tests/cuda/contract_lane_half.zig and contract_tests.zig) and the gradient-serving fixture are byte-identical at 41a72fd and d2b3722. Three of the 111 are on a Flash Next CUDA request's path. zig/kernels/cuda/common/fp_pairs.cuh, which most CUDA kernel sources include through common/qmm_frag.cuh, qmmf.cu among them, gains fp4pair_nz5, which only nvfp4_experts32.cu, a GLM kernel, calls; built twice with the build's own nvcc arguments for sm_121 (nvcc 13.3.73 in nvcr.io/nvidia/pytorch:26.07-py3, the compiler and image the receipt names), once from 4df765a's kernel sources and once from this head's, qmmf.cu's fatbin is byte-identical, 2,524,216 bytes and 98 functions both times. zig/src/core/lane_host.zig and zig/src/core/lane_host_end.zig add a cancelled request's work to the load ledger's counters, which launches nothing and changes no token. The other 106 belong to other families, Metal, the pull commands, tests, tools, docs, or server features these boots did not use (image URLs, --slide, --compact-memory).
  • Paths and platforms the change reaches, which I ran and which I could not: the CUDA lane's split-K calls under 256 rows when the setting is 1 (this head's zig/src/cuda/qmmf.zig:296-320). Unset, blank or 0 changes no launch. Ran: GB10 (sm_121) only. Not run: sm_120, which has clusters and would take the fused form; sm_80, sm_86 and sm_89 have no clusters, so their plans never take it; the release fatbin set is sm_80, 86, 89, 120 and 121, so no other chip's build is part of a release. Metal and HIP refuse 1: host tests, not run on that hardware.
  • Exactness, from tools/bench_concurrent.py --alone --serial or token_sha against "draft": false: every equality holds in every arm, and the branch's replies equal main's in every comparison. On main and on the branch with the setting 1, unset and blank, each with the prompt cache on and off: drafted equals "draft": false (2/2 serial hashes greedy, 16/16 at temperature 1.0, 6/6 golden, 8/8 drafted replies' token ids with the cache on and 8/8 with it off), a resumed prompt equals a fresh one (7/7 turns, and bench_cache's repeated and concurrent requests equal the first in 4 of 4, 1 cold and 3 reused), and concurrent equals solo (90/90 greedy, 90/90 at temperature 1.0, 21/21 golden at 1 to 6 streams, 12/12 serve_check). serve_check's own lines report 15 ok and 0 failed in every arm. The branch's own replies against main's: 32/32 concurrent and serial hashes, 8/8 golden, 8/8 plus 8/8 drafted replies' token ids, and 7/7 first and 7/7 resumed turns, in every arm.
  • Main against this branch, same machine and checkpoint, posted before asking for a run on our machines (or why you can't): the numbers above and the receipt, all from one GB10.
  • Decode speed before and after, from tools/bench_openai.py: one stream, greedy, 256 tokens, 3 reps: code 72.5 and 72.4 tok/s on main against 72.7 and 72.6 with the setting 1 (+0.3%, level) and 72.6 and 71.7 unset; chat 46.6 and 46.5 against 46.7 and 46.6 (+0.2%, level) and 46.5 and 46.0 unset.
  • Prompt speed before and after: the cold first request's ttft_s from tools/bench_cache.py --require-cold, prompt cache off, --parallel 1 and a 131,072-token window, at 2,048, 8,192, 32,768 and 65,536 tokens (zig/tests/cuda/flashnext/lr7/long12k.ids repeated and cut). Medians of each arm's three cold requests: level at every length, -0.4% to -0.6% against main with the setting 1 and -0.4% to -0.7% unset; at 65,536 tokens 29.387 and 29.746 s on main against 29.409 and 29.448 s. On first requests alone, 8,192 and 32,768 read faster on both branch arms (-12.8% and -2.5% with 1, -12.8% and -2.2% unset) because main's first arm took 4.417 and 14.853 s on its first requests at those lengths; the unset arm runs main's kernels, so that is not the change. None of these prompts has a pass under 256 rows, the only passes the setting reaches.
  • Licence of any new weights or drafter, or "n/a": n/a, no weights or drafter.
Kernel contract, only when a GPU kernel is new or changed
  • Kernels registered with the contract, and the kernel each one replaces: "cuda MXFP8 lane split-K calls on the fused form" and "cuda BF16 lane split-K calls on the fused form", each with bf16 and fp32 out, replacing the cluster kernel's K slices (zig/tests/cuda/contract_lane_half.zig:23-52); served shapes 1, 7 and 17 rows x 2560 x 6144 and 40 x 2560 x 5120, and the narrow split shapes 5 x 640 x 2560 and 16 x 324 x 10240, at row tiles 16, 32 and 64. Launch records for the eight new instances are in zig/src/core/contract/lane_fused_records.zig.
  • A planted control for each new kernel, and each one fails as planted: the fused form at a 1.5x tensor scale posing as the cluster kernel, bf16 and fp32 out; each differs from byte 0 at 1x2560x6144, and both show red.
  • Each backend's SUMMARY line and exit status: CUDA on the branch's image (GB10, sm_121), tf-cuda-test kernel-contract "fused form" "half tiles": (filtered) SUMMARY 8 kernels: 8 pass gates 1-4, 0 fail, 0 known findings; 4 controls: 4 red as planted, 0 missed; 0 limit problems; gates 10632 ms, limits 0 ms, exit 0. The five-SM limits run (tf-cuda-test kernel-contract-limits over fatbins for sm_80, 86, 89, 120 and 121 built from 120123a by nvcc 13.3.73, limits.txt): INFO limits fatbins: images built by nvcc 13.3, checked against nvcc 13.3's records, 5,345 per-SM checks pass, 2,567 are below the chip's minimum, both controls red on all five SMs, and FAIL kernel-contract-limits: 834 problems, exit 1. Each problem is another launch's record for nvcc 13.0 that nvcc 13.3 compiles differently; this change's eight report record current on all five SMs, as do the 64-row fused instances a row-tile-64 call uses.
  • Chips I could not run: sm_80, sm_86, sm_89 and sm_120. Metal and HIP: no new kernel.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
  • No precision traded for speed. If the bits change, the description says which sums change and why.
  • Decode and prompt processing are no slower than main at one stream and the widest admitted; with --drafter, no slower than without it, greedy and sampled

@ashhart

ashhart commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Thanks @BadAd84, this is a careful first PR, and the write up is easy to follow.

We read the diff against main and ran the host side here. With the setting unset, blank or 0 the lane's choice reduces to main's expressions exactly, so no launch changes, and the new test-flashnext-fused-split-host step and the serving pin pass. The eight launch records and the four planted controls are in, and the filtered summary shows them green. Files are under the line, the lean check adds nothing, and the diff applies to today's main.

The exactness receipts read as we hoped: drafted equals "draft": false, resumed equals fresh, concurrent equals solo, and the branch's replies equal main's with the setting on. Under our rule that every change keeps every token, that is the bar, and your receipt meets it. The gain is real but narrow: level at one stream and about 1.6 to 1.8 percent at six and eight streams, so as an opt in it earns its keep at concurrency and costs nothing elsewhere.

CI is green at this head. One thing before it can queue: docs/receipts/flashnext-fused-split/limits.txt is 9,511 lines. Please drop the full listing and keep the summary lines and the failures only, the same shape as your other receipt files.

We will run the device check on our side once those are in.

  • Synthena (Ash's Agent)

@BadAd84

BadAd84 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. limits.txt went from 9,511 lines down to 264 in one new commit on top of the head you read (8ebb88cc15), nothing force-pushed. The new head is a6dc2f28e2.

It keeps the build line, the info line, a one-line summary of the counts, the 10 planted control lines, the 2 FAIL lines and the exit status, this change's launch lines (8 launches on 5 SMs, 40 lines, all record current) and the 834 stale records grouped by launch name (207 launches, with the SMs each one fails on). The per-SM PASS, N/A and RECORD lines that carried no finding are dropped; the tool prints them again every run.

The numbers in the description don't change: 5,345 checks pass, 2,567 are below the chip's minimum, both controls are red on all 5 SMs, and the run ends FAIL kernel-contract-limits: 834 problems. I will update the description to the new head and its CI result once the checks have run.

@ashhart

ashhart commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Thanks @BadAd84. The full listing is gone. The shortened receipt retains the summary, failures, controls, all forty records for the changed launches and the grouped stale records, including the failing exit status. That answers the remaining request; the new commit changes no runtime code.

Our GB10 check is still owed for unset, blank, 0 and 1, including seeded replies, shared streams and resumes. The off cases must keep main's behavior, and the enabled case must preserve every output byte and complete reply. The setting remains off by default.

  • Synthena

@ashhart

ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Thank you @BadAd84. The shortened limits.txt keeps the build and info lines, the summary, the 10 controls, the 40 changed-launch records, the grouped stale records and the failing exit status, so that last request is answered. The new commit changes no runtime code.

Nothing further is needed from you. We still owe the GB10 check here, covering unset, blank, 0 and 1 with seeded replies, shared streams and resumed prompts; the off arms must match main and the enabled arm must keep every output byte and complete reply. The setting stays off by default. We settle the two documentation line placements on our side at landing.

  • Synthena

@AIFlowML

Copy link
Copy Markdown
Contributor

On M5 Max with Zig 0.17.0, zig build test-flashnext-fused-split-host test-moetile-host test-gradient-serving -Dcpu=apple_m1 -j5 --summary all passed 27 tests at 33fba31c. I trial-merged against 124052c97 and kept both loader checks in Metal and HIP: main's TF_FLASHNEXT_READOUT_FUSED refusal and this PR's TF_FLASHNEXT_FUSED_SPLIT refusal.

There is one follow-on test failure at that merge even though the two files with conflicts are resolved. test-environment-host passes on each side, but the combined registry has 24 Flash Next switches while environment_flashnext_test.zig still expects 23. Updating it to 24 switches (35 settings total) gave 55/55 passing tests across the environment and original targets, and compile-flashnext-legacy-host and check-native-hip-host both compiled. The host test-kernel-contract passed on the scratch merge as well. This checks the landing changes. The GB10 serving matrix is still a device check.

Igor Lessio - AIFLOW LABS

ashhart and others added 13 commits November 21, 2026 23:54
…alls on the fused form

With TF_FLASHNEXT_FUSED_SPLIT=1, a lane call that splits K over a cluster and has 2,048 output columns or more runs on
the fused form instead: one block a 64-column tile walks its K slices and adds them in slice order, the order the
cluster adds them, so the outputs keep the cluster kernel's bits. qmmf.cu gains the fused instances at the decode row
tiles 16 and 32 (MXFP8 and BF16, bf16 and fp32 out); row tile 64 already had one.

Unset, blank or 0 leaves cuda.qmmf.fuse_split_n at 0 and every lane call on main's kernels. Metal and HIP stop the
start on 1 by name. The kernel contract gains the fused form against the cluster kernel's K slices at served and
narrow split shapes, with a control that poses a 1.5x tensor scale as the cluster kernel.
…le and tokens a round

Main against the branch on one GB10, alternating M1 F1 M2 F2, one fresh server an arm: 0 of 22 cells slower, greedy
code faster outside the noise at 6 and 8 streams (+1.7% and +1.5%), the other 20 level, tokens a round main's in every
cell. Exactness holds on main and on the branch set to 1, unset and blank, and the branch's replies equal main's.
The changelog line goes under a new Unreleased section.
… row tiles 16 and 32

registry.cuda gains the eight fused instances (MXFP8 and BF16, bf16 and fp32 out) with nvcc 13.0.88's registers,
static shared bytes and launch bounds for sm_80, sm_86, sm_89, sm_120 and sm_121, read from a five-SM qmmf fatbin with
the contract's own cubin reader. nvcc 13.3 compiles them to the same usage, so no later set needs an override.
…sts, and zig build test reaches them

The three tests of TF_FLASHNEXT_FUSED_SPLIT's reader, its CUDA threshold and the Metal and HIP refusals had no build
step. They now have their own, test-flashnext-fused-split-host, which the test step depends on, as the RoPE refusal
tests beside it do.
…unset as a third arm

Main against the branch commit 4df765a on one GB10, both built the same way from their own commits, alternating M1
F1 U1 M2 U2 F2 with one fresh server an arm. With the setting 1: 14 of 22 decode cells faster (+1.0% to +1.8%), 8
level, 0 slower; unset: 21 level and 1 at +1.1%. Tokens a round are main's in every cell. Cold prompts of 2,048 to
65,536 tokens are level. Exactness holds on main and on the branch set to 1, unset and blank, and the branch's
replies equal main's. The changelog line takes the new numbers.
A fatbin set for sm_80, sm_86, sm_89, sm_120 and sm_121 built from
120123a by nvcc 13.3.73, then tf-cuda-test kernel-contract-limits over
it: the eight launches this change adds report record current on all five
SMs, both planted controls go red on all five, and the run's 834 problems
are other launches' nvcc 13.0 records that nvcc 13.3 compiles differently.
limits.txt is its output; the README says what the run proves and what it
does not, and records main 964174e as merged, which moves none of the
files the measured arms ran on.
…2b3722

The receipt's source section names both merges of main, 964174e at
120123a and d2b3722 at 1e24f26, and says what main changed between
41a72fd, where the arms ran, and d2b3722: 111 files, of which this
change touches CHANGELOG.md and docs/environment.md, and three are on a
Flash Next CUDA request's path (fp_pairs.cuh gains a function only
nvfp4_experts32.cu calls; lane_host.zig and lane_host_end.zig count a
cancelled request's work in the load ledger). No file of the fused split-K
path moved, so the arms describe both merges.
Follow main 85048e5 (decode linears
as weight-first dependent launches). Keep its PDL launch field and
shared grid-launch/wait body beside the new fused decode instances.
Retake only the two merged source identities, retaining both notes.
Preserve main 85048e5 (weight-first dependent lane launches) and e9ee738 (Flash Next CUDA ownership/readbacks). E155 requires every other family's scheduling to remain main's: the incoming process-global threshold could otherwise affect a different lane after Flash Next enabled it.

Keep the threshold on each qmmf.Lane with default 0 and set only Flash Next's own loaded native_lane, after the same early validation. Retain the original predicate, kernel math, threshold 2048, startup refusals and PDL geometry. Record actual dispatch isolation through the existing host step and initialize the new default in the two partial mock lanes that dispatch; do not change their workloads.
@ashhart
ashhart force-pushed the flashnext-fused-split-up branch from f75b714 to 4c89de7 Compare November 21, 2026 23:54
@ashhart
ashhart merged commit 308d5e1 into ashhart:main Nov 21, 2026
7 of 12 checks passed
@ashhart

ashhart commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Thank you @BadAd84. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

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.

3 participants