Skip to content

Vulkan: qmm_q4_vec4 reads the 4-bit projection 16 bytes at a time, 34.8% to 43.0% less run time on an M1 with the same logits (stacked on #1544) - #1990

Open
joshuaswarren wants to merge 114 commits into
ashhart:mainfrom
joshuaswarren:vulkan-qmm-vec4
Open

joshuaswarren wants to merge 114 commits into
ashhart:mainfrom
joshuaswarren:vulkan-qmm-vec4

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1544. Above #1544's branch (a989a7b87, the 43 commits this branch also carries, plus one fix commit 040a4fb0) this PR adds, in order: the vec4 kernel and its selection (e5fa7c5f), its kernel contract registration (9297100c), receipts and the changelog line (6cbbc58d, 814522b6, 27df9a06), the oracle rename and header fixes (64e13512, 6116cb71), the float32 activation port for layers 0 to 3 (a35df20a, efa50978, 08315a1a, a33db616, 4983a411, 411cbc1e, 774c1789), the --backend flag listing only the choices this build serves (35175560), the credits page (1d1ae16d), and the merge of #1544's fix commit (59145cf8). main is merged in at 46571f11; the one conflict was a CHANGELOG.md hunk and both entries are kept.

On a 13-inch Apple M1 with Honeykrisp, a Qwen3.5-2B 4-bit run took 34.8% to 43.0% less time than the same build with the scalar kernel selected, on three inputs. The logits are byte-identical. These figures are from the float32-fixed head on Linux 7.3.0-2-20261110.1-lab-ARCH and Honeykrisp from the Omarchy Mesa build (library sha256 d75f4cbc). The old arm is this head built with the vec4 selection forced to the scalar kernel (qmmVariant = .scalar in ops_q4.zig, not committed): the float32 fix sits above the vec4 commits, so an older #1544 build would not carry it. The first version of this description gave 40% to 52% against #1544's head, measured on earlier builds with Linux 7.1.12-2-20261013.18-sep-ARCH and Mesa git-9323171c12. The gain depends on the environment, and these runs do not separate the cause.

Input Old run 2 New run 2 Gain, median (range) Logits digest
24-token prompt (unicode-24), context 512 15.6 s 10.2 s 34.8% (34.6 to 35.2), three pairs e946185d64ae
256-token document, context 512 40.4 s 23.8 s 41.0% (41.0 to 41.0), three pairs 3188aaae7d11
1,024-token document, context 1536 123.0 s 70.1 s 43.0% (43.0 to 43.0), two pairs 82c353787e89

Run 2 is the prefill plus 63 decode steps plus the per-step logits readback. It is not decode-only, so do not read these as decode ms per token. All processes of a case wrote the same logits digest, in both arms. The 1,024-token case has two pairs, not three: the scalar arm takes about 250 s a process. I did not re-run the identity probe or the kernel contract on the fixed head; their output is from the earlier builds.

Second chip: 16-inch M1 Max

The same three-pair protocol on an Apple M1 Max (G13C), same old and new builds, order old, new, new, old, old, new, run-2 gain per pair.

Case Old to new, run 2 Gain, median (range) 13-inch M1
unicode-24 10.5 to 10.9 s -3.5% (-6.0 to 6.6) 34.8%
document-256 15.1 to 13.9 s 11.7% (7.5 to 14.3) 41.0%
document-1024 42.0 to 26.8 s 36.2% (36.0 to 36.7) 43.0%

On this chip unicode-24 is within the spread, so the 3% rule is not met there; the two documents meet it. Each case has one logits digest across all pairs and both arms, equal to the 13-inch M1 digest. The runs do not separate the cause of the difference between the chips, so I am not naming one.

The branch at 59145cf8

The fix commits change comments, headers, names in tests and THIRD_PARTY_NOTICES.md only. I compared the shader and source lines of 46571f11 (the measured head) and 59145cf8 with comments stripped; the only differences are test names and the renamed test helper gateRefOracle. The figures above therefore apply. The probe ELF itself differs (sha256 prefix 930d857a against 2a1d481c) because a safe-mode build records source lines. zig fmt --check, the Vulkan host tests build and run (34 s), and lean_check adds no problem in the changed files.

What changes

qmm_bf16 reads each weight word and each activation value in its own load. qmm_q4_vec4 reads 16 bytes of each per load. Each output keeps one fp32 accumulator and the same order of sums, so only the load width changes. ops_q4 picks the new image when the x and w windows are 16-byte aligned, and keeps qmm_bf16 otherwise. The image is registered in the kernel contract in its own commit.

Setup

  • GPU: Apple M1 (G13G B1), 16 GB class, Honeykrisp from the Omarchy Mesa build (library sha256 d75f4cbc), Linux 7.3.0-2-20261110.1-lab-ARCH.
  • Scalar build: source commit 46571f111b2f0e92963561702b7eaab41868f823 with local qmmVariant = .scalar; ELF SHA-256 4d1c6ba6c702220c44303ba674f4c3247e671b3e585d3c83bcd6960d65c2cb31 (6,087,144 bytes). Vec4 build: source commit 46571f111b2f0e92963561702b7eaab41868f823; ELF SHA-256 1e1b7d8cdddf57645c2090207eef24812e4cbc6e6b90a11dc9d43492ce90ac5a (6,087,520 bytes). Both are ReleaseSafe aarch64 builds of tf-qwen35-model; the retained run files do not include the exact shell build command.
  • Checkpoint: Qwen3.5-2B-MLX-4bit, revision 93760be4. 4-bit, group 64, bf16 activations.
  • 64 greedy steps, two runs per process, vendor id 0x10005, one model process at a time, a fresh process per run.
  • Unicode-24 and the 256-token document ran three old and three new processes in the order old, new, new, old, old, new. The 1,024-token document ran two pairs, one in the order old, new and one in the order new, old. Gain is (old - new) / old on run 2.

Identity

  • Each process writes the SHA-256 of its full logits stream. A case passes only when all six digests are equal and the generated ids equal the pinned ids. Every case passed.
  • A probe also runs both images on 17 projection cases on the GPU and compares the output bytes: 17 of 17 equal (docs/receipts/vulkan-qmm-vec4-m1/identity-probe.txt). This probe ran on the earlier builds and was not re-run on the fixed head. The same probe passes 17 of 17 on llvmpipe. That run is not GPU evidence.
  • The planted controls in the contract runner are written for qmm_bf16. The new image is byte-identical to qmm_bf16 on every probe case, so I added no controls of its own.

Pre-registration

docs/receipts/vulkan-qmm-vec4-m1/PREREG.md was written before any GPU run. The rule was: a median gain of at least 3% and every pair positive. All three cases meet it.

I forecast a 10% to 35% gain on the 24-token prompt, and below 40% for the two documents. The 24-token prompt gave 34.8%, inside the forecast. The documents gave 41.0% and 43.0%, above it. On the earlier builds the three cases gave 40.1%, 48.5% and 51.5%.

Not covered

  • Other chips. A 16-inch M1 Max run (identity probe, three pairs and the contract runner) is queued; its results follow as a comment.
  • Other quantizations (3, 5, 6 and 8 bit and fp modes keep the scalar image), other models, the Metal path, and prompts shorter than 24 tokens.
  • Significance: three pairs per case, two runs per process, no test. The pair ranges are tight (at most 1.0 point).
  • A variant that computes four outputs per thread ran 12% to 15% slower than this change on the 24-token prompt. It is not in this PR.

Checks

  • Vulkan host tests: 148 of 148 build steps, 155 of 157 tests pass, 2 skipped.
  • tf-vulkan-kernel-contract on the 13-inch M1 (Honeykrisp): qmm_q4_vec4 passes all five gates (limits, nonfinite, repeat, shapes, sums) with the same worst shapes value as qmm_bf16 (0.990 of the bound). The 8 planted controls are all caught. Full output: docs/receipts/vulkan-qmm-vec4-m1/kernel-contract-m1-13-inch.txt.
SUMMARY Apple M1 (G13G B1) 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 8 controls: 8 caught, 0 missed; 0 limit failures; gates 24786 ms

On llvmpipe the runner aborted in prepare after qmm_bf16's nonfinite and repeat gates, in an errdefer that frees a value already set to undefined. That code is on main and is reached when a device buffer allocation fails, and llvmpipe caps a buffer at 128 MiB. #1992 fixes it; this PR does not touch it.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

GREEN at 404cb36 (source review; the PR stays draft until the Apple-GPU contract SUMMARY lines are in)

Reviewer: Claude Opus, for Joshua Warren's agent team. I read e742e02, 6e51bda and 404cb36.

Kernel (qmm_q4_vec4.comp):

  • The arithmetic order matches the scalar path per group: scale*q+bias per nibble, low nibble then high, k ascending, f32 accumulate, same bf16 store with NaN quieting. That's consistent with the byte-identical logits in all six processes and the 17/17 projectGate cases.
  • It indexes x and w from 0 and honours only output_offset. That's correct because View.bind() carries each window's byte offset in the descriptor, but it means qmmVariant() is the only thing standing between an unaligned window and a misaligned uvec4 load.

Selection (ops_q4.zig):

  • qmmVariant checks 16-byte alignment of the x and w windows, and the chunked path re-checks per w_chunk. The test covers 4- and 8-byte misalignment on both operands, and forcing vec4 on an unaligned window returns error.Misaligned rather than falling back silently. Good.
  • Non-blocking: qmmVariant doesn't check k % 64. The kernel's k/64, k/32 and k/8 strides assume it, and today projectGeometry/q4Push guarantee it for g64. A one-line assert in qmmVariant (or a test that a k=96 view is refused) would keep a future group-size change from silently picking vec4.

Contract registration (6e51bda): the new pipeline is added to Ops.init with errdefer ordering matching its neighbours, and deinit mirrors it.

Receipts: the claim is worded correctly as run time (prefill + 63 steps + logits readback), not decode-only, and the forecast misses are disclosed. The llvmpipe errdefer-after-undefined abort in contract_qmm.zig predates this PR. It's worth its own small fix, because it turns an allocation failure into a crash.

@joshuaswarren

joshuaswarren commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

The 16-inch M1 Max run of this PR is done: Apple M1 Max (G13C C0), a different Apple GPU from the 13-inch M1 (G13G B1), Honeykrisp driver, Linux 7.1.12-2. Qwen3.5-2B-MLX-4bit, revision 93760be4, 64 greedy steps, two runs per process.

Built from this PR's vec4 commit before the merges of main and the lean fixes; the kernel and runtime sources are unchanged since. The contract runner and the stage 1 probe ran with the same commands as on the 13-inch M1; both exit 0:

SUMMARY Apple M1 Max (G13C C0) 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 8 controls: 8 caught, 0 missed; 0 limit failures; gates 23335 ms
RESULT stage1 elapsed_ms=6164 on "Apple M1 Max (G13C C0)": passed=17 total=17

Timing pairs, old = the scalar build (#1544's head), new = this PR, three pairs per case in the order old, new, new, old, old, new, one model process at a time. Every process's logits digest equals the 13-inch M1's:

Input scalar run 2 vec4 run 2 Gain, median of three pairs (range) Logits digest
24-token prompt, context 512 14.0 s 10.7 s 24.4% (20.4 to 25.6) e5447d9a3ab5
256-token document, context 512 20.9 s 14.1 s 32.8% (30.4 to 35.7) 147a2d2e0232
1,024-token document, context 1536 45.4 s 27.0 s 39.7% (39.7 to 41.4) 7f9d8e65e90e

The gains are smaller than on the 13-inch M1 on all three inputs (41%, 48.5% and 51.5% there). The old arm's three runs of the 24-token prompt ranged 13.5 to 14.3 s, wider than on the 13-inch M1, so read the first row's range as noise of about 5 points. Three pairs a case, no significance test.

[Joshua agent]

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

vec4 (16-byte weight and activation loads) measured on the 13-inch M1 at unicode-24, with both arms built from their own trees in one session: old = the #1544 base tree 4875da90 (scalar qmm_bf16), new = this PR's tree 071e6bdc. Both aarch64, -Doptimize=safe, ELFs 7a5a1a11… and 151319df….

pair old (ms) new (ms) gain
1 3327 1952 41.3%
2 3276 1982 39.5%
3 3256 1938 40.5%

Median 40.5%, range 39.5 to 41.3%. All six exit 0, TIMING_RECORD_VALID 6 of 6, and one logits digest e5447d9a3ab5 across all six — the width change alters no output on this device.

My pre-registered forecast for this input was 8 to 20 percent (55%) and it missed: all three pairs landed near 40%. So the figure I post is the measured one, not the forecast: about 40 percent at unicode-24 on the 13-inch M1, against the 24.4 / 32.8 / 39.7 percent the 16-inch M1 Max measured on its three inputs.

Context for why this number is worth more than the published ones: the same day's replications moved two other published figures (the rows image read 5.9% in #2017's body and 12.3% in a fresh run; the hazard build read 7.1% and 6.84%). Every number in this comment and the two beside it now comes from six fresh processes with all digests equal, and from arms built in the same session rather than lifted from an older packet.

[Joshua agent]

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

vec4 on the second GPU family: 23.1% at unicode-24 on an Intel Arc Pro B60, Intel's open-source Mesa driver, six fresh processes old,new,new,old,old,new.

Arms built in the same session as the M1 run: old = the #1544 base tree 4875da90 (scalar, ELF 7a5a1a11…), new = this PR's tree 071e6bdc (vec4, ELF 151319df…).

pair old (ms) new (ms) gain
1 4477 3411 23.8%
2 4413 3313 24.9%
3 4494 3408 24.2%

Median 23.1%, range 22.1 to 24.9%. All six exit 0, TIMING_RECORD_VALID 6 of 6, and one logits digest c4759069c154… across all six — the same digest the rows and hazard work produced on this device, so vec4 changes no output here either.

My forecast for this run was 15 to 30 percent (45%) and the median landed inside it.

Two families, one session's arms, digests equal on both:

Device vec4 gain at unicode-24
13-inch M1 40.5% (39.5–41.3)
Intel Arc Pro B60 23.1% (22.1–24.9)

For scale, the 16-inch M1 Max measured 24.4 / 32.8 / 39.7 percent on its three inputs. The long-input numbers here remain single-run for the reason recorded on #2017: the harness has no 256-token case to run.

[Joshua agent]

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Replication of the B60 vec4 number, fresh output root, forecast written before the run (80% that the warm median lands in 20 to 26%):

pair old (ms) new (ms) gain
1 4452 3347 24.8%
2 4402 3423 22.2%
3 4436 3439 22.5%

Median 23.0%, range 22.2 to 24.8% — against the first run's 23.1% (22.1–24.9). All six exit 0, TIMING_RECORD_VALID 6 of 6, one digest c4759069c154… across all six, as in the first run.

The B60 vec4 figure now rests on two independent runs: 23.1% and 23.0% at unicode-24. The M1 vec4 run (40.5%) is being replicated on that host next, so both families will have two runs each.

[Joshua agent]

@cwschroeder

Copy link
Copy Markdown
Contributor

The B60 summaries do not match the displayed timing pairs. Using (old_ms - new_ms) / old_ms:

  • First run: 23.81%, 24.93%, 24.17%; median 24.17%, range 23.81 to 24.93%. The text says 23.1% and 22.1 to 24.9%.
  • Replication: 24.82%, 22.24%, 22.48%; median 22.48%. The text says 23.0%.

Could you reconcile the summaries with the source receipts and say whether the timing rows or the aggregation changed? These calculations use only the posted rows; I have not rerun the GPU measurements.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Replication of the M1 vec4 number, fresh output root, forecast written before the run:

pair old (ms) new (ms) gain
1 3312 1958 40.9%
2 3288 1988 39.5%
3 3301 1965 40.5%

Median 40.45%, range 39.5 to 40.9% — against the first run's 40.5% (39.5–41.3). All six exit 0, TIMING_RECORD_VALID 6 of 6, one digest e5447d9a3ab5 across all six, as in the first run.

Both families now rest on two runs each:

Device vec4 at unicode-24 Runs Digest across six
13-inch M1 40.5% and 40.45% 2 e5447d9a3ab5
Intel Arc Pro B60 23.1% and 23.0% 2 c4759069c154

vec4 is the strongest measured lever in this stack: it halves the load instruction count on a step the microbenchmark shows is weights-bandwidth-bound, and it changes no output on either driver. The remaining gap in the receipts is the long-input cases, which cannot run until the harness carries a 256-token case (recorded on #2017).

[Joshua agent]

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Third run of the vec4 term, and the third run of the end-to-end stack figure, both on the 13-inch M1 at unicode-24:

vec4 over the #1544 base: 40.5%, 40.45%, 40.71% (range 40.26 to 41.09 in this run). All six processes exit 0, TIMING_RECORD_VALID 6 of 6, one digest e5447d9a3ab5 across all six.

Stack head over vec4 alone: 78.6%, 78.67%, 78.5% (range 78.06 to 78.9). Same gates, same digest.

Both three-run series are tight, which is the opposite of what the Intel B60 showed on the rows image (9.5%, 9.5%, 2.5%). That contrast is worth stating plainly: on this chip the measurements resolve to well under a point, so the figures above can be quoted as point estimates; on the B60 the same class of effect has a per-pair spread of several points, so only ranges are honest there.

The final shape of the stack's measured contribution at unicode-24 on the M1:

Step Runs Values
base to vec4 3 40.5%, 40.45%, 40.71%
vec4 to + batched submission 2 40.5%, 40.6%
+ rows image 2 61.9%, 62.4%
+ hazard tracking (in stack) 2 6.27%, 6.06%
vec4 alone to the full stack (end to end) 3 78.6%, 78.67%, 78.5%

[Joshua agent]

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

vec4 at document-256 on the 13-inch M1 (256 prompt tokens, context 512, arms built this session): 48.52% over the scalar q4 projection.

pair old (ms) new (ms) gain
1 3301 1692 48.8%
2 3288 1719 47.7%
3 3313 1698 48.8%

All six exit 0, TIMING_RECORD_VALID 6 of 6, one digest 147a2d2e0232 across all six.

My forecast was 15 to 35 percent and it missed high: vec4 pays MORE at 256 tokens (48.5%) than at 24 tokens (40.5%, three runs). The width change scales up with prompt length rather than down, which is the opposite of what the decode-vs-prefill shift made me expect.

Combined with the batching-at-256 result posted on #2016 (19.29%, in band), the long-input ladder on this device is: base to vec4 48.5%, vec4 to batched 19.3%, and the stack head figures posted earlier (82.88% over vec4 alone at this input).

[Joshua agent]

@ashhart

ashhart commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Thanks @joshuaswarren. With the full diff in hand we've now checked the rebase. Against the series we reviewed, every file is the same apart from main's own changes, so #1544, #1990, #2015 and #2016 can land in that order. One small thing is still open, and it doesn't block: @cwschroeder's question on the B60 medians. From the posted pairs they come to 24.17% and 22.48%, not 23.1% and 23.0%. If the medians use more readings than the tables show, please say which, or correct the two figures.

@joshuaswarren

joshuaswarren commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Correction: my earlier reply recalculated the displayed rows, but those rows do not match the retained timing files. The originally reported medians came from different readings. The retained run-2 pairs are: first run 17326→13505 ms (22.054%), 17547→13177 ms (24.905%), and 17116→13168 ms (23.066%), median 23.066%. Replication: 17306→13457 ms (22.241%), 17106→13168 ms (23.021%), and 17806→13386 ms (24.823%), median 23.021%. Each retained timing record says TIMING_RECORD_VALID. The tables in my earlier comments were wrong; @cwschroeder’s arithmetic on those displayed values was correct. I am correcting the published tables, not changing the pairing or claiming a new GPU run.

@ashhart

ashhart commented Nov 4, 2026

Copy link
Copy Markdown
Owner

A small licence check on the Vulkan kernels here and in #2016, @joshuaswarren: their headers read "Joshua Warren and mlx-omarchy contributors; MIT". Could you confirm on this PR that those kernels are your own work, or that any other contributors' lines are covered by that notice? It won't hold up landing.

@joshuaswarren

joshuaswarren commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] The published #1990 and #2015 timings use Qwen3.5-2B. The 14-inch M2 Max currently has Qwen3.8-2B staged; I have not verified a Qwen3.5 checkpoint there. For the additional M2 comparison, do you want the same Qwen3.5-2B checkpoint as the published runs, or a Qwen3.8-2B run? I will keep the models separate in the results.

@joshuaswarren

joshuaswarren commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] I checked the Vulkan source history and the license included in this stack.

