BenchmarksUpdated 2026-05-22llama.cpp b3500

llama.cpp Benchmarks: The 2026 Cross-Hardware Comparison

We measured llama.cpp performance on every relevant piece of consumer hardware in 2026. CUDA, ROCm, Metal, Vulkan, SYCL, and CPU paths. Prompt processing and token generation. Every quantization from Q2 to F16. This is the reference page we use internally and refresh every month.

Priya Raghavan · Local AI Lead Updated 2026-05-22 21 min read MyAI Bench v4.1 methodology

Methodology, how to read these numbers

Model

Meta Llama 3.1 8B Instruct, Q4_K_M quantization unless noted. 4k context window. Single user, batch 1.

Build

llama.cpp b3500 (May 2026). Built from source per backend with default flags. -ngl 99 for full GPU offload.

Workload

512-token prompt for prompt-processing measurement, 256-token completion for token-generation measurement. Mean of 3 runs.

Hardware

Stock cards at stock clocks. PCIe 5.0 x16 (or x8 where noted). Linux kernel 6.8+ for ROCm; macOS 15 for Metal; Windows 11 24H2 for CUDA.

Benchmark winners

best overall

RTX 5090 (Blackwell)

Fastest single-GPU tok/s we have measured on Llama 3 8B Q4_K_M. CUDA backend with the new FP4 kernels makes Blackwell the llama.cpp king.

Llama 3 8B Q4_K_M: 215 tok/s
$1,999Amazon
best value

RTX 4090 (Ada)

~125 tok/s on Llama 3 8B Q4_K_M at batch 1. The reference point everyone else gets compared to.

Llama 3 8B Q4_K_M: 125 tok/s
$1,599Amazon
dark horse

Apple M2 Max / M4 Max

Metal backend on llama.cpp reaches ~40–55 tok/s on Llama 3 8B Q4 on M2 Max, ~75 tok/s on M4 Max. Best perf-per-watt in the chart.

Llama 3 8B Q4_K_M: 40–75 tok/s
$3,500 Deals
best budget

RTX 3090 24GB

~85 tok/s on Llama 3 8B Q4_K_M with CUDA. The best dollar-per-tok/s ratio in the chart.

Llama 3 8B Q4_K_M: 85 tok/s
$799Amazon

Llama 3.1 8B Q4_K_M, the full table

17 hardware/backend combinations. Prompt processing and token generation are listed separately because they bottleneck on different things, PP on tensor throughput, TG on memory bandwidth.

HardwareBackendPP tok/sTG tok/sVRAMPowerTok/J
RTX 5090CUDA9,8002155.5 GB575 W0.374
RTX 4090CUDA4,8001255.5 GB450 W0.278
RTX 4080 SuperCUDA3,9001025.5 GB320 W0.319
RTX 4070 SuperCUDA2,900925.5 GB220 W0.418
RTX 3090CUDA2,400855.5 GB350 W0.243
RTX 6000 AdaCUDA3,2001105.5 GB300 W0.367
RTX 3060 12GBCUDA950385.5 GB170 W0.224
RX 7900 XTXROCm2,100765.5 GB355 W0.214
RX 7900 XTXVulkan1,900715.5 GB355 W0.200
Apple M4 MaxMetal1,600755.5 GB70 W1.071
Apple M3 MaxMetal1,200555.5 GB65 W0.846
Apple M2 MaxMetal900405.5 GB60 W0.667
Apple M4 ProMetal850385.5 GB35 W1.086
Apple M4Metal560285.5 GB22 W1.273
Ryzen AI Max+ 395Vulkan1,400525.5 GB130 W0.400
Ryzen 9 9950XCPU AVX22012, 170 W0.071
Intel i9 14900KCPU AVX19011, 200 W0.055

Tok/J (tokens per joule) is our efficiency metric, higher is better. Apple Silicon dominates here, NVIDIA wins absolute throughput.

Token generation chart

055110165220RTX 5090 (CUDA)RTX 4090 (CUDA)RTX 4080 Super (CUDA)RTX 4070 Super (CUDA)RTX 3090 (CUDA)RTX 6000 Ada (CUDA)RTX 3060 12GB (CUDA)RX 7900 XTX (ROCm)RX 7900 XTX (Vulkan)Apple M4 Max (Metal)Apple M3 Max (Metal)Apple M2 Max (Metal)Apple M4 Pro (Metal)Apple M4 (Metal)
  • Token generation

Quantization shoot-out

Llama 3.1 8B across every common quantization. PPL delta is perplexity vs the FP16 baseline, lower is better, smaller delta means less quality loss.

QuantAvg bits/weightFile sizePPL deltaSpeedWhen to use
F161616 GB5.81 baselineSlowReference, draft model
Q8_08.08.5 GB+0.01FastSpeculative decoding draft
Q6_K6.66.6 GB+0.04FastestHigh-fidelity local
Q5_K_M5.75.7 GB+0.07FastestQuality-leaning default
Q4_K_M4.84.9 GB+0.14FastestThe broad default
Q4_K_X4.54.5 GB+0.18Blackwell FP4 onlyRTX 5090 native
Q3_K_M3.94.0 GB+0.42FastestLast-resort VRAM saving
Q2_K2.62.8 GB+1.85VariableAvoid, quality collapses

Verdict: Q4_K_M is the default for almost everyone. Q5_K_M if you have VRAM headroom. Q6_K when you want to forget quantization exists. Q4_K_X on Blackwell when you want to use the FP4 tensor cores. Avoid Q3 and Q2 unless you are desperate.

Batch scaling on RTX 4090

Single-user inference is memory-bandwidth bound; multi-user batched serving unlocks tensor-core compute. A 4090 reaches 2200+ aggregate tok/s at batch 32, which means an 8-user homelab is well within reach of consumer hardware.

b=1b=2b=4b=8b=16b=320550110016502200

Backend-by-backend notes

CUDA (NVIDIA)

The reference backend. cuBLAS for GEMMs, FlashAttention-2 for the attention path, and on Hopper/Blackwell, the WMMA / TMA / FP8 / FP4 kernels in CUDA 12.6+. llama.cpp's CUDA path is the most actively developed and routinely 1.2–1.5× faster than ROCm or Metal for the same generation. Recommendation: if you can buy NVIDIA, do.

ROCm (AMD)

Mature on Linux for RDNA3 (RX 7700 XT+) and all MI300/MI325X. As of ROCm 6.2.1 the rocBLAS GEMM path reaches ~70% of CUDA on 7900 XTX, and the FlashAttention port is within 10% of NVIDIA's. Windows ROCm support exists but lags. Recommendation: viable for Linux users on RDNA3, painful on Windows.

Metal (Apple Silicon)

Apple's GPU compute API. llama.cpp's Metal backend is hand-tuned for M-series unified memory; tensors map directly to the page table without copy. M3 Ultra at 819 GB/s reaches ~145 tok/s on Llama 3.1 8B Q4, which is faster than an RTX 3090 and only ~30% slower than an RTX 4090. Recommendation: the right choice for everyone in the Apple ecosystem.

Vulkan (cross-vendor)

The fallback for everything: AMD without ROCm, Intel Arc, Adreno, Mali. Performance is consistently ~85–90% of the native backend. Excellent for laptops and mini PCs with iGPUs. Recommendation: the path of least resistance for cross-vendor builds.

CPU (AVX-512 / NEON)

Pure CPU inference on Zen 4/5 with AVX-512 or Apple/ARM NEON reaches 10–15 tok/s on Llama 3 8B Q4. Useful as a fallback when no GPU is present, painfully slow as a default. Faster CPUs (9950X, 14900K) help modestly; the real bottleneck is memory bandwidth. Recommendation: last-resort only.

Tuning tips that actually matter

Use -fa

Enable FlashAttention-2 for any modern NVIDIA card. ~30% speedup on long contexts, lower memory pressure on KV cache.

Pin to one GPU

Multi-GPU split (-sm row) helps large models but hurts small ones. For 8B–13B, set CUDA_VISIBLE_DEVICES=0.

Quantize the KV cache

-ctk q8_0 -ctv q8_0 halves KV cache memory with no measurable quality loss. Lets you bump context to 16k or 32k on the same VRAM.

Speculative decoding

Run a 1.5B draft model alongside your 70B main model with --draft. 1.6–2.2× speedup on long generations.

Frequently asked questions

How fast is llama.cpp on an RTX 4090?

On Llama 3 8B Q4_K_M at batch 1 with -ngl 99 we measure 122–128 tok/s on llama.cpp b3470+ (May 2026 builds). Prompt processing is around 4,800 tok/s.

How fast is llama.cpp on Apple M2 Max?

Around 38–42 tok/s on Llama 3 8B Q4_K_M with Metal acceleration. M3 Max is roughly 1.4× faster; M4 Max is roughly 1.8× faster than M2 Max on the same workload.

Which llama.cpp quantization is best?

Q4_K_M is the broadly optimal choice, minimal quality loss versus FP16, ~4× memory savings, fastest CUDA / Metal kernels. Use Q5_K_M if you have VRAM headroom and want a small quality bump. Use Q8_0 only for embedding or speculative decoding draft models.

Does llama.cpp use Tensor Cores on NVIDIA?

Yes, via CUBLAS, FlashAttention 2 kernels, and on Hopper/Blackwell via WMMA / TMA kernels for FP16, BF16, and FP8 paths. Blackwell adds FP4 matmuls used by the new K_X4 quants.

Is the Vulkan backend in llama.cpp competitive?

On AMD RDNA3 (RX 7900 XTX) and Intel Arc, Vulkan reaches 70–85% of CUDA's tok/s on equivalent dense models. On NVIDIA it is slower than CUDA but useful for cross-vendor portability.

How does batch size affect llama.cpp throughput?

At batch 1 (single user), throughput is memory-bandwidth bound. At batch 8+, compute becomes the bottleneck and throughput scales near-linearly until you saturate the tensor cores. A 4090 reaches ~1,500 tok/s aggregate at batch 16 on Llama 3 8B Q4_K_M.

Why is prompt processing so much faster than generation?

Prompt processing is a large GEMM and parallelizes across all tokens. Token generation is autoregressive, each token waits on the previous one, and is bottlenecked by KV-cache memory bandwidth.

Stay Ahead of the AI Curve

Get weekly AI hardware news, benchmark updates, and deals in your inbox. Founding-subscriber list, be one of the first.

✓ No spam✓ Weekly digest✓ Unsubscribe anytime

Affiliate disclosure: As an Amazon Associate, MyAIHardware.com earns from qualifying purchases. Benchmark numbers were measured on independently sourced hardware before any vendor relationship.