BaseRT: Best-in-Class LLM Inference on Apple Silicon via Native Metal
The paper introduces BaseRT, a native Metal inference runtime for Apple Silicon that leverages chip-specific optimizations to achieve record-breaking throughput for large language models, outperforming existing frameworks like llama.cpp and MLX by up to 1.56x.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Big Idea: Building a Custom Race Car
Imagine you want to drive a race car (a Large Language Model, or LLM) on a very specific track (Apple Silicon chips like the M3 or M4).
Currently, most people drive these cars using a "universal adapter" or a "rental car kit" (existing software like llama.cpp or MLX). These kits are great because they work on many different tracks, but they aren't perfectly tuned for this specific Apple track. They have extra weight, unnecessary steps, and a driver who doesn't know the shortcuts.
BaseRT is a new, custom-built race car designed only for the Apple track. The team at Base Compute stripped away the heavy adapters and built a vehicle from the ground up to match the track's unique curves and rules. The result? It drives significantly faster.
The Problem: Why Current Software is "Slow"
The paper argues that existing software for running AI on Macs is like a delivery truck making too many stops.
- The "Middleman" Problem: Most software uses a "framework" (like a middleman) to talk to the computer's graphics chip (the GPU). This middleman adds extra steps, like a manager checking a clipboard before every single task.
- The "Memory" Problem: Apple computers have a special feature called "Unified Memory," where the CPU and GPU share the same big pool of RAM. Existing software often treats them as if they are in separate rooms, forcing data to walk back and forth unnecessarily.
The Solution: How BaseRT Works
BaseRT cuts out the middleman and builds a direct highway between the brain and the muscle. Here are the four main tricks they used:
The "Data-Driven" Blueprint:
Instead of writing a new set of instructions for every different AI model (like Qwen, Llama, or Gemma), BaseRT uses a single, flexible blueprint. Think of it like a universal remote control that automatically detects which TV you are pointing at and changes its buttons instantly, rather than needing a different remote for every brand. This keeps the engine running smoothly without stopping to reconfigure.The "Zero-Stop" Loop:
When you ask an AI to write a sentence, it generates one word at a time. In old software, the computer has to find a parking spot (memory allocation) for every single new word it creates. BaseRT pre-parks all the spots before the race starts. Once the AI starts talking, it never stops to find a parking spot; it just keeps driving. This eliminates "traffic jams" caused by memory management.The "Fusion" Kitchen:
Usually, an AI has to cook ingredients in separate pots (Matrix Multiplication, Attention, Normalization) and move the food between them. BaseRT fuses these steps into one giant pot. It cooks the ingredients together in a single motion, saving the time it takes to move the food around.The "Custom Driver":
The software knows exactly which Apple chip it is running on (M1, M2, M3, etc.). It adjusts its driving style based on the specific engine size, ensuring it gets the most power out of every drop of fuel.
The Results: Who Won the Race?
The team tested BaseRT against the two biggest competitors: llama.cpp (the most popular open-source runner) and MLX (Apple's own official framework).
- Speed: BaseRT was the fastest in almost every test.
- On small models, it was up to 1.56 times faster than
llama.cpp. - On large "Mixture-of-Experts" models (complex AI brains), it was up to 1.78 times faster at processing the initial prompt.
- On small models, it was up to 1.56 times faster than
- The "Small Model" Sweet Spot: The biggest wins happened on smaller models. This is because, on small models, the "overhead" (the time wasted on administrative tasks) makes up a huge chunk of the total time. By cutting out that waste, BaseRT made a massive difference.
- The "Big Model" Reality: On very large models, the speed is mostly limited by how fast data can move through the memory (bandwidth). Even with a perfect engine, you can't go faster than the speed limit of the road. However, BaseRT still managed to squeeze out extra speed here, proving that previous software wasn't using the road efficiently.
Why Does This Matter? (The "Edge" Shift)
The paper suggests we are moving toward a future where AI runs on your own device (your laptop or phone) rather than in a distant cloud server.
- Privacy: Your data never leaves your computer.
- Speed: No waiting for the internet to send your request back and forth.
- Cost: You don't pay a monthly fee per word; you just pay for the hardware once.
BaseRT proves that Apple Silicon is much more powerful for running AI locally than we thought, if you use software built specifically for it.
What BaseRT Does Not Do (The Limitations)
The paper is honest about what this tool isn't yet:
- Single User Only: It's designed for one person using the AI at a time. It doesn't handle hundreds of people asking questions simultaneously (server load).
- Apple Only: It only works on Macs and iPads. It doesn't work on Windows, Android, or NVIDIA graphics cards yet.
- No "Vision" Yet: It currently handles text models, not models that can "see" images.
The Bottom Line
The authors built a custom engine (BaseRT) that removes all the unnecessary baggage from running AI on Apple computers. By doing so, they unlocked the full speed potential of the hardware, making local AI faster, more private, and more efficient than ever before. You can try it out yourself on GitHub.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.