Performance of llama.cpp with Vulkan #10879
Replies: 83 comments 127 replies
-
AMD FirePro W8100
|
Beta Was this translation helpful? Give feedback.
-
AMD RX 470
|
Beta Was this translation helpful? Give feedback.
-
ubuntu 24.04, vulkan and cuda installed from official APT packages.
build: 4da69d1 (4351) vs CUDA on the same build/setup
build: 4da69d1 (4351) |
Beta Was this translation helpful? Give feedback.
-
Macbook Air M2 on Asahi Linux ggml_vulkan: Found 1 Vulkan devices:
|
Beta Was this translation helpful? Give feedback.
-
Gentoo Linux on ROG Ally (2023) Ryzen Z1 Extreme ggml_vulkan: Found 1 Vulkan devices:
|
Beta Was this translation helpful? Give feedback.
-
ggml_vulkan: Found 4 Vulkan devices:
|
Beta Was this translation helpful? Give feedback.
-
build: 0d52a69 (4439) NVIDIA GeForce RTX 3090 (NVIDIA)
AMD Radeon RX 6800 XT (RADV NAVI21) (radv)
AMD Radeon (TM) Pro VII (RADV VEGA20) (radv)
Intel(R) Arc(tm) A770 Graphics (DG2) (Intel open-source Mesa driver)
|
Beta Was this translation helpful? Give feedback.
-
@netrunnereve Some of the tg results here are a little low, I think they might be debug builds. The cmake step (at least on Linux) might require |
Beta Was this translation helpful? Give feedback.
-
Build: 8d59d91 (4450)
Lack of proper Xe coopmat support in the ANV driver is a setback honestly.
edit: retested both with the default batch size. |
Beta Was this translation helpful? Give feedback.
-
Here's something exotic: An AMD FirePro S10000 dual GPU from 2012 with 2x 3GB GDDR5. build: 914a82d (4452)
|
Beta Was this translation helpful? Give feedback.
-
Latest arch with For the sake of consistency I run every bit in a script and also build every target from scratch (for some reason kill -STOP -1
timeout 240s $COMMAND
kill -CONT -1
ggml_vulkan: Found 1 Vulkan devices:
ggml_vulkan: 0 = Intel(R) Iris(R) Xe Graphics (TGL GT2) (Intel open-source Mesa driver) | uma: 1 | fp16: 1 | warp size: 32 | matrix cores: none
build: ff3fcab (4459)
This bit seems to underutilise both GPU and CPU in real conditions based on
|
Beta Was this translation helpful? Give feedback.
-
Intel ARC A770 on Windows:
build: ba8a1f9 (4460) |
Beta Was this translation helpful? Give feedback.
-
Single GPU VulkanRadeon Instinct MI25 ggml_vulkan: 0 = AMD Radeon Instinct MI25 (RADV VEGA10) (radv) | uma: 0 | fp16: 1 | warp size: 64 | matrix cores: none
build: 2739a71 (4461) Radeon PRO VII ggml_vulkan: 0 = AMD Radeon Pro VII (RADV VEGA20) (radv) | uma: 0 | fp16: 1 | warp size: 64 | matrix cores: none
build: 2739a71 (4461) Multi GPU Vulkanggml_vulkan: 0 = AMD Radeon Pro VII (RADV VEGA20) (radv) | uma: 0 | fp16: 1 | warp size: 64 | matrix cores: none
build: 2739a71 (4461) ggml_vulkan: 0 = AMD Radeon Pro VII (RADV VEGA20) (radv) | uma: 0 | fp16: 1 | warp size: 64 | matrix cores: none
build: 2739a71 (4461) Single GPU RocmDevice 0: AMD Radeon Instinct MI25, compute capability 9.0, VMM: no
build: 2739a71 (4461) Device 0: AMD Radeon Pro VII, compute capability 9.0, VMM: no
build: 2739a71 (4461) Multi GPU RocmDevice 0: AMD Radeon Pro VII, compute capability 9.0, VMM: no
build: 2739a71 (4461) Layer split
build: 2739a71 (4461) Row split
build: 2739a71 (4461) Single GPU speed is decent, but multi GPU trails Rocm by a wide margin, especially with large models due to the lack of row split. |
Beta Was this translation helpful? Give feedback.
-
AMD Radeon RX 5700 XT on Arch using mesa-git and setting a higher GPU power limit compared to the stock card.
I also think it could be interesting adding the flash attention results to the scoreboard (even if the support for it still isn't as mature as CUDA's).
|
Beta Was this translation helpful? Give feedback.
-
I tried but there's nothing after 1 hrs , ok, might be 40 mins... Anyway I run the llama_cli for a sample eval...
Meanwhile OpenBLAS
|
Beta Was this translation helpful? Give feedback.
-
OS: openSUSE Tumbleweed
build: de4c07f (5359) |
Beta Was this translation helpful? Give feedback.
-
That would be cool to have a graph showinv cuda vs vulkan performance over time/versions |
Beta Was this translation helpful? Give feedback.
-
I've noticed that on my RX 7800 XT, the performance of the RADV driver is significantly worse than AMDVLK when using coopmat. In fact, the integer dot implementation ends up being much faster. Has anyone else run into this? It seems like it could be a driver implementation issue, but I’d like to gather some feedback before diving deeper. COOPMAT RADV
ggml_vulkan: 0 = AMD Radeon RX 7800 XT (RADV NAVI32) (radv) | uma: 0 | fp16: 1 | warp size: 64 | shared memory: 65536 | int dot: 1 | matrix cores: KHR_coopmat
COOPMAT AMDVLK
ggml_vulkan: 0 = AMD Radeon RX 7800 XT (AMD open-source driver) | uma: 0 | fp16: 1 | warp size: 64 | shared memory: 32768 | int dot: 1 | matrix cores: KHR_coopmat
INT DOT RADV
ggml_vulkan: 0 = AMD Radeon RX 7800 XT (RADV NAVI32) (radv) | uma: 0 | fp16: 1 | warp size: 64 | shared memory: 65536 | int dot: 1 | matrix cores: none
INT DOT AMDVLK
ggml_vulkan: 0 = AMD Radeon RX 7800 XT (AMD open-source driver) | uma: 0 | fp16: 1 | warp size: 64 | shared memory: 32768 | int dot: 1 | matrix cores: none
build: 360a9c98 (5379) |
Beta Was this translation helpful? Give feedback.
-
parameter --device performance effect on multi GPUs configvulkan-1.4.314 + llama.cpp Build 5395 9c404ed on Mac Pro 2019 + 8 GPUs Qwen3-235B-A22B-Q4_K_M (142 Go) Run 1 with --device parameter llama_perf_context_print: prompt eval time = 4451,51 ms / 31 tokens ( 143,60 ms per token, 6,96 tokens per second) Run 2 without --device parameter llama_perf_context_print: prompt eval time = 11306,90 ms / 29 tokens ( 389,89 ms per token, 2,56 tokens per second) |
Beta Was this translation helpful? Give feedback.
-
parameter --flash-attn performance effect on multi GPUs configvulkan-1.4.314 + llama.cpp Build 5395 9c404ed on Mac Pro 2019 + 8 GPUs Qwen3-235B-A22B-UD-Q5_K_XL (167 Go)./llama-cli -m Qwen3-235B-A22B-UD-Q5_K_XL-00001-of-00004.gguf -mg 6 -ngl 99 --no-mmap -p "Using one single html script, create a beautiful website" -c 13072 llama_perf_sampler_print: sampling time = 6,35 ms / 74 runs ( 0,09 ms per token, 11659,05 tokens per second) ./llama-cli -m Qwen3-235B-A22B-UD-Q5_K_XL-00001-of-00004.gguf -mg 6 -ngl 99 --no-mmap --device Vulkan4,Vulkan5,Vulkan6,Vulkan7,Vulkan3,Vulkan2,Vulkan1,Vulkan0 -p "Using one single html script, create a beautiful website for a tutorial on Tensorflow" --rope-scaling yarn --rope-scale 4 --yarn-orig-ctx 32768 -c 13072 -fa -ctv q8_0 -ctk q8_0 llama_perf_sampler_print: sampling time = 140,92 ms / 1007 runs ( 0,14 ms per token, 7145,70 tokens per second) ./llama-cli -m Qwen3-235B-A22B-UD-Q5_K_XL-00001-of-00004.gguf -mg 6 -ngl 99 --no-mmap --device Vulkan4,Vulkan5,Vulkan6,Vulkan7,Vulkan3,Vulkan2,Vulkan1,Vulkan0 -p "Using one single html script, create a beautiful website for a tutorial on Tensorflow on MacOs with metal gpu" -c 13072 --flash-attn -ctv q8_0 -ctk q8_0 llama_perf_sampler_print: sampling time = 402,09 ms / 2812 runs ( 0,14 ms per token, 6993,49 tokens per second) |
Beta Was this translation helpful? Give feedback.
-
7900 XTX Vulkan ./build/bin/llama-bench -m '/mnt/gamu/AI/textModels/llama-2-7b.Q4_0.gguf' -ngl 100
build: c9c64de (5431) Vulkan -fa 1 ./build/bin/llama-bench -m '/mnt/gamu/AI/textModels/llama-2-7b.Q4_0.gguf' -ngl 100 -fa 1
build: c9c64de (5431) ROCm ./build/bin/llama-bench -m '/mnt/gamu/AI/textModels/llama-2-7b.Q4_0.gguf' -ngl 100
build: c9c64de (5431) |
Beta Was this translation helpful? Give feedback.
-
Intel Arc B570
./build-vk/bin/llama-bench -m ./llama-2-7b.Q4_0.gguf -ngl 100
build: 8e186ef (5449)
./build-vk/bin/llama-bench -m ./llama-2-7b.Q4_0.gguf -ngl 100 -fa 1
build: 8e186ef (5449)
./build-vk-coop-mat/bin/llama-bench -m ./llama-2-7b.Q4_0.gguf -ngl 100
build: 8e186ef (5449)
./build-vk-coop-mat/bin/llama-bench -m ./llama-2-7b.Q4_0.gguf -ngl 100 -fa 1
build: 8e186ef (5449) |
Beta Was this translation helpful? Give feedback.
-
I was curious so I ran a Vulkan vs Cuda benchmark on an A100 GPU (80GB variant). Results are below. I was very impressed by how fast Vulkan is! Cuda is of course faster, but the Vulkan is not that far behind. ../llama.cpp/build_cuda/bin/llama-bench -m llama-2-7b.Q4_0.gguf -fa 0,1
build: d394a9a (5454) $ ../llama.cpp/build_vulkan/bin/llama-bench -m llama-2-7b.Q4_0.gguf -fa 0,1
|
Beta Was this translation helpful? Give feedback.
-
AMD Ryzen 5 8600G (Zen4 APU 6c/12t, 760M, RDNA3, 2x32GB DDR5-5600) OS: Debian 13
build: 9ecf3e6 (5466) |
Beta Was this translation helpful? Give feedback.
-
5070 Ti Vulkan llama-bench.exe -m D:\models\llama-2-7b.Q4_0.gguf -fa 0,1
build: d13d0f6 (5468) Cuda llama-bench.exe -m D:\models\llama-2-7b.Q4_0.gguf -fa 0,1
build: d13d0f6 (5468) |
Beta Was this translation helpful? Give feedback.
-
Intel Arc A770 (16Gb)
ggml_vulkan: 0 = Intel(R) Arc(TM) A770 Graphics (Intel Corporation) | uma: 0 | fp16: 1 | warp size: 32 | shared memory: 32768 | int dot: 1 | matrix cores: none
build: 259469c (5474) |
Beta Was this translation helpful? Give feedback.
-
Update to the Radeon RX 9070 XT numbers, with Linux 6.15.0 and newer
build: 6f180b9 (5498) Adding ROCm run using ROCm 6.4.1 (which is the first to officially support
build: cdf94a1 (5501) Got rocWMMA to build + install from latest
build: cdf94a1 (5501) |
Beta Was this translation helpful? Give feedback.
-
Hey, there seems to have been a fair number of performance improvements in the code. Last time I posted in this discussion was for b4646. As with last time, I will include both Vulkan and HIP for completeness sake.
ggml_vulkan: Found 1 Vulkan devices:
ggml_vulkan: 0 = AMD Radeon RX 7900 XTX (AMD proprietary driver) | uma: 0 | fp16: 1 | warp size: 64 | shared memory: 32768 | int dot: 1 | matrix cores: KHR_coopmat
Under Vulkan, it is almost 6% faster than it was a couple months ago.
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 ROCm devices:
Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32
For HIP, a ~10% improvement since last time. Here is an interesting thing: FA under HIP is now faster than without. Vulkan with FA is still slower than without.
Meaning almost 15% faster over what HIP without FA was a few months ago, 4% faster than what HIP without FA is now, and 9% faster than what Vulkan is now. |
Beta Was this translation helpful? Give feedback.
-
Card: AMD Radeon PRO W5700 (
build: 4265a87 (5499) |
Beta Was this translation helpful? Give feedback.
-
RTX 3070 8Gb
For comparison, CUDA benchmark:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is similar to the Apple Silicon benchmark thread, but for Vulkan! Many improvements have been made to the Vulkan backend and I think it's good to consolidate and discuss our results here.
We'll be testing the Llama 2 7B model like the other thread to keep things consistent, and use Q4_0 as it's simple to compute and small enough to fit on a 4GB GPU. You can download it here.
Instructions
Either run the commands below or download one of our Vulkan releases. If you have multiple GPUs please run the test on a single GPU using
-sm none -mg YOUR_GPU_NUMBER
unless the model is too big to fit in VRAM.Share your llama-bench results along with the git hash and Vulkan info string in the comments. Feel free to try other models and compare backends, but only valid runs will be placed on the scoreboard.
If multiple entries are posted for the same device newer commits with substantial Vulkan updates are prioritized, alternatively the one with the highest tg128 score will be used. Performance may vary depending on driver, operating system, board manufacturer, etc. even if the chip is the same. For integrated graphics note that your memory speed and number of channels will greatly affect your inference speed!
Vulkan Scoreboard for Llama 2 7B, Q4_0 (no FA)
Vulkan Scoreboard for Llama 2 7B, Q4_0 (with FA)
Beta Was this translation helpful? Give feedback.
All reactions