Skip to content

feat(kernel): skinny_matmul, dense small-N matmul for speculative verify widths - #30

Merged
asher merged 2 commits into
mainfrom
verify-width-pack
Aug 7, 2026
Merged

feat(kernel): skinny_matmul, dense small-N matmul for speculative verify widths#30
asher merged 2 commits into
mainfrom
verify-width-pack

Conversation

@asher

@asher asher commented Aug 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

asher added 2 commits August 6, 2026 17:52
MLX's steel GEMM leaves the GEMV fast path at M >= 2 and runs small-N
large-K shapes far below their bytes (router gates, indexer weight
projections, hyper-connection mixes at speculative verify widths: 19-42us
per call where the bytes cost 3-8us). One simdgroup per output column
streams the w row coalesced holding all M row accumulators in registers,
f32 accumulate, one round at the write. 4-8x per call at M in 2..16,
parity with the stock GEMV at M=1. CPU eval mirrors the kernel semantics.
…garbage

The factories short-circuited the Contiguous node on a build-time
row_contiguous flags check, but flags of an unevaluated array are not
meaningful yet (a transposed lazy view reports contiguous), so the
kernels walked the wrong strides. Unconditional Contiguous node, which
aliases zero-copy at eval when the input is already packed. Same class
as the gather_qmm fix; moe_glu/route_shed sites still use the ternary
on activation inputs that are contiguous products today.
@asher
asher merged commit a73dcdb into main Aug 7, 2026
7 checks passed
@asher
asher deleted the verify-width-pack branch August 7, 2026 01:26
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.

1 participant