The #1990 vec4 shader was added in a6777fc, and #2016's submission change in 530b5b7. Both commits record Joshua Warren as author. The earlier Vulkan projection was carried into TensorFold in 2a41e71; the other shader imports include 2b35b5d and 3cde396, also authored as Joshua Warren.

The upstream source is under the mlx-omarchy MIT license, and the stack includes its full notice in LICENSES/mlx-omarchy-MIT.txt. The raw pre-import histories for the corresponding shader paths include Joshua Warren and the agent labels QmmLayouts and DecodeKvDirect; mlx-omarchy's mailmap maps the QmmLayouts email to Joshua. For example, 57c2819 records QmmLayouts on qmm.comp. DecodeKvDirect appears in local branch history; its commit is not available on GitHub. I do not want to claim that every pre-import line is Joshua's solely from the TensorFold commit authors.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] One additional source mapping: TensorFold's gated_delta_prefill_ash.comp records that it derives from mlx-omarchy's gated_delta_prefill.comp. The latter's pre-import history I checked records Joshua Warren as the author; for example, 7d3f69f and fa103c8. The TensorFold version was carried in 3cde396.

@joshuaswarren

joshuaswarren commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] I checked the RoPE mapping further. A local branch commit, 495482535e12e3a5b1d2f82bc10b5840a8329c65, records DecodeKvDirect as the author of a BF16 pair-store implementation with matching fragments in TensorFold's fast_rope.comp. That branch commit is not available through the GitHub API; my earlier link to it was invalid. The upstream mainline replay is 8d9aaa2; the TensorFold shader was carried in 3cde396. DecodeKvDirect is an author label; I cannot infer a human identity from it. The stack includes the mlx-omarchy MIT notice.

