llama.cpp with MTP: splitting the model across two A100s did not speed up a single request
On the same Qwen3.8-27B and A100 PCIe setup, llama.cpp opened four slots by default. At 32 concurrent requests its MTP setup delivered 164 tok/s against about 1,568 on vLLM, using different MTP recipes. With MTP on two cards, splitting the model gave a single request 108.5 tok/s; a separate server on each card gave 110.0.

In episode 1 and episode 2, splitting a model across two A100 PCIe cards sped up a single request on vLLM and SGLang. Running a copy on each card worked better for many concurrent requests. We tried the same model, cards, and 96 prompts on llama.cpp. With MTP enabled, the two-card split lost its single-request advantage: one server per card gave 110.0 decode tokens per second, a tensor split gave 108.5, and the default layer split gave 105.7. Three runs of each setup kept that order.
The queue on one card was more striking. llama.cpp opened four request slots by default. With 32 concurrent requests, four ran while 28 waited. Its MTP setup delivered 164 tokens per second in total, compared with about 1,568 on vLLM; TTFT p95 was 170 seconds against 0.88 seconds. Those MTP setups differ: llama.cpp guessed up to seven tokens per step and vLLM guessed one. For a single request, llama.cpp was 34% slower with DFlash2 but 6.8% faster on decode with MTP.
The measurements below show what happened to per-request speed and queueing, then break down the two-card step time. Reproduction commands follow the results.
What changed from episode 1
We built llama-server from llama.cpp commit d35dc4d with CUDA and NCCL. The hardware was unchanged: two A100 80GB PCIe cards without NVLink. We reused the 96 prompts from episode 1, with 24 each for coding, agents, general questions, and math; 40 were in Korean. Answers were capped at 1,024 tokens, and each run started a fresh server. Single-request speed is the mean decode speed across the 96 answers. For concurrent requests, we report total tokens divided by wall time and the 95th percentile time to first token (TTFT).
llama.cpp needs GGUF, so we converted the same Qwen3.8-27B revision to bf16 GGUF and quantized it to Q4_K_M with llama.cpp's default command, without an importance matrix. The resulting file is 17.0 GB, or 4.98 bits per weight. It differs from the INT4 checkpoint used on vLLM. We therefore checked both files against the same accuracy questions; those results appear below.
The labels follow episode 1, with L for llama.cpp:
- L1: the bf16 file, llama.cpp defaults.
- L2: the Q4_K_M file, llama.cpp defaults.
- L3-1: Q4_K_M plus DFlash2, a small draft model that guesses up to 7 tokens per step for the big model to check. This is the command in llama.cpp's speculative decoding docs, and the same draft model and guess count as vLLM's R3-1.
- L3-32: the same command with the guesser swapped for the model's built-in predictor (MTP), still up to 7 tokens per step.
- LD1, LD2-layer, LD2-tensor: two cards. LD1 runs one L3-32 server per card. The two LD2 settings run one L3-32 server over both cards in two different ways, explained in the two-card section.
The model card and llama.cpp documentation do not specify separate commands for a single request and for many concurrent requests on this model. We chose L3-32 by replacing DFlash2 with MTP in the documented command. It guesses up to seven tokens per step; vLLM's R3-32 guesses one and SGLang's setup guesses three. Comparisons between these rows include those recipe differences.
We left two llama.cpp defaults in place. -fit put all 66 layers on the GPU, without an explicit -ngl. With -np on auto, the server opened four parallel slots and assigned 262,144 context tokens to each.
As a machine check, we reran vLLM R3-32 with 32 concurrent requests on the measurement days. It delivered 1,565.5 tokens per second, within episode 1's range of 1,562 to 1,574. The vLLM figures in the tables remain the episode 1 measurements.
One card, single request
| Setting | llama.cpp | vLLM (ep. 1) | SGLang (ep. 2) |
|---|---|---|---|
| bf16, defaults | 28.1 | 28.4 | 28.9 |
| 4-bit, defaults | 47.9 (Q4_K_M) | 71.9 (INT4) | 73.7 (INT4) |
| 4-bit + DFlash2 | 138.5 | 211.0 | 177.0 |
| 4-bit + MTP | 109.1 (7 guesses) | 102.2 (1 guess) | 124.7 (3 guesses) |
Decode tokens per second for a single request, temperature 0. The SGLang column is for reference; its recipes differ from both.

