feat(kernel): skinny_matmul, dense small-N matmul for speculative verify widths - #30
Merged
Conversation
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.
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.
No description provided.