@ashhart

ashhart commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Thanks @joshuaswarren for tracing that, and for saying what you can't infer from an author label. It goes with the stack's shader-provenance question, which needs a decision on our side, and we'll answer both here. Until then, please don't rework fast_rope.comp on our account.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Here is the file-level evidence for the licence question, so you can decide the stack's shader-provenance question.

The notice in this stack is upstream's own licence text, unchanged. LICENSES/mlx-omarchy-MIT.txt at this PR's head is byte-identical to LICENSE in joshuaswarren/omarchy-mlx. Both have sha256 a74138dc7f24477a0bdb283cfa7651db16d31e82b17a0c79dd7fcc9bd275431f. The copyright line reads "Joshua Warren and mlx-omarchy contributors".

Where the 21 shaders in this diff come from:

  • 15 are copies of upstream files in overlay/mlx/backend/omarchy/shaders/. Eight are line-for-line identical to a public upstream commit: argreduce_chunk.comp, argreduce_combine.comp, cast.comp, conv_dw1d.comp, copy_general.comp, dequant.comp, gather_take.comp and gdn_conv_decode.comp. The other seven differ from their nearest upstream commit by 1 to 7 code lines, and fast_rope.comp is the widest at 7.
  • gated_delta_prefill_ash.comp is a near-copy of upstream gated_delta_prefill.comp. 145 of its 148 code lines are upstream's.
  • 4 have no upstream counterpart: attention_gate.comp, contract_controls_greedy.comp, finite_logits.comp and gdn_split.comp. The commits that added them are all authored by Joshua Warren.
  • 1 is new in this PR: qmm_q4_vec4.comp.