With bf16 and no speculative decoding, the engines were close: 28.1 tokens per second on llama.cpp and 28.4 on vLLM. The 1.2% gap persisted across three runs on each side (28.04 to 28.07 versus 28.39 to 28.41).
Quantizing the model widened the gap. Q4_K_M reached 47.9 tokens per second on llama.cpp, versus 71.9 for vLLM's INT4: 20.9 ms and 13.9 ms per token. We expected Q4_K_M to have the edge, since its file is smaller (17.0 GB against 19.5 GB for the INT4 checkpoint) and single-request decoding spends much of its time reading weights. The formats and kernels differ, so these numbers compare complete 4-bit setups.
DFlash2 brought llama.cpp to 138.5 tokens per second, 2.9 times its plain Q4_K_M speed but 34% below vLLM's 211.0. The big model accepted almost the same number of tokens per step on both engines, including its own token: 3.51 on llama.cpp and 3.53 on vLLM. llama.cpp reports this as mean len in the server log. The step itself took 28.3 ms on llama.cpp and 19.0 ms on vLLM.
The MTP result went the other way: 109.1 tokens per second for llama.cpp L3-32 and 102.2 for vLLM R3-32, a 6.8% lead (one llama.cpp run against three vLLM runs). llama.cpp guessed up to seven tokens per step and kept 3.36; vLLM guessed one and kept 1.81. Its longer step, 33.7 ms versus 17.8 ms, was offset by more accepted tokens. SGLang's three-guess setup also beat vLLM's one-guess setup for a single request in episode 2.
That MTP lead applies to decode speed after the first token. llama.cpp's median TTFT was 0.55 seconds, compared with 0.13 seconds on vLLM. Measured from request to final token, vLLM led at 99.8 versus 93.4 tokens per second.
At temperature 0.7 with a fixed seed, L3-1 dropped to 127.5 tokens per second, 8% below its 138.5 at temperature 0. vLLM's R3-1 dropped 11% in episode 1, from 211.0 to 186.8. Both are single runs.
One card, 32 concurrent requests: four at a time
| Setting | 32 concurrent requests, llama.cpp | 32 concurrent requests, vLLM (ep. 1) | vLLM / llama.cpp |
|---|---|---|---|
| bf16, defaults | 86.4 (p95 309 s) | 587.3 (p95 0.92 s) | 6.8× |
| 4-bit, defaults | 151.8 (p95 174 s) | 1,085.8 (p95 1.06 s) | 7.2× |
| 4-bit + DFlash2 | 177.5 (p95 161 s) | 877.1 (p95 1.16 s) | 4.9× |
| 4-bit + MTP | 164.2 (p95 170 s) | about 1,568 (p95 0.87 to 0.89 s) | 9.5× |
Total tokens per second at temperature 0. The MTP row on llama.cpp is the mean of three runs (163.7 to 164.6); the others are single runs.
The startup log reported four slots on every llama.cpp server we started, whether it used one card or two. With 32 concurrent requests, four decoded while 28 waited for a slot. Since answers could run to 1,024 tokens, that wait was substantial: TTFT p95 ranged from 161 to 309 seconds across the settings above. vLLM ran all 32 requests concurrently.
Queue length was only part of the throughput gap. Under MTP, each of llama.cpp's four active requests decoded at 46.8 tokens per second on average; each of vLLM's 32 active requests averaged 57.9.

At 64 concurrent requests, llama.cpp's MTP throughput stayed near its 32-request result: 161.2 tokens per second in one run, while TTFT p95 rose to 353 seconds. vLLM R3-32 reached 1,856 tokens per second at 64 concurrent requests, 11.5 times as much. At temperature 0.7 and 32 concurrent requests, the two MTP setups delivered 153.4 and 1,382.4 tokens per second respectively, each from one run.
Two cards with MTP
The -sm option controls how llama.cpp places one model across two cards.
- Layer split (
-sm layer, the default). Each card holds about half of the layers. A token passes through the first card's layers, then the second card's, so for one request the two cards take turns. This is what you get by starting the server on two cards with no extra options. - Tensor split (
-sm tensor). Each card holds half of every layer, and the two exchange partial results at every step. This is what vLLM did for its split in episode 1. llama.cpp marks it as experimental; it needs-fa on, an f16 or bf16 KV cache and an explicit--ctx-size. We set the context to 262,144, the size the layer split chose by itself, so both splits ran with 4 slots of the same length.
LD1 runs one L3-32 server on each card. Our client alternated requests between them, as in episodes 1 and 2; a shared service could route requests through a proxy.
| Concurrent requests | LD1 copy | LD2-layer | LD2-tensor | vLLM copy (ep. 1) | vLLM split (ep. 1) |
|---|---|---|---|---|---|
| 1 | 110.0 | 105.7 | 108.5 | 102.9 | 138.4 |
| 32 | 326.5, p95 77 s | 156.0, p95 180 s | 124.9, p95 223 s | 1,991, p95 0.50 to 0.54 s | 1,900, p95 0.63 s |
| 64 | 325.7, p95 165 s | 156.4, p95 365 s | 126.2, p95 452 s | 2,708, p95 0.87 to 0.88 s | 2,309, p95 1.19 to 1.20 s |
Tokens per second, mean of three runs each, temperature 0. The single-request row is decode speed; the 32 and 64 rows are totals.

