Remix.run Logo
Apple Silicon and macOS VMs: 11–16× Faster LLM Inference with Llama.cpp(github.com)
45 points by frabonacci an hour ago | 15 comments
engzaanin 13 minutes ago | parent | next [-]

That makes sense. The title initially sounded like a general llama.cpp speedup on Apple Silicon, but if the improvement comes from fixing kernel selection inside Virtualization.framework VMs, that distinction is pretty important.

simonw 24 minutes ago | parent | prev | next [-]

It looks to me like this won't speed up llama.cpp for everyone, just for users running it in this particular kind of Virtualization.framework VM.

The fix here works around a problem where the VM was causing llama.cpp to select the wrong kernels.

shay_ker 5 minutes ago | parent | prev | next [-]

I recall there was another YC startup that was working on Mac-specific ML optimizations for local inference (and perhaps fine-tuning).

I wonder if their work is related?

thehamkercat 31 minutes ago | parent | prev | next [-]

> 11.08× faster and generated tokens 16.36× faster than the same workload in the same stock VM.

So this was the comparison, for me the title was a bit confusing

frabonacci 15 minutes ago | parent [-]

yeah fair point. it's always tricky to get the whole idea across within HN's title limit. tldr: we ran the same workload in the same Lume macOS VM on the same Apple Silicon host, first with stock Metal capability reporting and then with our process-scoped dynamic library. The 11.08x figure is prompt processing, while 16.36x is token generation. the mechanism technically extends to graphics workloads too but these figures are specifically from llama.cpp

azinman2 26 minutes ago | parent | prev | next [-]

I don’t understand what Apple 1-9 are. At first I thought it was M series chips but there is no M9 (yet)

niklasbuschmann 22 minutes ago | parent [-]

https://developer.apple.com/documentation/metal/mtlgpufamily

wtallis 8 minutes ago | parent [-]

So those generation numbers aren't really anchored to Apple's hardware designs. It's just counting from when Apple introduced the Metal API, and the first several generations were when the GPU cores Apple was using were still nominally PowerVR designs.

purplemoonx 12 minutes ago | parent | prev [-]

Still no easy way to get up and running performantly with Llama.cpp

Nobody tells you how, they just act like you're an idiot. So I always say fuck this and install Ollama.

Then everyone goes BLASPHEMY "just use llama.cpp"

Yeah I did, and it's slow as hell. It doesn't work well. Idk why.

"You aren't doing it right"

Okay tell me how

"NO"

-----

For this reason, Ollama is the superior solution. I know, downvote, everyone hates Ollama here but until llama.cpp gets their shit together on developer experience it doesn't exist as far as I'm concerned

drittich 6 minutes ago | parent | next [-]

There are certainly challenges. When setting up a new model, I get AI to walk me through the commands using llama-benchmark that determine the best parameters for my particular configuration and needs. Once you've got that it's pretty easy to port those parameters to llama-server. It takes me about an hour to run through this process. It would be great if there was a registry of hardware, models, configuration parameters, and resulting tokens per second. Maybe one day we'll get there.

kevin42 2 minutes ago | parent | next [-]

What kind of parameters do you end up changing, and how much difference does it make. Perhaps I am missing something and get more tok/sec, but I usually just do a git pull, then rebuild the latest whenever I get a new model.

In the past, I had to play with chat templates for some models to work with agents for tool calling. But I've never had to do anything other than specify the model, and tweaking the context size in some cases.

purplemoonx a minute ago | parent | prev [-]

> It takes me about an hour to run through this process

Yeah not doing that

kevin42 4 minutes ago | parent | prev | next [-]

What hardware do you run? I have a first-gen mac studio, and I just run cmake and build with no special options. Same thing with llama-server, I just specify the model and use the built-in web UI.

For reference, I get ~26 tok/sec with the new Muse 30B model.

unglaublich 10 minutes ago | parent | prev [-]

I think people generally throw Claude or Codex at the configuration challenge, so they don't know either.

purplemoonx 4 minutes ago | parent [-]

Maybe the llama.cpp dev loved webpack as a child, or just loves making the most simple thing complicated as hell for no reason lol