BaseRT: Advancing Best-in-Class LLM Inference with Apple M5 Neural Accelerators

· Source: Machine Learning · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Expert, quick

Summary

BaseRT, a native Metal inference runtime for large language models on Apple Silicon, significantly boosts inference throughput on Apple M5 Neural Accelerators. The M5 generation features a redesigned GPU architecture with dedicated Neural Accelerators, exposed via the Metal 4 tensor API. BaseRT leverages a framework-free design and hand-written Metal 4 tensor-core kernels for compute-bound matrix multiplications, including dense, mixture-of-experts GEMM, and flash-attention prefill. On an Apple M5 Pro, BaseRT delivers up to 6.4x higher prompt-processing throughput than llama.cpp and 3.9x higher than MLX across fifteen model configurations (Qwen3, Qwen3.5/3.6, Llama 3.2, Gemma 4 families, sub-1B to 35B parameters). It also maintains a decode lead of up to 1.75x over llama.cpp and 1.33x over MLX, establishing a new performance ceiling for on-device LLM inference. BaseRT is publicly available on GitHub.

Key takeaway

For Machine Learning Engineers optimizing LLM inference on Apple Silicon, BaseRT offers substantial performance gains. Its specialized Metal 4 tensor-core kernels exploit the M5 Neural Accelerators, delivering up to 6.4x higher prompt-processing throughput than llama.cpp. You should consider integrating BaseRT into your M5-based LLM deployments to achieve best-in-class on-device performance, especially for compute-intensive tasks like prompt processing.

Key insights

BaseRT leverages Apple M5 Neural Accelerators and Metal 4 tensor API for significantly faster LLM inference on Apple Silicon.

Principles

Method

BaseRT uses hand-written Metal 4 tensor-core kernels for compute-bound matrix multiplications (dense, MoE GEMM, flash-attention prefill) and existing specialized kernels for memory-bound decode.

In practice

Topics

Code references

Best for: AI Engineer, NLP Engineer, Research Scientist, AI Scientist, Machine Learning Engineer, AI Hardware Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Machine Learning.