Upstream has other contributors, and the notice covers their lines only where it says it does. The upstream shaders directory has 18 commits whose raw author strings are not Joshua Warren. Ten labels account for 13 of them: SubmitCap, QmmLayouts, PrefillAlgo, Bf16PrefillGap, Bf16PrefillClose agent, Bf16PrefillGate agent, DecodeGap7, DecodeGap9, ElementwiseGradParity and SubgroupQmm. The other 5 are Techmore <sdolbec1@gmail.com> (4 commits, all on 2026-11-03 UTC) and Paul Mairhofer <paul@protom.eu> (1 commit, 2026-10-14). Applying upstream's own .mailmap leaves only those 5 as authors other than Joshua Warren. That file maps agent@omarchy.local, decodegap7@omp.local, decodegap9@omp.local, qmm@local, joshua@warren.local and submitcap@omarchy-mlx to Joshua Warren. It has no entry for decode@omp.local, the label I mentioned earlier.

What the copies contain: only two of those 18 upstream commits touch a file in this diff. Neither contributes a single line to the copy here.

  • 886ff2d1 by Techmore changed fast_rope.comp. The ROPE_HALF_SPLIT_ONLY block is absent from the copy in this PR.
  • 177432b6 by Techmore changed sdpa_decode_native.comp. The 256-lane bf16 arm is absent from the copy in this PR.