With 32 concurrent requests, two copies delivered 326.5 tokens per second, about twice the 164.2 from one card. TTFT p95 fell from 170 to 77 seconds. Each server had four slots, allowing eight active requests across the two cards. Both splits still had only four slots in one server; they delivered 156.0 tokens per second with layer splitting and 124.9 with tensor splitting, below the one-card result. Every copy run beat every split run at both 32 and 64 concurrent requests.
With LD1, a single request lands on one card. Its 110.0 tokens per second is close to one-card L3-32 at 109.1. Tensor splitting reached 108.5, or 1.3% less than LD1; layer splitting reached 105.7, or 3.9% less. These are small gaps, but three runs per setup stayed within 0.1% and kept the same order. In the earlier episodes, splitting was 35% faster than copies on vLLM (138.4 versus 102.9) and 39% faster on SGLang.
What happened to the step time
Splitting sped up a single request on vLLM because each generation step shortened from 17.8 ms to 13.2 ms. In a step, the large model reads its weights and produces tokens. With tensor splitting, each card reads half the weights. For llama.cpp, we divided the server log's total generation time by the step count derived from each request's mean len.
We measured plain Q4_K_M first. Without speculative decoding, a step produces one token.
| Setup, single request | Step time | Change | Decode speed |
|---|---|---|---|
| Q4_K_M, one card | 20.86 ms | 47.9 | |
| Q4_K_M, layer split | 20.27 ms | 2.8% shorter | 49.3 |
| Q4_K_M, tensor split | 15.51 ms | 26% shorter | 64.5 |
| MTP, one card (L3-32) | 33.67 ms | 109.1 | |
| MTP, layer split | 34.75 ms | 3.2% longer | 105.7 |
| MTP, tensor split | 33.18 ms | 1.4% shorter | 108.5 |
The MTP split rows are means of three runs; the others are single runs.
On plain Q4_K_M, tensor splitting cut the step by 26%, from 20.86 to 15.51 ms. Single-request speed rose 34%, from 47.9 to 64.5 tokens per second. vLLM's plain INT4 step shortened by 28% (13.9 to 9.9 ms) and its single-request speed rose 40% in episode 1. Layer splitting barely changed the llama.cpp step, consistent with the cards taking turns.
With MTP enabled, tensor splitting shortened llama.cpp's step by just 1.4%, compared with 26% for vLLM's MTP step (17.8 to 13.2 ms). The large model also accepted slightly fewer tokens per step, 3.30 instead of 3.36. Single-request decode speed consequently stayed flat.
We ran one additional single-request measurement per setup with -lv 4, which records draft generation time. Detailed logging changed speed by less than 1%: with logging against without, 109.1 against 109.1 tokens per second on one card and 109.1 against 108.5 with the tensor split.
| Single request, MTP | Step | Making the draft | The rest, including the check |
|---|---|---|---|
| One card | 33.64 ms | 9.83 ms | 23.82 ms |
| Tensor split | 33.06 ms | 10.24 ms | 22.82 ms |

