llama.cpp ROCm vs Vulkan on AMD GPUs: same card, two winners
On one Radeon AI PRO R9700, published llama-bench runs show ROCm reading prompts 41% faster and Vulkan generating tokens 34% faster. What each llama.cpp backend actually is, which cards and systems each supports, why prefill and decode rank differently, and how to pick for your card.
Here is the result that makes “which backend is faster?” the wrong question. Same AMD card, same model, same llama.cpp build: ROCm reads the prompt at 2,746 tokens a second, Vulkan at 1,944. Then Vulkan writes the answer at 124 tokens a second, ROCm at 92. One GPU, two backends, two winners.
Those numbers aren’t ours. They’re a llama-bench run that a user (TheyreEatingTheGeese) posted to llama.cpp’s ROCm performance discussion in August 2025, on a Radeon AI PRO R9700 with Llama 2 7B in Q4_0. Nothing was benchmarked for this post: every number below is someone else’s published measurement, labelled with who ran it and on what, or comes from vendor docs and the llama.cpp source (read on 27 November 2026).
Why this is on everyone’s mind
On 26 November an “AMD-specific fork of llama.cpp” reached the Hacker News front page (300+ points). It’s really a patch set: llama-cpp-rdna-boosts ships 19 patches applied to a clean upstream llama.cpp checkout (re-based on 20 November), for RDNA3, RDNA3.5 (Strix Point and Strix Halo) and RDNA4, with RDNA2 as best effort. It touches the HIP/ROCm backend only: flash attention using matrix instructions, a BF16 KV cache, fused MoE kernels, faster k-quant decode paths and more.
The blogger reports token generation going from about 35 to about 55 tokens a second, and prefill from about 700 to about 1,300, on an R9700 in an eGPU enclosure, with a 27B model and speculative decoding (MTP) switched on. That’s one person’s setup, without the exact flags, so treat it as reported. It does show that the ROCm road still has room to get faster.
Two roads to the same GPU
Whatever app you use, the path is the same until the last step. Ollama or LM Studio calls llama.cpp, llama.cpp hands the tensor math to ggml, and ggml runs it on a backend. On an AMD card there are two.
The ROCm (HIP) backend is the CUDA backend. That’s literal. ggml/src/ggml-hip/CMakeLists.txt builds its sources with file(GLOB GGML_SOURCES_ROCM "../ggml-cuda/*.cu"), and ggml-cuda/vendors/hip.h holds 145 #defines that rename CUDA calls to their HIP twins (cudaMalloc → hipMalloc, cublasGemmEx → hipblasGemmEx). It links AMD’s rocBLAS and hipBLAS, requires ROCm/HIP 6.3 or newer, and you compile it for your chip (-DGPU_TARGETS=gfx1201). The build docs also document HSA_OVERRIDE_GFX_VERSION for cards ROCm doesn’t officially support, and note it doesn’t work on Windows.
The Vulkan backend is a set of compute shaders. Vulkan is the graphics API games use; llama.cpp’s vulkan-shaders folder holds 162 GLSL compute shaders (mul_mm.comp, mul_mmq.comp and so on) compiled to SPIR-V, so the same code runs on AMD, NVIDIA, Intel and Arm GPUs. For matrix hardware it uses the Khronos extension VK_KHR_cooperative_matrix, whose listed contributors are three NVIDIA engineers, one from Arm and one from AMD. On Linux the driver is usually Mesa’s RADV, which exposes cooperative matrix on RDNA3 (gfx11) and newer, according to Mesa’s features.txt. In September 2025 AMD discontinued its own AMDVLK driver and put its “full support behind the RADV driver”.
Which road is open for your card
| ROCm / HIP | Vulkan | |
|---|---|---|
| Official GPU list | Yes: RDNA3 (RX 7900 XTX/XT/GRE, 7800 XT, 7700 XT), RDNA4 (RX 9070 XT/9070/9060 XT, AI PRO R9700), some Radeon PRO and Instinct. “GPUs not listed are not officially supported” | Any GPU with a Vulkan driver: older Radeons, iGPUs such as the 780M, Intel, NVIDIA |
| Linux | Radeon cards on Ubuntu 24.04.4 / 22.04.5 and RHEL 10.1 / 9.7 | Mesa RADV, already in most distros |
| Windows | AMD’s Radeon docs: “Supported for PyTorch only”; llama.cpp still ships a win-rocm build |
Adrenalin driver; llama.cpp ships win-vulkan builds |
| Ollama | ROCm v7; Windows list is RX 7600–7900 and PRO W7500–W7900 only | “Enabled by default”, covers cards beyond the ROCm list |
Sources: ROCm compatibility matrix, ROCm on Radeon and Ryzen (through 7.2.1), Ollama GPU docs, llama.cpp release assets (b12806). One detail stands out: Ollama’s Windows ROCm list has no RDNA4 cards and no Ryzen AI chips, so on Windows those run through Vulkan in Ollama, even though Linux supports them through ROCm.
Prefill vs decode: why the winner flips
Every request has two phases, and llama-bench measures them separately:
- Prefill (
pp512): the whole prompt goes through the model at once, 512 tokens as one big matrix-times-matrix job. That’s compute-bound: matrix units, rocBLAS and tuned kernels matter. - Decode (
tg128): the answer comes out one token at a time, and every token reads every weight once. That’s memory-bound.
Microsoft’s Splitwise paper (Patel et al., 2023) puts it as “a compute-intensive prompt computation, and a memory-intensive token generation.” Two different jobs, so two backends can each win one.
You can even put a ceiling on decode. AMD lists the R9700 at 640 GB/s peak memory bandwidth. The model file is 3.56 GiB, or 3.82 GB, so the card can’t generate more than about 640 ÷ 3.82 ≈ 167 tokens a second (simple arithmetic that ignores the KV cache and caches). Vulkan’s 124 is 74% of that limit; ROCm’s 92 is 55%. Same memory, same limit: the gap is how much of it each road actually uses.
What others measured
| GPU (who ran it) | ROCm pp512 | Vulkan pp512 | ROCm tg128 | Vulkan tg128 |
|---|---|---|---|---|
| Radeon AI PRO R9700 (TheyreEatingTheGeese, Aug 2025) | 2,746 | 1,944 | 92.3 | 124.1 |
| RX 7600 XT, Linux, ROCm 6.4.1 (wbruna, Aug 2025) | 1,100 | 606 | 48.6 | 52.8 |
| Ryzen AI Max+ 395 / Strix Halo, Q4_K_M (lhl, Jul 2025) | 906 | 621 | 40.8 | 47.9 |
| RX 7800 XT, Windows 10 (olegshulyakov, Aug 2025) | 2,152 | 2,146 | 100.9 | 96.9 |
| RX 9070 XT, Fedora 44, ROCm 7.1.1 (cipputi, Jul 2026) | 4,295 | 4,344 | 122.2 | 132.0 |
Llama 2 7B Q4_0 unless noted, flash attention off except the 9070 XT run. The first four rows follow the pattern: ROCm ahead on prefill by 41% to 81%, Vulkan ahead on decode by 9% to 34%. The commenter davispuh summed up the thread the same way: “Vulkan performs way worse on pp than ROCm but better on tg.” The Strix Halo numbers come from lhl’s Framework community tests (HIP with hipBLASLt vs Vulkan with flash attention).
It’s not a law. On Windows, a 7800 XT was a tie. In July 2026, on a 9070 XT with ROCm 7.1.1 and a much newer build, Vulkan led decode by 8% and prefill was a tie: each run’s spread was about ±1,000 tokens a second. And a maintainer in the same thread warns that a 7B Q4_0 model “dosent reflect actual usage much”.
One more twist: flash attention. On that R9700, switching flash attention on cut ROCm’s prefill from 2,746 to 1,300 tokens a second (−53%), while Vulkan barely moved. Commenters pointed at the build: ROCm’s fast flash-attention path needs GGML_HIP_ROCWMMA_FATTN, and “pre rocm7 WMMA is not implemented for RDNA4”. Builds and ROCm versions change these results a lot, which is exactly why patch sets like the one on Hacker News exist.
AMD’s own guide to running LLMs on Radeon (June 2026) labels the ROCm build “Recommended for Best Performance”. For prefill the community numbers agree; for decode they often don’t.
What your app does
- Ollama uses ROCm for the GPUs on its list and Vulkan for more: Vulkan “is enabled by default”.
OLLAMA_VULKAN=0turns Vulkan off,GGML_VK_VISIBLE_DEVICESpicks devices. The docs don’t say which one wins when a card is visible to both. - LM Studio ships both as runtimes (“ROCm llama.cpp” and “Vulkan llama.cpp”). AMD’s LM Studio playbook shows the picker: Ctrl + Shift + R → Runtime Selections.
- llama.cpp itself: download the
rocmor thevulkanrelease build. The same.gguffile loads in both.
Pick your road
- Your card isn’t on ROCm’s list, it’s a laptop iGPU, or you’re on Windows with an RDNA4 card in Ollama: Vulkan. It just needs a driver.
- Long prompts (RAG, coding agents, summarising big documents: prefill-heavy): try ROCm first on a supported RDNA3, RDNA4 or Strix Halo chip.
- Chat (short question, long answer: decode-heavy): Vulkan often matches or wins.
- Either way, measure both on your own card. The two numbers take a minute:
# run once with each build (rocm and vulkan), same model file
llama-bench -m model.gguf -p 512 -n 128 -fa 0,1
Bottom line
Same card, two winners. Prefill is compute and decode is memory, and llama.cpp’s two AMD backends are each better at a different one, at least for now. Pick by your workload, not by the logo, and re-test after big driver, ROCm or llama.cpp updates.
Further reading: Phoronix’s ROCm vs Vulkan comparison for Lemonade. All facts and links for this post: llama.cpp source and docs, AMD ROCm docs, Ollama docs, the llama.cpp performance discussions #15021 and #10879, Khronos, Mesa, and the papers and pages linked above.