Feature Request: VULKAN CODE PATCH

Abierto
#173 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
28/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
cpp, machine-learning
Área
performance

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
C++
Estrellas
1.2k
Forks
80
Merge medio
4 d 20 h
PR fusionados (30 d)
2

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Anbeeld/beellama.cpp

Todos los issues de Anbeeld/beellama.cpp

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.