Hacker News new | ask | show | jobs
by porkloin 9 days ago
I've tried to get better performance out of ROCm on llama.cpp over and over again this year and keep finding that Vulkan is faster. I do run ROCm for qwen 3.8 flash next via strata, but that's the only place I use it.

I actually re-tested ROCm vs. vulkan for 7900xtx today when testing out Inkling, making sure the ROCm performance hadn't gotten better since my last update a few weeks ago. Testd via llama.cpp latest as of earlier today, b12600, before applying the patch from parent commenter:

- Qwen3.8-27B (Swift-1.5-Qwen3.8-27B-Q4_K_M, MTP on): prefill 762 t/s on Vulkan vs 761 on ROCm, decode 63 vs 52

- Qwen3.6-35B-A3B (Qwen3.6-35B-A3B-MTP-UD-Q4_K_XL): prefill ~2800 on Vulkan vs ~2300 on ROCm, decode 129 vs 115

Also, on many models that I run, ROCm regularly uses .75-1.5 GB more VRAM, which is VRAM I'd gladly spend on more context space instead of burning on overhead.

Inkling itself (IQ4_NL) was actually slightly faster on ROCm with llama.cpp main. ~27 on Vulkan vs. ~30 on ROCm. I'm not sure how much of that can be explained by the bug the parent commenter's patch fixes, no clue if ROCm does the non-contiguous SCALE thing correctly or not. But what I can say is that with post-patch Vulkan does ~41 tok/s and ROCm stays ~30, so I think it's a Vulkan specific bug, and that spread does more or less align with what I've seen with other models ROCM vs. Vulkan on this specific card.

As a long suffering AMD/ATI GPU owner through all the bad dark years up through today, I'd be very happy to run all of this stuff on ROCm if the numbers were there, but they ain't. If you've got tips for something I'm missing, I'm all ears.

4 comments

> I've tried to get better performance out of ROCm on llama.cpp over and over again this year and keep finding that Vulkan is faster.

I found this too, but it's because the default CUDA batch sizes aren't suited to AMD cards. I'm not sure if this will apply to your RDNA3 card, but I wrote this two-line patch which changes only the batch sizes, and that fixed it for my RDNA4 card such that ROCm is faster than Vulkan across the board:

https://github.com/ggml-org/llama.cpp/issues/29820

That said, llama.cpp is not the best option here. The radiance server is amazingly fast, like 50% faster than llama.cpp on my card at least:

https://codeberg.org/StillDeadcode/radiance

Stick with the pre-2.2.0 release, it supports more quantized KV cache types so you can run it in smaller memory footprints.

https://github.com/osahum/llama.cpp-rdna3 is also faster than upstream llama by 60 to 100%, I read the benchmarks on the repo and was a bit "yeah, ok" and then I actually tried it and he's if anything underselling some of them based on running various versions of Qwen 3.8.
I wouldn't be surprised there are better AMD forks. I just tried running the gsm8k and Humaneval benchmarks I was using to tune my patched llama.cpp with radiance and it's night and day. llama.cpp peaked at around 120 t/s across two streams with the dflash2 speculative execution on qwen3.8-27b, and radiance hits over 400 t/s on this same benchmark. llama.cpp was running an int4 quant, radiance runs mxfp4, KV cache quantization is similar, similar draft acceptance, both single card setups. Crazy difference. Backends tuned for CUDA are a real bottleneck for AMD cards.
Thank you for posting the link to the Radiance server. It's ungoogleable under the name "radiance llm", and I was confused by all the people raving about it.
It used to be called vllm-radiance as it was a fork of vllm, but they've since branched into a standalone C++ server. Much better overall.
I've been following ROCm for over a decade and this has always been the situation. In my experience optimization for the shape of the hardware tends to be more important than choice of API anyway and I just don't want to deal with it. Targeting ROCm only makes sense if you have a big enough deployment that you're going to maintain your own software stack. I tried to convince them to invest in deep learning and usability but without success. Arguably they did a good job of managing their priorities though given that they got Zen launched and a lot of APU design wins.
Mirrors my experience (also 7900XTX), Vulkan either runs faster or about the same, interestingly the desktop stutters/gets interrupted much less with Vulkan than with ROCm running.

Have you played with https://github.com/osahum/llama.cpp-rdna3 by any chance?

I see ridiculous speedups with that vs upstream llama.cpp (roughly double, equal with or ahead of hipfire) and it lets you build both versions in one binary and switch via an option, it's just neat in that "huh neat how?" way for me so far.

you probably need to revert to rocm-6.4.4. Each time I try whatever 7.x version I find it 15-20% slower than 6.4.4. I'm not sure what they're doing in there, but given the amazing size of the packages, I suspect that keeping stuff small and efficient isn't among the goals.