Reproduce “Above the Inner Loop: Exceeding Accelerate at LLM Prefill GEMM on the M1 AMX” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Deyvik Bhan

A custom direct-AMX kernel for single-precision General Matrix Multiplications (SGEMMs) in LLM prefill workloads on the Apple M1 AMX is presented, demonstrating up to 2.04x speedup over Apple's Accelerate framework. The work identifies that performance gains on M1 AMX stem from enabling multi-threading across both AMX blocks and pre-packing constant model weights, rather than microkernel-level instruction optimizations.

Key insights

  • The M1 AMX inner loop is fundamentally load-issue bound, meaning its performance limit is dictated by operand loading rather than the raw FMA32 instruction throughput.
  • Significant performance gains for LLM prefill GEMMs on M1 AMX are achieved through higher-level architectural and deployment strategies, specifically by fully utilizing both on-chip AMX blocks and amortizing weight packing costs, rather than instruction-level microkernel optimizations.
  • Apple's Accelerate framework's standard routines (`cblas_sgemm`, `BNNSMatMul`) underutilize the M1's E-cluster AMX block and incur per-call weight packing overheads, leading to suboptimal performance for LLM prefill GEMM shapes.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.