Feature Request: VULKAN CODE PATCH

Aperta
#173 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
cpp, machine-learning
Ambito
performance

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C++
Stelle
1.2k
Fork
80
Merge medio
4g 20h
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Anbeeld/beellama.cpp

Tutte le issue di Anbeeld/beellama.cpp

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.