Repository navigation
Conversation
On applegpu_g13, tiles of more than 8 rows at 16 or 8 K splits in grids of at least 512 threadgroups launch at most 4 simdgroups. Chunk partials are reduced by chunk index in a fixed tree, so the bits are unchanged.
Closed
Owner
|
Thank you, @mrv777. We'll carry this on 1.1.2: the M1 launch cap keeps the chunk-indexed partials and fixed reduction tree, while the 512-threadgroup floor leaves smaller grids alone. We'll cite your M1 Max checks and single-kernel timings; checkpoint throughput and serving remain unmeasured. Posted by Ash's AI Assistant Synthena |
ashhart
added a commit
that referenced
this pull request
Oct 21, 2026
…dits The 1.1.2 section had no entries for the contributed pull requests carried into this release, so neither their changes nor their authors reached the release notes. Add an entry for each, written from its commits: Flash Next's CUDA prompt tiles and structured output (#1046, #1062), --thinking-reserve, the long-loop guard and the --vision template diagnostic (#1064, #1075, #1076), GLM's Metal eh_proj tile and CUDA waiting ranks (#1066, #1053), M1's simdgroup cap (#1055), Nemotron's CUDA image and shared-window fixes (#1057, #1058), Qwen's live-row expert routing (#1047), the shared CUDA operators and contract fixture (#1056, #1068, #1070, #1071, #1073), the ROCm receipt, drafter and draft-count work (#1043, #1044, #1045), the ModelOpt recipe numbers (#1042), the Windows host build (#1034) and the session store's allocation-free rollback (#637). Thank #643's and #1060's reporters as the other entries thank theirs.
Owner
|
The M1 simd_qmm_bits adjustment is included in 1.1.2 (https://github.com/ashhart/TensorFold/releases/tag/v1.1.2), with your original authorship retained. Eligible large 16-row grids use at most four simdgroups. Closing this as carried, and thank you. It landed as f540d82. - Synthema, Ash's AI Assistant. |
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.
On M1-family GPUs (
applegpu_g13),simd_qmm_bitsnow launches large grids of 16-row tiles with at most 4 simdgroups instead of up to 16. "Large" means rt 2 (more than 8 rows), 16 or 8 K splits, and at least 512 threadgroups. Only the launcher changes: no shader, arithmetic, pipeline, binding or grid change. Small grids, rows 1–8, the scalar twin,simd_qmmand every other GPU generation keep today's launch.The outputs cannot change.
tf_sqw_mmagives K chunkcto simdgroupc mod SGS, keeps each chunk's partials atred[c]and sums chunks0..S-1by a fixed tree. Every rounding happens in the same order for any simdgroup count.The 27B's raw matrices take this path before tensor units (oQ2's 2/64 matrices and mixed oQ4 stack members), in prompt chunks and multi-row rounds. So do Nemotron's non-4/64 prompt chunks.
On M1 Max, I measured automatic dispatch: each tree's own
call()linked into one binary, run on identical synthetic inputs. Each round ran base, candidate and base again in rotated order, 15 rounds of 20 launches, streaming about 100 MiB of weight copies. Across 37 shapes:These are single-kernel timings. Prompt and decode throughput on a real checkpoint are unmeasured.
The 512-group floor comes from the same measurements. Grids of 20–128 groups (n ≤ 64, or n = 1024–2048 at 16–32 rows) were up to 46% slower at 4 simdgroups, 192 groups was neutral, and 232 or more was faster. 512 is at least 16 groups per core on this 32-core GPU and at least 8 on a 64-core M1 Ultra. Reserving 512 threads for the three tile pipelines that compile below 512 here was bit-exact but 0–5% slower, so I dropped it.
Validated on M1 Max, macOS 26.7, Zig 0.17.0,
-Dcpu=apple_m1, againstd46d17a7:Direct launches: every simdgroup count from 1 to the pipeline's limit, and every legal tile width, matches the launcher's own bits. That's 1,064 shapes: 2- to 8-bit and
simd_qmm, n 8–6176 across the 32/16/8-split boundaries, k down to fewer groups than splits, rows 1–33. 1.11 billion values were compared, guard bytes stayed intact and inputs were unchanged. Outputs meet an independent float64 reference within the gate-3 bound (worst 0.992 of it). Two planted shaders fail: one dropping a K chunk when SGS < S, and one ordering the tree by SGS.tf-qwen27-widths: the same PASS on both trees, 10,575,872 values within 0.4815 of the float64 bound, and 1,516,773,088 bit-equal pairs.tf-kernel-contract:--only simd_qmm_bits:SUMMARY 3 kernels: 3 pass gates 1-4, 0 fail, 0 known findings; 0 controls: 0 red as planted, 0 missed; 0 limit problems--only "metal ":SUMMARY 24 kernels: 24 pass gates 1-4, 0 fail, 2 known findings; 0 controls: 0 red as planted, 0 missed; 0 limit problems--only control:5 controls: 5 red as planted, 0 missedNo launch is added or raised.
zig build test test-golden: the only failure on both trees iscore.paced_read"aligned spans copy the bytes asked for", which fails the same way at the baseline. Goldens differ only where recorded as known.Formatting and lean:
zig fmt --checkpasses. The lean checker reports 503 problems on both trees, zero added.On M1–M4, an unfiltered
tf-kernel-contractstops at the Gemma-4 entries (TensorUnitsRequired), at the baseline too. That's why the summaries above come from filtered runs. CUDA is not affected and was not run. Untested: M1, M1 Pro and M1 Ultra (the same generation, assumed alike); M2–M5 (unchanged by design); real checkpoints; serving.