Performance of llama.cpp on Nvidia CUDA #15013
Replies: 53 comments 32 replies
This comment has been hidden.
This comment has been hidden.
-
Here's the results for my devices. Not sure how to get a "cuda info string" though. CUDA Scoreboard for Llama 2 7B, Q4_0 (no FA)
CUDA Scoreboard for Llama 2 7B, Q4_0 (with FA)
|
Beta Was this translation helpful? Give feedback.
-
While technically not directly related, there may also be value in comparing AMD ROCM build here too, as ROCM acts a replacement (sometimes a directly compatible layer) for most CUDA calls. I admit risk of confusion for Nvidia users in the thread if this path is taken. |
Beta Was this translation helpful? Give feedback.
-
Device 0: NVIDIA GeForce RTX 3090 Ti, compute capability 8.6, VMM: yes
build: 9c35706 (6060) Device 0: NVIDIA GeForce RTX 3080, compute capability 8.6, VMM: yes
build: 9c35706 (6060) |
Beta Was this translation helpful? Give feedback.
-
Device 0: NVIDIA GeForce RTX 4070 Ti SUPER, compute capability 8.9, VMM: yes
build: 9c35706 (647) |
Beta Was this translation helpful? Give feedback.
-
Device 0: 3090. Power limit to 250w
build: 9c35706 (6060) Device 2: 5090. Power limit to 400w
build: 9c35706 (6060) |
Beta Was this translation helpful? Give feedback.
-
Device 0: NVIDIA GeForce GTX 1080 Ti, compute capability 6.1, VMM: yes
Device 0: NVIDIA GeForce GTX 1080 Ti, compute capability 6.1, VMM: yes
build: 9c35706 (6060) |
Beta Was this translation helpful? Give feedback.
-
@olegshulyakov To help users quickly understand the approximate largest models that can run on each GPU, I suggest adding a VRAM column next to the GPU name on the main scoreboard. Example:
|
Beta Was this translation helpful? Give feedback.
-
Device 0: NVIDIA GeForce RTX 2060 SUPER, compute capability 7.5, VMM: yes
build: 5c0eb5e (6075) |
Beta Was this translation helpful? Give feedback.
-
@olegshulyakov I see you grabbed some of my numbers from the Vulkan thread. However, I flooded that post with a bunch of data that probably came across as noise. While you quoted my correct numbers for Non-FA, the FA results you grabbed were actually when run on two GPUs instead of one. To make things easier, here are the numbers from a single card: RTX 5060 Ti 16 GB
And here's another GPU for the collection: RTX 4060 Ti 8 GB
|
Beta Was this translation helpful? Give feedback.
-
Device 0: NVIDIA GeForce RTX 2080 Ti, compute capability 7.5, VMM: yes
build: 9c35706 (6060) |
Beta Was this translation helpful? Give feedback.
-
Yeah also saw numbers for my 4090 taken from the Vulkan thread. Re-ran CUDA results so you can get the latest FA and non-FA results from same build: FA:
Non-FA:
nvidia-dkms 575.64.03-1 ❯ nvcc --version
|
Beta Was this translation helpful? Give feedback.
-
NVIDIA P106-100 I ran two times, took the best on 2 different build
build: 5fd160b (6106)
build: 860a9e4 (5688) Sadly, nvidia was not supporting this device for the vulkan driver |
Beta Was this translation helpful? Give feedback.
-
Would like to participate with a slightly exotic one from my cute server cube.. :-) (RTX 2000 Ada, 16GB, 75W) I did two runs:
gml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: 756cfea (6105)
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: 1d72c84 (6109) Seems to make no big difference... ^^ |
Beta Was this translation helpful? Give feedback.
-
I finally got my hands on similar card as before (NP106) but with display output NVIDIA GTX 1060
build: 5fd160b (6106) |
Beta Was this translation helpful? Give feedback.
-
A100 80GB PCIe ./build/bin/llama-bench -m llama-2-7b.Q4_0.gguf -fa 0,1 -p 512,1024,2048,4096,8192,16384,32768 -n 128,256,512,1024,2048,4096
build: 5143fa8 (6392) |
Beta Was this translation helpful? Give feedback.
-
A100 80GB SXM4 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: 5143fa8 (6392) |
Beta Was this translation helpful? Give feedback.
-
H100 80GB PCIe ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: 5143fa8 (6392) |
Beta Was this translation helpful? Give feedback.
-
H100 80GB SXM5 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: 5143fa8 (6392) |
Beta Was this translation helpful? Give feedback.
-
After seeing @Hedede's numbers with the H100, I had to try the RTX 6000 Pro Blackwell on the latest llama.cpp version to compare. Just barely manages to edge it out. :) With fa:
Without fa:
|
Beta Was this translation helpful? Give feedback.
-
Decided to introduce some variation. Tested a few devices on Meta's llama3.1 8B Q4. Timings are very close to those of llama2 7B Q4 (which is tested here). But here is a new device: p102-100 a mining version of gtx 1080 ti, a bit trimmed in number of processing devices. For each device test was performed with 512, 2048 and 4096 prompt tokens. Generation was always just 128, the numbers always was similar. Flash attention variant is marked with 'fa' before the pp**** (the prompt length). For p102 there are two versions: with full power consumption (250w) and with decreased (150w), so you can see the difference with 40% less power. So, here are the benchmarks:
|
Beta Was this translation helpful? Give feedback.
-
And to have an exactly comparable result i post here the benchmark with llama2 7B Q4:
|
Beta Was this translation helpful? Give feedback.
-
Quadro RTX 6000 (24GB / 384 bit) Driver Version: 570.86.10 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no Device 0: Quadro RTX 6000, compute capability 7.5, VMM: yes
build: b8e09f0 (6475) |
Beta Was this translation helpful? Give feedback.
-
NVIDIA RTX 3500 Ada Generation Laptop GPU (12 GB) GPU capped at 40W
EDIT: Added a benchmark with Power mode set to "Best performance"
|
Beta Was this translation helpful? Give feedback.
-
Tesla V100 (32GB / HBM2 / 4096 bit) Driver Version: 580.65.06 Tested with a few different models. Quite respectable for such an old chip. ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no Device 0: Tesla V100-SXM2-32GB, compute capability 7.0, VMM: yes
build: 51f5a45 (6533) ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: 51f5a45 (6533) |
Beta Was this translation helpful? Give feedback.
-
Titan Xp (12GB / GDDR5X / 384 bit) Driver Version: 570.172.08 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: c4510dc (6532) |
Beta Was this translation helpful? Give feedback.
-
RTX 6000 Ada Generation (48 GB / GDDR6/ 384 bit) Driver Version: 575.64.03 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: b8e09f0 (6475) |
Beta Was this translation helpful? Give feedback.
-
These llama models are not really that useful. What about the gpt-oss models? Has anyone been able to get those models running on H100s using llama.cpp? See: |
Beta Was this translation helpful? Give feedback.
-
5090 has 15% more TG performance in newer builds. Driver Version: 575.64.05 ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: 54dbc37 (6594) |
Beta Was this translation helpful? Give feedback.
-
Hardware: ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
build: a74a0d6 (6638) |
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 Performance of llama.cpp on Apple Silicon M-series, Performance of llama.cpp on AMD ROCm(HIP) and Performance of llama.cpp with Vulkan, but for CUDA! 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 CUDA 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 CUDA 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 I'll prioritize newer commits with substantial CUDA updates, otherwise I'll pick the one with the highest overall score at my discretion. 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!
CUDA Scoreboard for Llama 2 7B, Q4_0 (no FA)
CUDA Scoreboard for Llama 2 7B, Q4_0 (with FA)
More detailed test
The main idea of this test is to show a decrease in performance with increasing size.
Beta Was this translation helpful? Give feedback.
All reactions