# Understand KleidiAI SME2 matmul microkernels

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/)
- [Overview and setup](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/introduction/)
- [Matmul tiling and packing](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/kai_matmul_kernel_overview/)
- [SME2 INT8 MOPA for matmul](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/sme2_mpoa_matmul/)
- [Decode the SME2 matmul microkernel](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/the_sme2_matmul_microkernel/)
- [Repack RHS weights (GGML Q4_0)](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/explain_with_an_example_p1/)
- [Quantize and pack LHS activations](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/explain_with_an_example_p2/)
- [Walk the SME2 matmul inner loop](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/explain_with_an_example_p3/)
- [Wrap-up](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/summary/)
- [Next Steps](https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/kai_sme2_matmul_ukernel_explained/_next-steps/)

Understand KleidiAI SME2 matmul microkernels

## About this Learning Path

|  |  |
| --- | --- |
| Skill level: | Advanced |
| Reading time: | 40 min |
| Last updated: | 12 Nov 2026 |

|  |  |
| --- | --- |
| Author: | Zenon Zhilong Xiu , Arm<br>[LinkedIn](https://linkedin.com/in/zenon-zhilong-xiu-491bb398) |
| Arm IP: | [Arm C1](https://support.arm.com/?tab=compute-ip&Product%20Type=Application%20Processors) |
| Tags: | [AI/ML](https://learn.arm.com/tag/ai-ml/) [Android](https://learn.arm.com/tag/android) [Linux](https://learn.arm.com/tag/linux) [CPP](https://learn.arm.com/tag/cpp) [KleidiAI](https://learn.arm.com/tag/kleidiai) [llama.cpp](https://learn.arm.com/tag/llama.cpp) [SME2](https://learn.arm.com/tag/sme2) |

### Who is this for?
This is an advanced topic for software developers, performance engineers, and AI practitioners.

### What will you learn?
After completing this Learning Path, you'll be able to perform the following tasks:
- Explain how a KleidiAI microkernel performs matrix multiplication (matmul) with quantized data
- Identify how SME2 INT8 MOPA (matrix outer product accumulate) instructions map to matmul work
- Trace how quantization and packing feed an SME2 matmul microkernel (using GGML Q4_0 and llama.cpp call stacks as a concrete example)
- Perform basic hands-on checks (source inspection and optional disassembly) to confirm where SME2 instructions appear

### Prerequisites
Before starting, you'll need the following prerequisites:
- Basic understanding of general matrix multiplication (GEMM) and matmul operations
- Basic understanding of quantization concepts for neural networks
- (Optional) Access to an Arm CPU with SME2 support (Linux or Android) for hands-on verification steps

### Summary
You’ll examine how a KleidiAI SME2 INT8 MOPA microkernel performs quantized matrix multiplication on Arm CPUs. First, you’ll learn how tiling and packing parameters control the kernel, decode its name, and interpret its work unit. Then, you’ll follow a `GGML Q4_0` example and inspect source or disassembly to identify the SME2 instructions.