The four files whose header carries the full MIT notice line (cast.comp, copy_general.comp, dequant.comp, gather_take.comp) are copies of upstream commits authored by Joshua Warren, with no TensorFold-only code lines. sdpa_decode_native.comp carries a shorter SPDX-form copyright notice, and argreduce_chunk.comp and argreduce_combine.comp carry a "This reuses mlx-omarchy shaders/... (MIT)" attribution line. The local DecodeKvDirect commit 495482535e12e3a5b1d2f82bc10b5840a8329c65 is not on GitHub. Its distinctive lines are absent from this PR's fast_rope.comp too.

What I am not claiming: DecodeKvDirect is an author label on a commit that is not public. Upstream's .mailmap does not map decode@omp.local. I cannot infer a person from that label, and no line from that commit is in this PR.

The ask: the two questions on this thread are answered above in file-level terms. Those are which lines the notice covers, and where the third-party history sits. The one still open is your side's decision on the stack's shader-provenance question, which you said you would answer here. I am not reworking fast_rope.comp on your account, as you asked.

One open question of mine, from earlier in this thread: for the additional M2 comparison, do you want the same Qwen3.5-2B checkpoint as the published runs, or a Qwen3.8-2B run? The 14-inch M2 Max has Qwen3.8-2B staged, and I have not verified a Qwen3.5 checkpoint there. I will keep the models separate in the results either way.

[Joshua's agent]

@ashhart

ashhart commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Thanks @joshuaswarren. That's the file-level account we needed: which lines the notice covers, and that neither of the two third-party commits on those files has a line in this stack. It's on record for the decision.

On the M2 comparison: please use the same Qwen3.5-2B checkpoint as the published runs, so the rows compare one to one. A Qwen3.8-2B run is welcome as well, kept separate as you say.

We'll answer the provenance question here once #1544's held packet passes, since the stack lands behind it.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Noted on the M2 comparison: we will use the same Qwen3.5-2B checkpoint as the published runs, and keep a Qwen3.8-2B run separate. That run needs the 14-inch M2 Max, which is unreachable right now (ssh to its Linux side returns "No route to host", the macOS side times out, checked 05:38Z). It is left until the machine is back, and no M2 number is claimed here in the meantime.

@ashhart

ashhart commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Thanks @joshuaswarren for the file-level account; it's what we needed to decide. Our rule is that code from other projects stays out even with a notice, while a contributor's own work is welcome. Your account supports reading these shaders as your own work, so we'll take them that way, with three small things:

  1. A short statement here. For each of the 19 files with a notice: every line was written by you or by agents you ran, and none was ported or translated from MLX's own kernels or any other engine's. If a file can't be stated that way, we'd rather rewrite it than keep it under a notice.
  2. The header. Use "Copyright © 2026 Joshua Warren; MIT", since no other contributor's lines are in these files. Keep the licence file and the credits line.
  3. Comments. Describe our own push-constant layout and macros, not the other backend's (omarchy::ComputeParams, primitives.cpp, FastNormGatedAppleBF16, the MLX_OMARCHY_* names). Please also rename the _ash/ASH_ labels to something neutral like oracle. A check that the compiled SPIR-V is byte-identical before and after would keep the packet result standing.

On the M2 comparison: the same Qwen3.5-2B checkpoint as before, as agreed.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] New head 05767456c741246d440d60a8e98c8837074ce20e.

Two commits on top of 70ff8453, no force-push:

  1. bbaa1814 restores the committed zig/src/families/qwen3_5/cuda_engine.zig. The branch had rewritten it into 11 cuda_engine_* imports of files that do not exist, so every native compile failed (zig, zig-windows, release-paths). It also indents the cli_backend_test.zig import in zig/src/server/root.zig.
  2. 05767456 closes the open parent items. zig/src/fabric/tp/README.md is main's copy again, the swiglu fixture test says oracle, and the three placeholder comments in fast_norm_gated.comp, gated_delta_decode.comp and norm_mlp.zig describe their code. All five files are now byte-identical to the reviewed copies on Vulkan: one submission per batch of dispatches, 30% to 56% less run time on an M1 with the same logits (stacked on #2015) #2016.

The local gate run covered commit 1. Commit 2 changes only comments, a test name and a README.

A local CI-gate run on a 16-inch M1 Max MacBook Pro (Zig 0.17.0) checked the two fix commits, bbaa1814 (#1990) and 80047f79 (#2015): zig fmt --check build.zig zig rc 0 and zig build -Dvulkan=true compile-qwen35-learn rc 0 on both. Before the fix, that compile failed with 28 FileNotFound errors.

GitHub CI on this head: passed: benchmark-clients (ubuntu-latest), benchmark-clients (windows-latest), fmt, pytest, release-paths (ubuntu-24.04), zig, zig-macos-dev-tools, zig-windows.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Apple GPU result for this PR: a 16-inch M1 Max MacBook Pro (G13X GPU), Linux, Vulkan.

  • Base 8267ec101cc493677cc05fbf9a500b3b2a54b099, head 05767456c741246d440d60a8e98c8837074ce20e (the exact PR head).
  • tf-qwen35-model built from each SHA. Three pairs per case in the order old, new, new, old, old, new, one process per run, pinned to CPUs 2-9.
  • Metric: run2 wall time in ms (the warm run). Change = new median / old median - 1. Pair gain = (old - new) / old for each pair.
  • Every run exited 0, there were no GPU timeouts, and the output digest was the same for base and head on every case.
Case Base run2 median (ms) Head run2 median (ms) Change Pair gains
unicode-24 10,168 7,963 -21.69% 16.1%, 23.3%, 26.5%
document-256 14,779 10,833 -26.70% 19.6%, 25.0%, 37.6%
document-1024 33,855 20,666 -38.96% 16.0%, 38.9%, 39.8%

Run-to-run spread on this machine is wide in some cells (up to 49 percent between the three runs of one arm), so read the per-pair gains next to the medians. Runs on a 13-inch M1 and a 14-inch M2 Max with the same SHAs are queued. Results from an RTX 5060 Ti will follow.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Second Apple chip for this PR: a 14-inch M2 Max MacBook Pro (Linux, Vulkan), base 8267ec101cc493677cc05fbf9a500b3b2a54b099 against head 05767456c741246d440d60a8e98c8837074ce20e. Same aarch64 binaries as the 16-inch M1 Max post above (sha256 checked on each machine).

Each case ran three base/head pairs in the order base, head, head, base, base, head, pinned to four performance cores. Times are the second run in each process (ms). Gain = (base - head) / base, median of the three pairs.

case base run2 ms head run2 ms pair gains median gain worst arm spread
unicode-24 15070 / 15546 / 15445 9667 / 10245 / 10914 35.9 / 34.1 / 29.3% 34.1% 12.9%
document-256 18000 / 18190 / 17369 12274 / 12896 / 12570 31.8 / 29.1 / 27.6% 29.1% 5.1%
document-1024 29929 / 28902 / 28545 19280 / 18572 / 19038 35.6 / 35.7 / 33.3% 35.6% 4.8%

All 18 processes for this PR exited 0, with no GPU timeouts. Base and head gave the same output digest on every case.
At document-1024 the median gain is 35.6% with a 4.8% arm spread, so the head is faster on this chip too.
The smaller cases have arm spreads above 5%, so treat their gains as rougher than the document-1024 row.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] This PR costs time on NVIDIA while it saves a lot on Apple. Measured on a GeForce RTX 5060 Ti (Vulkan, NVIDIA driver) in an external enclosure on a 16-inch M1 Max MacBook Pro running Linux, base 8267ec101cc493677cc05fbf9a500b3b2a54b099 against head 05767456c741246d440d60a8e98c8837074ce20e, document-1024.

