r/LocalLLaMA • u/returnity • 15h ago
Resources AMD-specific llama.cpp patch nearly doubles prefill/decode
https://devnull.land/amd-specific-llama-cppI know we're all a bit faded on the vibe-coded inference engines (as incredible as Strata/Splash/Basalt/Halogen/Gufo/etc. are for their specific models/hardware), but this is different enough that I thought it was worth sharing the write-up I stumbled across about llama-cpp-rdna-boosts.
This github repo is a minimal patch you can apply to your pinned llama.cpp build to specifically boost performance on AMD RDNA 3 & 4 cards (edit: “best-effort” RDNA 2 support too), while maintaining llama.cpp's broad compatibility with nearly every model. The write-up documents his R9700's prefill increasing from 700tps to 1300 tps & decode from 35tps to 55tps on Q6_K_L Swift-1.5-Qwen3.8-27B. That's an increase of ~80% over base llama.cpp before patching, though purpose-built inference engines still appear to have a slight edge.
I don't have an R9700 to test this out (...yet) but it seemed worth sharing for everyone here who's running AMD hardware, but is looking for broader model compatibility than model-specific custom engines can provide. Has anyone here tried this?
59
u/ThankGodImBipolar 15h ago
The post should probably clarify that this targets mainly RDNA 3 and 4, as there's a lot of people with MI50s and V620's on this subreddit.
Happy to see that it supports RDNA 3 though, as normally these AMD specific PRs/engines/etc. are STX-H or RDNA4 only.
26
u/jacek2023 llama.cpp 15h ago
So why no PR?
7
u/bootkeen 13h ago
what is the future of this patch? will it be mainteined or rebased onto latest llama versions? is it going to be PRed and merged into original llama.cpp?
21
u/d0pe-asaurus 15h ago
I use https://github.com/achyudh/llama.cpp/tree/feature/adaptive-kv-stream-rocm which combines llama-cpp-rdna-boosts with a port of adaptive-kv-streaming. Works with gfx1201 and gfx1200.
Ever since finding out about it i haven't changed a thing in my setup, I can run Qwen 3.8 27B UD-IQ4-XS, 262k context, Q8/Q4 K/V cache on my 9060xt.
6
u/OverdosedSauerkraut 15h ago edited 15h ago
Nice find/work! I'll try to check it out over the weekend. I really wish llama.cpp devs took performance seriously...
However after looking into the repo I can see why this won't get merged in the mainstream. Though it also cleans up a lot of crap in the code. This seems like one of the mega-MRs that does everything and noone wants to review.
3
u/TheCat001 14h ago
Any boost for RDNA2 ? :(
1
u/Filters83to 13h ago
Nice find! Btw 99% of the problem can be solved by Claude or codex, just ask them to optimize it for your setup and you are good to go ( kinda ;) )
1
u/randoomkiller 11h ago
MI50?
1
u/p186 10h ago
Nice. I’m rebuilding my workstation and have 2 GPUs that use RDNA 3/4. Thanks OP.
1
u/Beneficial_Fish_7509 9h ago
Things are really looking bright for AMD hardware with LLMs. It seems like a lot of the issues were software, not hardware.
1
u/Daniel_H212 8h ago
Does this help strix halo?
1
u/xsilas43 6h ago
Yes these patches provide a significant boost on my 9070xt.
1
u/Samecowagain 5h ago
If you own an R9700 and run Qwen 3.8 at home on it, I would switch to Radiance instead. https://codeberg.org/StillDeadcode/radiance - installed as docker, easy to setup, and dedicated for the R9700 and a few models. Plus you get help on discord launch80 if needed, or can exchange feedback with others.
I run a dual R9700 setup with Qwen 3.8 27b IQR8, 200k context and 3500 t/s prefill and 140 t/s generation.
1
u/yahbluez 2h ago
did someone say:
https://codeberg.org/StillDeadcode/radiance
1
u/Frizzy-MacDrizzle 2h ago
Not AMD, I pulled llama.cpp last night, nov 28, 2026. Recompiled with specific 120a arch. Boom, no hardware change, no model change, 27 tgs without any tweaking qwen 3.8 command line. Not much.
The pull and recompile with 615 driver and cuda13.5 is going 47 to 50+ on two 5060s.
I’m not moving to Strata, locked to a small amount of models and is not compatible with my software layer is not going to happen, so if you get more tgs, great I’m happy for you.
It seems MAYBE, there are changes in cpp too.
1
u/Mitchy103 2h ago
yeah, saw this was trending on Hacker News. This look great! I do have an AMD GPU laying around, will try to give it a shot. I wish that this changes can also be merge by llama.cpp, recently they put a lot of efforts in improving the speed! Quite exiting ;)
1
u/modernkennnern 52m ago
How does this compare to Strata?
I use Strata on a RX 9070XT, but if I don't have to use such model-specific engines I'd rather not; especially since everyone says it trades quality for speed (I can't confirm or deny that myself: never ran Q3.8FN on any other engine for a prolonged time)
1
u/Sh1ftyFella 14h ago
I wish people would actually do more testing and more variety before doing write-ups like this. I know it’s mentioned in the article that he is using an eGPU but there should be no reason r9700 should be that slow on stock llama. Especially with MTP
-1
u/noctrex 14h ago
And I use https://github.com/stew675/llama-cpp-rdna-boosts