AMD Specific Patches for Llama.cpp
162 points - today at 5:11 PM
SourceComments
There has been a rich little ecosystem of folks optimizing llama.cpp for these odd cards (no tensor cores, no native bf16 etc.) including my little personal repo https://github.com/kinchahoy/llama-of-vega.cpp. Stuff like this focused on more modern RDNA doesn’t help us at all.
It’s been interesting to see how much each new frontier model can figure out in terms of optimizing for these GPUs and what they can’t!
Fable and Astra will regularly run out of ideas until I point them to someone’s actually thoughtful repo and then they’ll diligently incorporate ideas.
The optimization wins are huge (I was initially skeptical that per model kernel optimizations would be worth much). 27B at a pristine Q8 quant goes from base llama.cpp at some 250 pp / 25 tg to 600 pp / 40 tg even before speculative decoding.
In the last couple of days I have been playing with Erik Paperniuk’s M1 port of Inco’s Splash, which has completely transformed the speed of Qwen 3.8 27B and Inkling 2 Mini; it has essentially tripled the speed of the former and more than doubled the speed of the latter.
This means the Qwen model is fully viable on an M1 Max, where before I had found it a bit of a waiting game. And it arguably transforms the utility of Inkling 2 Mini; extra speed means it can be left to reason for longer, the downside of needing to do more tool use for search to patch its knowledge is reduced, and it provides a good rough chat model (though this is not its area of greatest strength).
I have not yet found anything that can boost Muse Glimmer to the same extent; I would still prefer that.
But for me I now find that only the rather slow prefill speed really holds the M1 Max back; I suspect these new custom kernels have made the M5 Pro Mac Mini a really cost-effective option if you want to tinker with local AI.
I've been running this for a while and it seems pretty stable, plus I had Claude validate the ported kernels against the originals to make sure they were reasonably close numerically to the validated implementations.
I know it's apples to oranges but the difference I'm talking about is in the attitude and approach.
There is also a llama fork for Ryzen AI and Radeon cards but I'm on mobile.
These new forks generally all have a few things in common:
o They focus on a specific subset of models and/or hardware
o They use a frontier model to vibe-code the entire thing
o They chase ever-higher token generation speeds
… and the results are stunning! Strata is able to run a heavily-quantized model of Qwen 3.8 Flash Next, a 180B parameter model, on a 16GB VRAM graphics card, and 16GB system RAM, and have it generate tokens at a surprisingly high rate.
Nice!
Hardware specific optimizations are definitely one key to faster local tokens, algorithmic optimizations (i.e., all of the academic papers published about different Matrix/Tensor algorithm optimizations as pertains to LLMs) are another...
Anyway, great article!