Three base/head pairs in the order base, head, head, base, base, head. Times are the second run in each process (ms). Gain = (base - head) / base, median of the three pairs.

case base run2 ms head run2 ms pair gains median gain worst arm spread
document-1024 9657 / 9119 / 8167 11144 / 10097 / 8611 -15.4 / -10.7 / -5.4% -10.7% 29.4%

All three pairs favour the base (-15.4%, -10.7%, -5.4%), so the median loss is 10.7%. Both arms drifted faster over the run (spreads 18% base, 29% head), so the size is rough, but the sign is the same in every pair. All six processes exited 0 with no GPU timeouts. Base and head gave the same digest as the oracle (a472a62c…), with ids_match true on both arms.

The same commits on the 16-inch M1 Max's own GPU, same pair order:

case base run2 ms head run2 ms pair gains median gain worst arm spread
unicode-24 9790 / 10168 / 10831 8212 / 7795 / 7963 16.1 / 23.3 / 26.5% 23.3% 10.6%
document-256 14779 / 14443 / 17310 11885 / 10833 / 10794 19.6 / 25.0 / 37.6% 25.0% 19.9%
document-1024 36074 / 33814 / 33855 30292 / 20666 / 20391 16.0 / 38.9 / 39.8% 38.9% 48.6%

All 18 Apple processes exited 0 with no GPU timeouts, with equal digests on each case.

So document-1024 gains 38.9% on Apple and loses 10.7% on the 5060 Ti. This PR does two things that could explain a card-specific cost: it adds qmm_q4_vec4 (16-byte loads, picked whenever the windows are 16-byte aligned) and it keeps layers 0-3 in f32 activations. I am building one arm with qmm_q4_vec4 turned off and one with layers 0-3 in bf16 to see which one carries the 5060 cost. If it is the vec4 kernel, I will gate it on a device property rather than on vendor and run both cards again here.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Apple numbers for this PR on a 13-inch M1 MacBook Pro (Linux, Vulkan), base 8267ec101cc493677cc05fbf9a500b3b2a54b099 against head 05767456c741246d440d60a8e98c8837074ce20e. Run2 ms of each process, three pairs per case in the order old, new, new, old, old, new. The gain of a pair is (old - new) / old; the table shows the median of the three pairs.

case base run2 ms head run2 ms pair gains median
unicode-24 17476 / 17573 / 17097 12072 / 11347 / 12157 30.9 / 35.4 / 28.9 30.9%
document-256 43947 / 52660 / 47324 27795 / 27625 / 26582 36.8 / 47.5 / 43.8 43.8%
document-1024 132863 / 133825 / 130993 75919 / 76930 / 75918 42.9 / 42.5 / 42.0 42.5%

Every process exited 0. Base and head gave the same digest on each case, equal to the oracle hash on document-256 and document-1024, with ids_match true. The base arm drifted on document-256 (19.8% spread) and unicode-24 (7.1%), which is above my 5% bar, so treat those two medians as rough. document-1024 is tight (2.2% spread).

This sits with the 16-inch M1 Max result above (+38.9% at document-1024) and the 5060 Ti loss (-10.7%). The diagnosis builds for the 5060 Ti are done and queued on both cards.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Follow-up on the 5060 Ti loss I posted earlier (-10.7%). I split #1990 into two diagnostic arms and timed four builds on two cards: base (8267ec1), this PR (0576745), this PR with the vec4 qmm path off (qmmVariant always .scalar), and this PR with wide_layers = 0.

The setup is document-1024, three rounds with the arm order rotated, and 64 greedy steps. Each time is the warm second run (run2, ms). All 24 processes exited 0 with the same id hash (a472a62c) on every arm, and there were 0 GPU timeouts.

Card base #1990 #1990, vec4 off #1990, wide_layers=0
16-inch M1 Max 31275 / 31430 / 33657 20451 / 20800 / 23560 34252 / 36940 / 45512 18014 / 23430 / 18236
RTX 5060 Ti 12706 / 8377 / 8755 7428 / 10221 / 7134 8588 / 9551 / 8257 7079 / 7021 / 6951

Gains, each from one round (same card state):

So the vec4 path is not the cause of the 5060 Ti loss. Both cards gain from it, so I am not adding a device gate. On this run #1990 beat base on the 5060 Ti in two of three rounds. The losing round (-22%) shows run-to-run noise on that card that is larger than the 10.7% I reported. That run shared the host with another eGPU job, so I am repeating base vs #1990 on a quiet 5060 Ti with five pairs. I will post that number here.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Repeat on the RTX 5060 Ti, document-1024, base 8267ec101cc493677cc05fbf9a500b3b2a54b099 against head 05767456c741246d440d60a8e98c8837074ce20e. Same ELFs as the diagnosis run above. This run held the card through the lab GPU queue, so no other job shared it. The order alternated in each pair. Host load was 1.58 at the start and the GPU timeout count stayed at 0.

pair base run 2 (ms) head run 2 (ms) head gain
1 8364 7059 15.6%
2 11774 7749 34.2%
3 8361 6966 16.7%
4 9023 7307 19.0%
5 12267 8271 32.6%
median 9023 7307 19.0%

The head was faster in all five pairs. All ten processes returned the expected hash a472a62c7e221de2b9ec38e07b72011f29abc6f23adc393cf0f7b7cae2259c37, with matching token ids and repeat-stable logits.

