[KongchangAI]
· 1 min read· 947 words

llama.cpp AMD Patch Tested: Generation Speed Jumps from 35 to 55 tokens/s

llama.cpp AMD Patch Tested: Generation Speed Jumps from 35 to 55 tokens/s

llama.cpp RDNA Boost speeds up AMD GPUs with lightweight patches that don't alter model behavior.

The article introduces the developer's "llama.cpp RDNA Boost" project: rather than rewriting the inference engine, it is a set of lightweight patches for AMD GPUs that users reapply with each new llama.cpp release, combining dedicated optimizations with upstream features. The author measured token generation rising from 35 to 55 tokens/s and prompt reading from 700 to 1300 — about 50% faster generation and nearly double the reading speed. The article also contrasts some AI-generated inference engines that prioritize experts already in VRAM for speed, noting this actually changes the model's expert routing logic, whereas RDNA Boost optimizes only at the inference efficiency level and keeps outputs consistent with the original model. Additionally, the llama.cpp team launched an AMD platform benchmark dashboard on Hugging Face for users to verify gains.

According to a Bilibili video, a developer has released a project called "llama.cpp RDNA Boost," offering a set of lightweight patches for AMD GPU users. The author's own benchmarks show that after applying the patch, token generation speed increased from 35 to 55 tokens/s, and prompt reading speed rose from 700 to 1300 — a significant performance improvement.

Not an engine rewrite, but a set of reusable small patches

Unlike many inference engines on the market that claim to be "optimized for AMD," llama.cpp RDNA Boost takes a very restrained approach: it does not rewrite the entire inference framework, but rather provides a set of small patches specifically targeting AMD GPUs. Each time llama.cpp releases a new version, users simply reapply the patches to the latest codebase.

Just a set of small patches for AMD GPUs

The advantage of this approach is staying closely aligned with upstream. llama.cpp itself iterates frequently, and maintaining a fork can easily drift away from the mainline; the patch approach lets users get AMD-specific optimizations while continuing to enjoy new features and fixes from the official releases.

A patch is an incremental modification technique in software development: it records code changes in the form of a text diff, typically generated by git diff and applied to a source tree via git apply or the patch command. Compared to a fork (copying the entire repository and maintaining it independently), a patch carries only the small number of changed lines, so upgrading to a new upstream version requires just one reapplication — with a small conflict surface and low maintenance cost. Patches do have a cost, though: when upstream modifies code regions the patch depends on, "conflicts" arise and must be resolved manually. This is exactly why the author recommends "keep llama.cpp at the latest version, then reapply the patch" — the earlier you follow upstream, the fewer the conflicts.

Benchmark data: both generation and reading speed up

The author's own figures are quite striking: generation speed rose from 35 to 55 tokens per second, and prompt reading speed from 700 to 1300. For users running large models locally, this means noticeably shorter interaction wait times and faster first responses in long-prompt scenarios.

Prompt reading speed takes off from 700 to 1300

Generation speed improved by roughly 50% and prompt reading nearly doubled. Although the exact gains vary by GPU model and model, the directional benefit is clear.

To understand these numbers, one needs to distinguish the two stages of large model inference. The prompt processing (prefill) stage processes the entire input in parallel and is compute-bound, determining first-token latency; the token generation (decode) stage produces new tokens one by one and is memory-bound, determining sustained output speed. "Prompt reading speed from 700 to 1300" refers to token throughput in the prefill stage, while "35 to 55 tokens/s" refers to the generation rate in the decode stage. Since the decode stage must read the full model weights and KV cache for every token generated, its bottleneck is typically memory bandwidth rather than compute power — which explains why memory-access optimizations targeting AMD GPUs (RDNA architecture) can deliver nearly a 50% generation speedup.

Why the author prefers small changes over "engine rewrites"

In the video, the author also raises an observation worth noting: many AI-written inference engines today cut corners at the model level in pursuit of speed. He gives the example of solutions like Strata, which prioritize experts already resident in VRAM — this effectively changes the model's expert selection logic, i.e., changes how the model "thinks."

For example, Strata prioritizes experts already in VRAM

Against this backdrop, the value proposition of llama.cpp RDNA Boost becomes clearer: it optimizes only at the inference efficiency level and does not touch the model's expert routing strategy, so outputs remain consistent with the original model. For scenarios requiring reproducible results or sensitive to model behavior, this conservative optimization path is more trustworthy.

The "experts" mentioned in the article come from Mixture-of-Experts (MoE) models. In such models, the feed-forward layer consists of multiple parallel "expert" sub-networks, and each token, after being scored by a router, activates only a few of them — controlling computation while keeping the parameter count huge. The routing result directly determines which parameters the model uses for computation. If an inference engine, to reduce data movement, forcibly prioritizes "experts already in VRAM" over the experts with the highest routing scores, it effectively overrides the model's own decisions with VRAM layout, and the output distribution will deviate from the original model. For scenarios demanding reproducibility or alignment with papers and benchmarks, such "changing how the model thinks" optimization is unacceptable, whereas solutions that optimize only at the operator and memory-access level preserve output equivalence.

Companion tool: AMD platform benchmark dashboard

The llama.cpp team recently launched a benchmark dashboard for AMD platforms on Hugging Face, which AMD GPU users can try out directly.

The llama.cpp team

For the community, the official benchmark dashboard helps establish a unified performance reference, giving users a more reliable basis when choosing patches, model quantization schemes, or comparing different GPUs.

Practical recommendations

If you run local large models on an AMD GPU, consider the following practices:

  • Keep llama.cpp at the latest version and reapply the RDNA Boost patches, avoiding outdated forks;
  • Patch effectiveness varies by GPU, so verify actual gains using the official benchmark dashboard or your own fixed test set;
  • If you have strict requirements for output consistency, prioritize pure inference-layer optimization solutions that do not alter model logic.

Overall, this set of patches offers a low-intrusion, upstream-following approach to AMD acceleration, particularly appealing to users unwilling to compromise on model behavior.

#llama.cpp#AMD GPU#RDNA Boost#token generation speed#Mixture-of-Experts#inference optimization
Share:

Related articles