Repository navigation
perf(flashnext): 6- and 8-bit row products take 2 outputs a simdgroup - #2593
Merged
Merged
Conversation
Owner
|
Neither blocks: it goes on our landing queue now, and the CHANGELOG line is ours. |
Products that read 8 values a lane step (6 and 8 bits) ran 4 outputs a simdgroup in the loop and four-row kernels (the MMA twin does not read it). At 2-4 rows that left a 6144 -> 2560 product at 640 simdgroups, about 11 a core on a 60-core M3 Ultra, too few to hide DRAM latency. At 2 outputs each sum is computed the same way, so output bits are unchanged; 4/32 products keep 4 and other widths keep rps. The kernels already ran these widths at 2 outputs when n % 4 == 2. rows_load references rows_w from a test block so rows_w's tests run in the engine suite; before this the existing merge test there was not compiled into any test binary. rows-time also times the 2560 x 6144 product at 8 bits. Refs ashhart#2553
ashhart
force-pushed
the
pr/flashnext-q8-two-outputs
branch
from
November 9, 2026 05:50
82d9d1c to
c855416
Compare
Owner
|
Thank you @abm9111. 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. |
Contributor
Author
|
Thank you for the review and for landing it. Glad it's useful. |
ashhart
added a commit
that referenced
this pull request
Nov 10, 2026
Figures corrected to the PRs' measured ones (#2699 head runs, #2509, #2633, #2436, #2644, #2593, #2430, #2568), scope fixed (#2253, #2287, #2511, #2569, #2337, #2627, #2351, #2626), unsourced figures dropped (#2181, #2606, #2257's pricing clauses), the shipped #2176, #2565, #2548 and gfx12 silu entries and the first #2625 copy removed, and the #2568 and #2352 entries unwrapped to one line each.
Owner
|
Thanks @abm9111! This is in TensorFold 1.2.6, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.6
|
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.
Fixes #2553
Products that read 8 values a lane step (6 and 8 bits) ran 4 outputs a simdgroup in the loop and four-row kernels
(the MMA twin does not read it). At 2–4 rows that left a 6144 → 2560 product at 640 simdgroups, about 11 a core on a
60-core M3 Ultra, too few to hide DRAM latency. This gives those widths 2 outputs a simdgroup (1 at an odd width), as
suggested in #2553 (
vpt(p.bits) == 8). Each output's sum is computed the same way at any count, so output bits areunchanged; 4/32 products keep 4 and other widths keep
rps. No kernel source changes: the kernels already ran thesewidths at 2 outputs for n % 4 == 2.
rows_load.zignow referencesrows_wfrom a test block, sorows_w.zig's tests run in the engine suite. Beforethis, the existing merge test there was not compiled into any test binary (a planted failing assertion in that file
still passed
zig build test); it passes now.rows-timealso times the 2560 × 6144 product at 8 bits.Exactness
tf-flashnext-widthsin full, main a07e56f and this branch:PASS 4486 checks: every product within 0.9947 of its float64 bound, every row's bits equal in every windowon both, the two outputs identical line for line. ItsRESULT lines include windows of 1, 2, 3, 4, 5, 8, 9, 16, 17 and 33 rows for every width.
rows_w.zig): passes here; with main's line, or with the change limited to 8 bits, it failsexpected 2, found 4.Kernel timing
tf-flashnext-widths rows-timewith the GPU free, main → branch → branch → main, rows µs (both runs each):Every other row count (8, 9, 16: the MMA twin) and every other width moved at most 1.2% (median 0.0%). The 1-row 16,480 × 2,560 6/32 product that ran 3–7% slower in #2553 is level here.
Served decode and concurrency
tools/bench_openai.py --tokens 256 --reps 3 --temperatures 0, main → branch → branch → main, medians in tok/s:out_projand most non-expert weights 6-bit)out_projat 8 bits; not published)tools/bench_concurrent.py --levels 1,4 --alone --serialon the published pack: code 148.7 → 157.3 tok/s at one stream and 137.7 → 145.3 aggregate at four; chat 126.8 → 134.4 and 117.4 → 123.5; every reply equal to its run alone (30 and 30) and to"draft": false(4 and 4), 0 unequal or failed.Checks
python3 tools/zig/lean_check.py: 116 problems on main and here, 0 new.python3 tools/pr_check.py --base origin/main --pr 2593: 0 errors and 1 warning, for the missing Unreleased line; 1.2.5 renamed that section after this branch was cut, so the line is left for the release notes. It ran with git's stdin fed from a temp file: on this Mac the script as written hangs ingit cat-file --batch, with git blocked writing a full stdout pipe while Python waits to write the rest of its stdin.atc overlap --json --base origin/main: incomplete on this repository (over 200 open PRs,timeLimit), with no overlapfound; checked directly as well: none of the 201 open PRs touches these three files, and the branch merges cleanly into
main at 8be9c40.
zig build test test-golden -Dcpu=apple_m1: on this commit Zig re-ran the 1,821 tests the change reaches: 1,785 passed, 35 skipped, 1 failed; the full suite on an earlier revision of this branch passed 11,660 of 11,753 (7 more than main, rows_w's tests now compiled in) with the same failure. That one failure also fails on main a07e56f on this Mac:families.nemotron.prefill_kernels.test.every prompt-chunk source compiles at this macOS's Metal language(use of undeclared identifier 'nemo_paged_row').Setup
Mac Studio, Apple M3 Ultra (60-core GPU), 256 GB, macOS 27.2 (26B123), Zig 0.17.0,
zig build native -Dcpu=apple_m1. Server:serve <checkpoint> --host 127.0.0.1 --port 18234 --name local-model --no-thinking --prompt-cache-gib 0 --no-update-check, one model process, nothing else on the GPU. Only this M3 Ultra was measured.