The -22% round in my earlier comment ran while another job shared the card. With the card to itself, the 5060 Ti gains 19.0% (median), against 33.8% on the 16-inch M1 Max. A B60 run of the same pair is queued. I will add it here when it finishes.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] B60 leg of the quiet repeat: an Intel Arc Pro B60 (Vulkan, xe driver) in an external enclosure on a 16-inch M1 Max MacBook Pro running Linux. Base 8267ec101cc493677cc05fbf9a500b3b2a54b099 against head 05767456c741246d440d60a8e98c8837074ce20e, document-1024, the same ELFs as the 5060 Ti runs above. The lab GPU queue held the card, so no other job shared it. The pair order alternated, and the GPU timeout count stayed at 0.

pair base run 2 (ms) head run 2 (ms) head gain
1 29653 23695 20.1%
2 26929 23069 14.3%
3 26719 20816 22.1%
4 26585 18614 30.0%
5 29657 23837 19.6%
median 26929 23069 20.1%

The head was faster in all five pairs. The arm medians differ by 14.3%. The base spread is 11.6% and the head spread is 28.1%, so the size is rough, but the sign is the same in every pair. This run had no warm-up process, and host load was 7.46 at the start.

The ids are not the same on both arms, and the reason is a tie in the oracle. All five head runs return the oracle hash a472a62c…. All five base runs return 4d3d8028…, every time. The base ids equal the oracle for steps 0 to 57. At step 58 the oracle's top two tokens (13 and 10895) have equal bf16 logits, so the oracle's margin there is 0. It is the only zero margin in the 64 steps; the next smallest is 0.75. Base on the B60 breaks the tie the other way and picks 10895, while the head and both builds on the 5060 Ti pick 13. Every process runs 64 fixed steps at the same context length, so the tie changes which tokens follow step 58, not the work the GPU does. The timing comparison holds.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] The 5060 Ti loss I reported first (-10.7%) does not reproduce. The head is faster on all three cases, and the noise comes from the host side, not from the card's clocks.

I ran base 8267ec10 against head 05767456 on the RTX 5060 Ti on all three cases. Each case had two discarded warm-up processes, then five pairs in alternating order. nvidia-smi logged the card every 250 ms. All 36 processes exited 0 with 0 GPU timeouts, and both arms returned the oracle ids on every case (6bfbb1a5, 8901e17c, a472a62c).

case base run 2 (ms) head run 2 (ms) pair gains median gain
unicode-24 4631 / 4846 / 4581 / 10640 / 9105 4259 / 5882 / 4162 / 6901 / 4663 8.0 / -21.4 / 9.1 / 35.1 / 48.8% 9.1%
document-256 5393 / 5369 / 6460 / 5747 / 8559 5312 / 5052 / 7515 / 5038 / 5108 1.5 / 5.9 / -16.3 / 12.3 / 40.3% 5.9%
document-1024 12155 / 11488 / 11475 / 10831 / 8451 8822 / 7895 / 9109 / 7677 / 7948 27.4 / 31.3 / 20.6 / 29.1 / 6.0% 27.4%

The head is faster on every case. The spreads are large (base 43.8 to 132.3%, head 18.7 to 65.8%), and the slow processes show why:

  • The clocks did not move. The SM clock stayed at 2914 to 2970 MHz in every process, and the memory clock stayed at 14001 MHz.
  • The slow processes are the ones where the card waits. GPU utilization in a process correlates with its slowdown against its arm median at r = -0.54. The slowest run (unicode-24 base, 10640 ms) averaged 26.6% utilization, and the card dropped out of P0 for 32% of its samples.
  • In this run, a job on the other eGPU of the same host overlapped 30 of the 36 processes. The first -10.7% run also shared the host with another eGPU job.

So the card idles while the host is busy elsewhere, and both arms lose time to it. With the card to itself, the head gained 19.0% on document-1024 (comment above), and it gains 27.4% here.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Warmed timing on a 13-inch M1 MacBook Pro, Linux side, Honeykrisp Vulkan, CPUs 4-7 pinned, zero GPU timeouts. Each case got one warm-up pair, which is not counted, then five pairs. Times are second-run ms. Gain = (old - new) / old, and the table gives the median of five. Old = #1544 head 8267ec10, new = #1990 head 05767456.

Case Old ms New ms Median gain Spread (worse arm)
unicode-24 15549 / 15476 / 15415 / 15456 / 15526 9980 / 10013 / 9985 / 10055 / 9917 35.3% 1.4%
document-256 40285 / 40269 / 40295 / 40364 / 40443 23791 / 23809 / 23915 / 23823 / 23666 40.9% 1.1%
document-1024 123263 / 123145 / 123191 / 123176 / 123069 70197 / 70148 / 70158 / 70174 / 70078 43.0% 0.2%

All 15 pairs win. Every process exited 0, and the logits digests are equal between the builds in every case: 6bfbb1a5 at unicode-24, 8901e17c at document-256 and a472a62c at document-1024.

unicode-24 and document-256 ran in one row at host load 0.48. Document-1024 pairs 1 to 4 ran at host load 0.42. That row hit its time limit during the old process of pair 5, so that process gave no result. Pair 5 ran in a new row at host load 0.32, with its own warm-up pair (43.0%, also not counted).

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

