Feature Request: VULKAN CODE PATCH

Ouverte
#173 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
28/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Calme
Stack technique
cpp, machine-learning
Domaine
performance

Piste de recherche

The proposed change touches ggml/src/ggml-vulkan/ggml-vulkan.cpp, specifically the disable_host_visible_vidmem default for discrete AMD GPUs and the MUL_MAT_VEC workgroup tuning. Start by reproducing the slow decode on RDNA hardware with a Vulkan build and comparing against the attached patch. Done would mean a measured, verified speedup that does not regress other GPUs. The patch itself is unreviewed, so confirm the approach with maintainers before writing code.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement
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

Langage dominant
C++
Étoiles
1.2k
Forks
80
Merge moyen
4 j 20 h
PR mergées (30 j)
2

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Anbeeld/beellama.cpp

Toutes les issues de Anbeeld/beellama.cpp

Issues similaires

Plus d'issues C++

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.