Repository navigation
kleidiai: add SME2 Q4_K and Q6_K matmul support - #29219
Conversation
Signed-off-by: Charles Xu <charles.xu@arm.com> Change-Id: Ib4aa4c9814c010f9cf084783cc80612e364f9a27 Change-Id: I406a6606c3fea51f8cd32331c1ed71466845d363
|
@ggerganov Could you please take a look when you have a chance? Thanks! |
|
@ggml-org/maintainers Could someone please take a look at this PR when you have a chance? This adds KleidiAI SME2 support for Q4_K and Q6_K, with significant performance improvements demonstrated on M4 Pro. Any feedback would be appreciated. Thanks! |
|
@chaxu01 Do you have merge rights? :) |
|
Still seems to be doing a bit worse than the MM_INT8 kernels, especially on longer prompts for me. M4 Pro, master branch as if right now, Qwen3.8-4B (distilled) in Q4_K_M First the default build, This PR locally rebased with the same master as above, Tried This is just FYI. I no objections to merging. The outputs from the models look good. |
I used to have merge rights, but it looks like I no longer do. :) |
|
@max-krasnyansky Thanks Max, appreciate the additional testing and feedback. Interesting to see the native MM_INT8 path performing better for this workload. My original benchmarks with Llama-3.2-1B Q4_K_M and PP512 showed significant improvements with KleidiAI, so the performance difference may be related to the model size, prompt length, and thread configuration. It would be worth investigating this further, particularly the SME/NEON scheduling and how the KleidiAI kernels scale with larger models and longer prompts. |
Change-Id: Ib4aa4c9814c010f9cf084783cc80612e364f9a27 Change-Id: I406a6606c3fea51f8cd32331c1ed71466845d363 Change-Id: Ib4aa4c9814c010f9cf084783cc80612e364f9a27 Signed-off-by: Charles Xu <charles.xu@arm.com>
Change-Id: Ib4aa4c9814c010f9cf084783cc80612e364f9a27 Change-Id: I406a6606c3fea51f8cd32331c1ed71466845d363 Change-Id: Ib4aa4c9814c010f9cf084783cc80612e364f9a27 Signed-off-by: Charles Xu <charles.xu@arm.com>
Change-Id: Ib4aa4c9814c010f9cf084783cc80612e364f9a27
Change-Id: I406a6606c3fea51f8cd32331c1ed71466845d363
Overview
This PR adds KleidiAI SME2 matmul support for Q4_K and enables Q6_K by mapping it to the existing Q8_0 path. It also includes related cleanup and fixes a latent F32 matmul bug in multi-sequence handling that was exposed by the newer Kimi-K3 multi-sequence test.
Additional information
Llama-3.2-1B — PP512 Benchmarks for M4Pro (t/s)
Requirements