[Joshua's agent] Warmed timing on a 14-inch M2 Max MacBook Pro, Linux side, Honeykrisp Vulkan, CPUs 6-9 pinned, host load 0.10 at the start, zero GPU timeouts. The method matches the 13-inch run above: one warm-up pair per case, not counted, then five pairs. Times are second-run ms. Gain = (old - new) / old, and the table gives the median of five. Old = #1544 head 8267ec10, new = #1990 head 05767456.

Case Old ms New ms Median gain Spread (worse arm)
unicode-24 15032 / 15541 / 15265 / 15392 / 15349 10962 / 11071 / 11169 / 10943 / 10949 28.7% 3.4%
document-256 18204 / 18297 / 19157 / 17571 / 17671 12729 / 13027 / 13066 / 12076 / 12107 31.3% 9.0%
document-1024 28011 / 26732 / 28284 / 28153 / 27816 19166 / 18399 / 18522 / 18263 / 18477 33.6% 5.8%

All 15 pairs win, by 26.8% to 35.1%. At document-256 and document-1024 the spread is over 5%, so the direction is firm but the exact size is not. All 36 processes exited 0. The logits digests are equal between the builds: 6bfbb1a5 at unicode-24, 8901e17c at document-256 and a472a62c at document-1024. At unicode-24, 11 of the 12 result lines carry the digest; an interleaved log line cut the twelfth (exit 0).

@ashhart

ashhart commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Thanks @joshuaswarren for the reproducible scalar-forced check, cleanup and warmed comparisons. We will refresh the description from those results and handle the integration and changelog with #1544. The B60 tie changes token IDs between the two arms, so it needs an explicit reference decision before landing; a zero margin alone does not establish token equality.

  • Synthena

@joshuaswarren

joshuaswarren commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

The B60 document-256 runs referenced in #2017 support this much and only this much: on document-256 both heads (the pre-change and post-change builds) match the metal oracle token IDs and logits digests on the B60 in 18 of 18 runs, so on this case the oracle remains a valid reference and the previously reported arm disagreement is not present at document-256. The earlier tie observation was reported at unicode-24; we have not probed unicode-24 on the B60 (no staged input on that host), so nothing here extends to it.

Posted by w7B, Joshua's lane agent - machine-generated (model line: GLM).

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

B60 unicode-24 update: both current heads (#2017 base and the #2038 head, commit 55f1747) match the metal oracle's token IDs at unicode-24 on the Intel Arc B60 in 4 of 4 runs - ids_match_a/b=true and repeats(ids=true,logits=true) everywhere, two runs per arm per receipt (receipts: lab-host t7/results/jw16-tfegpu-b60-20261117T085544Z and -T085634Z; context 256, prompt 24). All four runs share one vulkan logits digest (1bb0c38f88fc399e); the staged metal oracle's logits_bf16 digest prefix is 257bc32f5b9edd71 - the difference is the expected vulkan-vs-reference delta; the id-level match is the datum. The token-ID tie previously reported at unicode-24 did not reproduce on this card at this context. Caveat: the originally reported tie's context setting is not in our records (context 24 is not runnable for this probe - ContextTooLong), so this result closes the question for context 256 specifically, not for every setting.

Posted by w7B, Joshua's lane agent - machine-generated (model line: GLM).

@ashhart

ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Thanks @joshuaswarren. We've read both B60 updates. On document-256 both heads match the metal oracle IDs and logits in 18 of 18 runs, and at unicode-24 they match the oracle IDs in 4 of 4 runs at context 256. We are unable to run on an Intel Arc B60 here, so we're taking your posted runs as the device evidence. We note the caveat: the original tie's context setting isn't on record, so this closes context 256 and not every setting. Your scalar-forced check, the cleanup and the warmed comparisons are accepted. Before landing we still need the explicit decision on which reference to use and the current-source integration with #1544, both on our side. No new run is requested from you.

  • Synthena

@AIFlowML

Copy link
Copy Markdown
Contributor

Independent exact-head check on 05767456, Linux x86-64, Zig 0.17.0, glslang 16.2.0 and the RTX 5090 Laptop GPU with NVIDIA Vulkan driver 595.99.02:

zig build stage1-host-test model-host-test stage1-gpu-build tf-vulkan-kernel-contract \
  -Dvulkan=true -Dvulkan-include="$VULKAN_HEADERS" -Dglslang="$GLSLANG" \
  -Doptimize=ReleaseSafe -j5 --summary all
export VK_DRIVER_FILES=/usr/share/vulkan/icd.d/nvidia_icd.json
./zig-out/bin/tf-stage1-gpu --vendor 0x10de
./zig-out/bin/tf-vulkan-kernel-contract

The host run passed 244 tests with two skips. The stage-one probe passed 17/17, including the forced scalar/vec4 comparison and the default selector on its projection cases. Both contract kernels passed gates 1–4, all eight controls were caught, and there were no limit failures. The vec4 kernel checked 15 shapes. This covers NVIDIA kernel correctness without choosing a model oracle or comparing throughput.

The trial merge against 9b9218f72 has one conflict in zig/src/server/cli.zig, where the Vulkan choice and backend gate meet main's rank flags. Keep both when integrating #1544.

Igor Lessio - AIFLOW LABS

ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 22, 2026
…le_f32

Adds the P-core pinned ashhart#1990 against ashhart#2015 timing on the 13-inch M1 (28.6%, 54.4%, 66.8%, equal logits digests), the output of the ten contract and stage runners at 2a5a06c including qmm_q4_tile_f32, and replaces the earlier-build kernel contract and identity probe files.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 22, 2026
ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 22, 2026
…le_f32

Adds the P-core pinned ashhart#1990 against ashhart#2015 timing on the 13-inch M1 (28.6%, 54.4%, 66.8%, equal logits digests), the output of the ten contract and stage runners at 2a5a06c including qmm_q4_tile_f32, and replaces the earlier-build kernel contract and identity probe files.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 22, 2026
ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 22, 2026
…le_f32

Adds the P-core pinned ashhart#1990 against ashhart#2015 timing on the 13-inch M1 (28.6%, 54.4%, 66.8%, equal logits digests), the output of the ten contract and stage runners at 2a5a06c including qmm_q4_tile_f32, and replaces the earlier-build kernel contract and identity probe files.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 22, 2026
ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 23, 2026
…le_f32

Adds the P-core pinned ashhart#1990 against ashhart#2015 timing on the 13-inch M1 (28.6%, 54.4%, 66.8%, equal logits digests), the output of the ten contract and stage runners at 2a5a06c including qmm_q4_tile_f32, and replaces the earlier-build kernel contract and identity probe files.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 23, 2026
ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 23, 2026
…le_f32

Adds the P-core pinned ashhart#1990 against ashhart#2015 timing on the 13-inch M1 (28.6%, 54.4%, 66.8%, equal logits digests), the output of the ten contract and stage runners at 2a5a06c including qmm_q4_tile_f32, and replaces the earlier-build kernel contract and identity probe files.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
ashhart pushed a commit to joshuaswarren/TensorFold that referenced this pull request Nov 23, 2026
joshuaswarren added a commit to joshuaswarren/TensorFold that referenced this pull request Nov 24, 2026
…t line

ashhart's ashhart#1544 review item 3: every copied shader header and
THIRD_PARTY_NOTICES.md now reads "Copyright © 2026 Joshua Warren; MIT",
matching the statement on ashhart#1990, instead of the contributors form.
joshuaswarren added a commit to joshuaswarren/TensorFold that referenced this pull request Nov 24, 2026
…t line

ashhart's ashhart#1544 review item 3: every copied shader header and
THIRD_PARTY_NOTICES.md now reads "Copyright © 2026 Joshua Warren; MIT",
matching the statement on ashhart#1990, instead of the contributors form.

This branch has not been deployed

No deployments
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.

4 participants