Skip to content

Feature Request: VULKAN CODE PATCH #173

Description

@Maxritz

Prerequisites

  • I am running the latest code. Mention the version if possible as well.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new and useful enhancement to share.

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:

  1. Added AMD_RDNA4 architecture detection (API version 1.4, device ID 0x7550)
  2. Disabled KHR_coopmat for RDNA4 (has WMMA, not cooperative matrices)
  3. Added RDNA4 to pipeline configs and row management optimizations
  4. Added AMD-specific MUL_MAT_VEC workgroup size tuning
  5. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions