Dual GPU Llama.cpp speedup
Apply the llama.cpp_qts fork and add '-sm tensor' to your command line to get ~40% speed boost on dual GPUs.
Clone the llama.cpp_qts fork, build it, and run your Llama.cpp server with '-sm tensor' to achieve faster inference on dual GPUs.
Summary
The author identifies an issue with Llama.cpp's --split-mode tensor, which only supports non‑quantized KV caches, limiting users to a healthy sized KV cache and ignoring tensor parallelism. To address this, a fork (llama.cpp_qts) was created, adding support for tensor split mode with quantized KV caches. The fork was tested on a dual GPU setup (3060 12GB + 4070 Super 12GB) and achieved a ~40 % speed increase without quality loss. Benchmarks show Qwen3.5 27B Q4_K Medium tokens/s of 544.82 ± 6.01 with tensor split versus 582.60 ± 28.57 without tensor, and 30.05 ± 0.38 vs 21.22 ± 0.52 for different batch modes. The fork also supports the latest MTP changes (--spec-type draft‑mtp, --spec-draft-p-min 0.75, --spec-draft-n-max 2). The author notes that MoE models are not supported with -sm tensor and recommends testing against dense models. The branch is from mainline as of today and includes minimal changes; MoE models not supported with -sm tensor. The author encourages users to build the fork and add "-sm tensor" to their command line to achieve faster inference on dual GPUs.
Key changes
- Fork adds support for --split-mode tensor with quantized KV caches
- Fixes issue where tensor mode only supported non‑quantized KV caches
- Provides ~40 % speed increase on dual GPUs without quality loss
- Supports latest MTP changes (--spec-type draft‑mtp, --spec-draft-p-min 0.75, --spec-draft-n-max 2)
- Tested on 3060 12GB + 4070 Super 12GB
- Benchmarks: Qwen3.5 27B Q4_K Medium tokens/s 544.82 ± 6.01 with tensor, 582.60 ± 28.57 without
- Tokens/s 30.05 ± 0.38 with tensor split vs 21.22 ± 0.52 without
- Branch from mainline as of today with minimal changes; MoE models not supported with -sm tensor