perf(colibri): K2 — 1×4 union tile in the planar IDOT matmul (bit-identical) - #1088
Merged
Merged
Conversation
…ntical) The prefill union delivers nr=2..16 rows per expert, and the per-row kernel re-paid the weight block's load+mask for every row — measured GMAC/s was flat in S. The tile pays it once per 4 activation rows: inside matmul_i4p_idot, rows are processed 4 at a time (one accumulator each, the masked lo/hi weight forms shared), with a per-row remainder identical to the old path. Dispatch untouched: every planar IDOT caller gets the tile for free, S<4 falls through to the exact per-row loop. Integer sums, so bit-identical by associativity — asserted in-tree: test_int_kernel_exact now runs the matmul comparison at S=6 (4-row tile main + 2-row remainder), 3,968 checks, 0 failures. Measured vs the pair-layout IDOT baseline (harness, this box): S=2: 1.84-1.89x | S=4: 2.67-3.10x | S=8: 2.57-2.83x (peak 253 GMAC/s) matching the audit prototype's 2.70-2.99x prediction at S=4. glm_tiny e2e at int4: tokens byte-identical vs unpatched dev, [K1] activation line confirming the planar path ran. Gated with the K1 planar family (coli_dpbusd256: AVX-VNNI or AVX-512VL+VNNI); other builds keep the per-row loop unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 18, 2026
Merged
Merged
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.
The idea
The prefill union delivers each expert nr = 2..16 activation rows, and the per-row kernel re-paid the weight block's load + mask for every one of them — which is why measured GMAC/s was flat in S. K2 pays it once per 4 rows: inside
matmul_i4p_idot, rows go 4 at a time (one accumulator each, the masked lo/hi weight forms shared across the fourvpdpbusdpairs), with a per-row remainder identical to the old path.Dispatch untouched — every planar IDOT caller gets the tile for free; S<4 falls through to the exact per-row loop. Structurally this is the piece llama.cpp cannot copy: their wave-prefill rows are redundant replays, so a tile over them would only speed up wasted work; the union's rows are genuinely distinct at 1× I/O.
Measured (harness vs the pair-layout IDOT baseline, i7-1355U AVX-VNNI)
0 bit mismatches at every S and shape (integer sums — bit-identical by associativity). Matches the audit prototype's 2.70–2.99× prediction at S=4.
Verification
test_int_kernel_exactnow runs the matmul comparison at S=6 (4-row tile main + 2-row remainder): 3,968 checks, 0 failures — and the ARM job from ci: ARM oracle job + integer-kernel bit-exactness gate (closes #1081) #1083 keeps holding the same bar with NEON live (the tile is gatedcoli_dpbusd256, so non-VNNI builds keep the per-row loop verbatim)[K1]activation line confirming the planar path actually ranSeries: 0.1 ✅ · K1 #1079 ✅ · #1086 fixes ✅ · this PR = K2 · next: K3 fusion on the FUSED3 (#1082) shape, then the perplexity ablation unlocking
g_i4s=1+ fmt=4/gs64 planar.🤖 Generated with Claude Code