Draft generation took about 30% of each MTP step and grew slightly with two cards, from 9.83 to 10.24 ms. The remaining work, including verification by the large model, shortened by 1.0 ms. The same tensor split saved 5.35 ms on a plain one-token step. Together, those timings account for the small overall gain in step time under MTP.
Does it still answer the same?
For accuracy, we used the same questions as episode 1: all 1,319 GSM8K test problems, 1,400 MMLU-Pro questions, and 1,125 KMMLU questions. Thinking was off and the answer limit was 4,096 tokens.
| Setting | GSM8K | MMLU-Pro | KMMLU |
|---|---|---|---|
| L2 Q4_K_M, llama.cpp | 96.8% (95.9 to 97.8) | 77.6% (75.4 to 79.8) | 72.4% (69.7 to 75.0) |
| L3-1, llama.cpp | 96.7% (95.8 to 97.7) | 77.4% (75.2 to 79.5) | 72.1% (69.5 to 74.7) |
| L3-32, llama.cpp | 96.6% (95.6 to 97.6) | 78.1% (75.9 to 80.2) | 72.4% (69.8 to 75.1) |
| R2 INT4, vLLM (ep. 1) | 96.8% (95.9 to 97.8) | 77.1% (74.9 to 79.3) | 73.0% (70.4 to 75.6) |
Parentheses show 95% intervals. They overlap for every pair on every benchmark. This sample did not resolve a score difference between Q4_K_M and vLLM's INT4 or between plain Q4_K_M and the speculative setups. We use KMMLU to compare settings, not to rate the model's Korean ability.
We also compared exact answer text at temperature 0. In two 32-request runs of the same L2 server, only 8 of 96 answers matched. Comparisons between speculative and plain setups matched on 12 and 7 prompts; split versus one card matched on 7. Those counts are similar to the same-setup baseline. In single-request runs, repeating the tensor-split setup produced 96 identical answers out of 96. Speculative versus plain matched on only 9, and split versus one card on 13. Under single-request load, both choices changed the text.
Running it yourself
Build llama.cpp at d35dc4d or later with CUDA and NCCL. On our machine the system NCCL 2.14 did not compile, so we pointed the build at NCCL 2.32.6 from the nvidia-nccl-cu12 pip package; we also set the CUDA architecture to 80, because the default list built only a PTX target on our toolchain.
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp && git checkout d35dc4d
N=$(python -c "import nvidia; print(list(nvidia.__path__)[0] + '/nccl')")
cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=80 \
-DGGML_CUDA_NCCL=ON -DNCCL_INCLUDE_DIR=$N/include -DNCCL_LIBRARY=$N/lib/libnccl.so
cmake --build build -j --target llama-server llama-quantized35dc4d includes a fix for a crash in the MTP setup with several requests at once (issue #31656). On an earlier build the server stopped with failed to remove sequence partway through 32-request runs; single-request runs were not affected.
Convert the model and the draft model from the same revisions as episode 1, then quantize. The MTP head goes into the converted file with the default command.
hf download Qwen/Qwen3.8-27B --revision 1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0 --local-dir Qwen3.8-27B
hf download z-lab/Qwen3.8-27B-DFlash2 --revision 50307d4c4cde6860d4eee73e2547cd786fe8e8a4 --local-dir Qwen3.8-27B-DFlash2
python convert_hf_to_gguf.py ./Qwen3.8-27B --outtype bf16 --outfile bf16.gguf
./build/bin/llama-quantize bf16.gguf q4km.gguf Q4_K_M
python convert_hf_to_gguf.py ./Qwen3.8-27B-DFlash2 --target-model-dir ./Qwen3.8-27B --outtype bf16 --outfile dflash2.ggufThen start one server per setting.
S=./build/bin/llama-server
COMMON="--host 127.0.0.1 --port 8000 --alias m"
# L1: bf16, defaults
CUDA_VISIBLE_DEVICES=0 $S -m bf16.gguf $COMMON
# L2: Q4_K_M, defaults
CUDA_VISIBLE_DEVICES=0 $S -m q4km.gguf $COMMON
# L3-1: DFlash2, up to 7 guessed tokens per step
CUDA_VISIBLE_DEVICES=0 $S -m q4km.gguf -md dflash2.gguf --spec-type draft-dflash2 --spec-draft-n-max 7 -fa on --jinja $COMMON
# L3-32: built-in MTP, up to 7 guessed tokens per step
CUDA_VISIBLE_DEVICES=0 $S -m q4km.gguf --spec-type draft-mtp --spec-draft-n-max 7 -fa on --jinja $COMMONMTP="-m q4km.gguf --spec-type draft-mtp --spec-draft-n-max 7 -fa on --jinja --host 127.0.0.1 --alias m"
# LD1 copy: one server per card, on different ports
CUDA_VISIBLE_DEVICES=0 $S $MTP --port 8000 &
CUDA_VISIBLE_DEVICES=1 $S $MTP --port 8001 &
# LD2-layer: one server over both cards (layer split is the default)
CUDA_VISIBLE_DEVICES=0,1 $S $MTP --port 8000
# LD2-tensor: one server over both cards, experimental tensor split
CUDA_VISIBLE_DEVICES=0,1 $S $MTP --port 8000 -sm tensor --ctx-size 262144The server speaks the OpenAI format at /v1/chat/completions, so the request from episode 1 works with the model name m. The startup log prints the number of slots and the context per slot; with -lv 4, it also prints the draft timings we used above.
Choosing a setup
On one card, DFlash2 (L3-1) was llama.cpp's fastest single-request setting at 138.5 tokens per second, 2.9 times plain Q4_K_M. For shared use, check the startup log's slot count. Ours was four, leaving 28 of 32 requests waiting. -np changes that count; measure throughput and waiting time with your own prompts after changing it. Under our 32-request load, vLLM delivered 4.9 to 9.5 times llama.cpp's throughput across the four settings.
When the model fits on either of two PCIe cards, one server per card gave the highest throughput for many concurrent requests, about twice the one-card total. For a single request with MTP, neither split mode improved decode speed. With speculative decoding off, the experimental tensor split (-sm tensor) raised single-request speed by 34%.
The next episode will be sent through the newsletter below.
