Prerequisites
Feature Description
I was fiddling with the Vulkan issues on rx9070 xt and it was giving me 4 - 5 TG/s .
here is a patch i had for llama.cpp earlier.. i used it to adapt and fix the beellama.cpp.
Vulkan Performance Fix for AMD RDNA2/3/4 (RX 9070 XT and similar)
Issue: AMD RX 9070 XT (RDNA4/gfx1201) was getting only ~5 t/s decode speed on Qwen3-8B-Q4_K_M via Vulkan backend.
Root cause: AMD's proprietary Vulkan driver incorrectly reports host-visible device memory support on discrete GPUs. Without REBAR enabled, accessing host-visible VRAM from GPU is extremely slow, creating a severe bottleneck in MUL_MAT_VEC operations during decode (output projection layer).
Fix: Force device-local memory allocation by default for AMD RDNA2/RDNA3/RDNA4 discrete GPUs, bypassing the slow host-visible path.
Results: 5.4 t/s → 89-90 t/s decode (16.5x improvement), 355 t/s → 1617 t/s prompt processing (4.5x improvement).
Changes in ggml/src/ggml-vulkan/ggml-vulkan.cpp:
- Added AMD_RDNA4 architecture detection (API version 1.4, device ID 0x7550)
- Disabled KHR_coopmat for RDNA4 (has WMMA, not cooperative matrices)
- Added RDNA4 to pipeline configs and row management optimizations
- Added AMD-specific MUL_MAT_VEC workgroup size tuning
- Set disable_host_visible_vidmem = true by default for discrete AMD RDNA GPUs
vulkan-amd-rdna4-perf-fix.patch
Motivation
Vulkan was performing really bad. I am working on fixing the PP and TG more
Possible Implementation
No response
Prerequisites
Feature Description
I was fiddling with the Vulkan issues on rx9070 xt and it was giving me 4 - 5 TG/s .
here is a patch i had for llama.cpp earlier.. i used it to adapt and fix the beellama.cpp.
Vulkan Performance Fix for AMD RDNA2/3/4 (RX 9070 XT and similar)
Issue: AMD RX 9070 XT (RDNA4/gfx1201) was getting only ~5 t/s decode speed on Qwen3-8B-Q4_K_M via Vulkan backend.
Root cause: AMD's proprietary Vulkan driver incorrectly reports host-visible device memory support on discrete GPUs. Without REBAR enabled, accessing host-visible VRAM from GPU is extremely slow, creating a severe bottleneck in MUL_MAT_VEC operations during decode (output projection layer).
Fix: Force device-local memory allocation by default for AMD RDNA2/RDNA3/RDNA4 discrete GPUs, bypassing the slow host-visible path.
Results: 5.4 t/s → 89-90 t/s decode (16.5x improvement), 355 t/s → 1617 t/s prompt processing (4.5x improvement).
Changes in ggml/src/ggml-vulkan/ggml-vulkan.cpp:
vulkan-amd-rdna4-perf-fix.patch
Motivation
Vulkan was performing really bad. I am working on fixing the PP and TG more
Possible Implementation
No response