llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

[WIP] Gemma 4 MTP

Open am17an opened this issue 6 months ago • 36 comments

Overview

This PR adds MTP support for Gemma 4 models. For the MoE model I don't observe a speed-up on my system, but the dense model has on average >2x speedup. Correctness wise I am able to replicate the AIME-26 (~87%) results as advertised by the Gemma team. This works for the 31B and 26B-4B but not the E4B E2B variants for now.

[!Note] Multi-GPU works but you may need to specify --spec-draft-device with -sm layer

Additional information

Performance on mtp-bench on a DGX Spark :thread:

No MTP

  code_python        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.1
  code_cpp           pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.2
  explain_concept    pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.0
  summarize          pred= 192 draft=   0 acc=   0 rate=n/a tok/s=5.9
  qa_factual         pred= 192 draft=   0 acc=   0 rate=n/a tok/s=5.9
  translation        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.2
  creative_short     pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.2
  stepwise_math      pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.0
  long_code_review   pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.0

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 0,
  "total_draft_accepted": 0,
  "aggregate_accept_rate": null,
  "wall_s_total": 290.01
}

--spec-draft-n-max 4

  code_python        pred= 192 draft= 231 acc= 133 rate=0.576 tok/s=14.9
  code_cpp           pred= 192 draft= 197 acc= 141 rate=0.716 tok/s=18.0
  explain_concept    pred= 192 draft= 268 acc= 123 rate=0.459 tok/s=12.9
  summarize          pred= 192 draft= 208 acc= 138 rate=0.663 tok/s=16.2
  qa_factual         pred= 192 draft= 211 acc= 138 rate=0.654 tok/s=16.4
  translation        pred= 192 draft= 235 acc= 131 rate=0.557 tok/s=14.6
  creative_short     pred= 192 draft= 292 acc= 117 rate=0.401 tok/s=11.4
  stepwise_math      pred= 192 draft= 180 acc= 146 rate=0.811 tok/s=19.3
  long_code_review   pred= 192 draft= 222 acc= 135 rate=0.608 tok/s=14.9

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 2044,
  "total_draft_accepted": 1202,
  "aggregate_accept_rate": 0.5881,
  "wall_s_total": 120.65
}

How to use

If you have lots of VRAM

llama-server -hf am17an/Gemma4-31B-it-GGUF --spec-type draft-mtp --spec-draft-n-max 4

  • https://huggingface.co/am17an/Gemma4-31B-it-GGUF

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, for mainly adding code to share the kv-cache and testing against the transformers implementation.

am17an avatar May 20 '26 08:05 am17an

Thank you. Results tests in dual 3080 (20gb) seems a decrease in perfomance. Logs follow up:

Setup with Gemma4-31B-Q8_0 (same on your hf repo). Full logs: https://pastebin.com/DRjGrZ9R Without MTP:

  • ~19.3 t/s

With MTP enabled same performance in draft 1,2,3,4 (--spec-type draft-mtp --spec-draft-n-max 2):

  • ~9.3 t/s

The logs show 0 draft acceptance:

draft acceptance = 0.00000 (0 accepted / 1090 generated)
#gen tokens = 1090, #acc tokens = 0

So speculative decoding appears to be active, but all draft tokens are rejected, resulting in a significant performance decrease instead of acceleration.

Commands used:

./build-cuda/bin/llama-server -m Gemma4-31B-Q8_0.gguf -c 32768 -fa on -ngl 999 -ctk q8_0 -ctv q8_0 --no-warmup
./build-cuda/bin/llama-server -m Gemma4-31B-Q8_0.gguf --model-draft mtp-gemma-4-31B-it.gguf -c 32768 -fa on -ngl 999 -ctk q8_0 -ctv q8_0 --spec-type draft-mtp --spec-draft-n-max 2 --no-warmup

fabriciomalta avatar May 20 '26 14:05 fabriciomalta

I did a few quick tests with my system. MTP was actually slightly slower for me. I assume it's because of my hardware setup.

52 token prompt to have it code an html animation for me.

Hardware:

0.00.237.123 I device_info:
0.00.303.668 I   - CUDA0   : NVIDIA GeForce RTX 5090 (32108 MiB, 29101 MiB free)
0.00.380.610 I   - CUDA1   : NVIDIA GeForce RTX 4090 (24082 MiB, 23671 MiB free)

Without MTP:

1.51.859.646 I slot print_timing: id  3 | task 0 | prompt eval time =      68.32 ms /    52 tokens (    1.31 ms per token,   761.16 tokens per second)
1.51.859.648 I slot print_timing: id  3 | task 0 |        eval time =   96783.23 ms /  3114 tokens (   31.08 ms per token,    32.17 tokens per second)
1.51.859.649 I slot print_timing: id  3 | task 0 |       total time =   96851.55 ms /  3166 tokens
1.51.859.653 I slot print_timing: id  3 | task 0 |    graphs reused =       3101
1.51.859.672 I slot      release: id  3 | task 0 | stop processing: n_tokens = 3165, truncated = 0

With MTP:

2.26.014.320 I slot print_timing: id  3 | task 0 | prompt eval time =     111.03 ms /    52 tokens (    2.14 ms per token,   468.34 tokens per second)
2.26.014.322 I slot print_timing: id  3 | task 0 |        eval time =  114817.54 ms /  3308 tokens (   34.71 ms per token,    28.81 tokens per second)
2.26.014.323 I slot print_timing: id  3 | task 0 |       total time =  114928.57 ms /  3360 tokens
2.26.014.326 I slot print_timing: id  3 | task 0 |    graphs reused =       1015
2.26.014.327 I slot print_timing: id  3 | task 0 | draft acceptance = 0.55447 ( 2280 accepted /  4112 generated)

BootsSiR avatar May 20 '26 14:05 BootsSiR

Multi GPU is currently broken, I will push a fix in a bit.

am17an avatar May 20 '26 14:05 am17an

Multi GPU is currently broken, I will push a fix in a bit.

That explains it. I'll rerun my test when you push a fix.

BootsSiR avatar May 20 '26 15:05 BootsSiR

Thank you for your work! Here is my test result, I have to use Qwen3.6-35B-A3B to translate.

Compared to the other two commenters, my test results were quite surprising.


Environment:

  • Hardware: 2x NVIDIA GeForce RTX 3090 (Tensor Parallel)
  • Model: gemma-4-31B-it-Q8_0.gguf (Q8_0 Quantization)
  • Input: 32,767 tokens (Random noise)

1. Baseline Test (No Speculative Decoding)

Launch Command:

llama-server -m /mnt/disk_2t/Models/gemma-4-31B-it-Q8_0/gemma-4-31B-it-Q8_0.gguf --ctx-size 65536 --flash-attn on --no-mmap --cache-ram 32768 --fit on --temp 1 --samplers top_k;top_p;temperature --top-p 0.95 --top-k 64 --ctx-checkpoints 1 --split-mode tensor --batch-size 2048 --ubatch-size 512 --parallel 1 --threads -1 --seed -1 -dio

Log Output:

1.03.338.149 I slot print_timing: id  0 | task 1 | prompt eval time =   27857.24 ms / 32767 tokens (    0.85 ms per token,  1176.25 tokens per second)
1.03.338.152 I slot print_timing: id  0 | task 1 |        eval time =    7167.21 ms /   256 tokens (   28.00 ms per token,    35.72 tokens per second)

Metrics:

  • Prompt Eval: 1,176.25 tok/s
  • Decode (256 tokens): 35.72 tok/s

2. Draft-MTP Test (With Speculative Decoding)

Draft Model: /home/mark/MTP/mtp-gemma-4-31B-it.gguf

Launch Command:

llama-server -m /mnt/disk_2t/Models/gemma-4-31B-it-Q8_0/gemma-4-31B-it-Q8_0.gguf --ctx-size 65536 --spec-type draft-mtp --flash-attn on --spec-draft-n-max 4 --no-mmap --cache-ram 32768 --fit on --spec-draft-model /home/mark/MTP/mtp-gemma-4-31B-it.gguf --temp 1 --samplers top_k;top_p;temperature --top-p 0.95 --top-k 64 --ctx-checkpoints 1 --split-mode tensor --batch-size 2048 --ubatch-size 512 --parallel 1 --threads -1 --seed -1 -dio

Log Output:

3.44.872.979 I slot print_timing: id  0 | task 554 | prompt eval time =   28147.80 ms / 32767 tokens (    0.86 ms per token,  1164.11 tokens per second)
3.44.872.982 I slot print_timing: id  0 | task 554 |        eval time =    4106.41 ms /   256 tokens (   16.04 ms per token,    62.34 tokens per second)
3.44.872.984 I slot print_timing: id  0 | task 554 | draft acceptance = 0.43902 (  162 accepted /   369 generated)
3.44.872.994 I statistics        draft-mtp: #calls(b,g,a) =    4    637    637, #gen drafts =    637, #acc drafts =   413, #gen tokens =   2545, #acc tokens =  1111, dur(b,g,a) = 0.006,  9834.855, 0.569 ms

Metrics:

  • Prompt Eval: 1,164.11 tok/s
  • Decode (256 tokens): 62.34 tok/s
  • Draft Acceptance Rate: 43.9% (162 accepted / 369 generated)

3. Comparison Summary

Metric Baseline (No MTP) With Draft-MTP Improvement
Prompt Throughput 1,176.25 tok/s 1,164.11 tok/s ~ -1% (Negligible)
Decode Throughput 35.72 tok/s 62.34 tok/s +74.5% Speedup
Decode Latency 28.00 ms/tok 16.04 ms/tok Significant Reduction

IIIIIllllIIIIIlllll avatar May 20 '26 15:05 IIIIIllllIIIIIlllll

@BootsSiR for me on 1x4090, 1x5090 on this test https://gist.github.com/am17an/228edfb84ed082aa88e3865d6fa27090

MTP: "wall_s_total": 18.23 no-MTP: "wall_s_total": 47.13

You may need to specify --spec-device-draft

am17an avatar May 20 '26 15:05 am17an

@fabriciomalta I think you maybe have some wrong file, 0% acceptance rate is highly unusual. I couldn't replicate it

am17an avatar May 20 '26 15:05 am17an

Thank you. Results tests in dual 3080 (20gb) seems a decrease in perfomance. Logs follow up:

Setup with Gemma4-31B-Q8_0 (same on your hf repo). Full logs: https://pastebin.com/DRjGrZ9R Without MTP:

* ~19.3 t/s

With MTP enabled same performance in draft 1,2,3,4 (--spec-type draft-mtp --spec-draft-n-max 2):

* ~9.3 t/s

The logs show 0 draft acceptance:

draft acceptance = 0.00000 (0 accepted / 1090 generated)
#gen tokens = 1090, #acc tokens = 0

So speculative decoding appears to be active, but all draft tokens are rejected, resulting in a significant performance decrease instead of acceleration.

Commands used:

./build-cuda/bin/llama-server -m Gemma4-31B-Q8_0.gguf -c 32768 -fa on -ngl 999 -ctk q8_0 -ctv q8_0 --no-warmup
./build-cuda/bin/llama-server -m Gemma4-31B-Q8_0.gguf --model-draft mtp-gemma-4-31B-it.gguf -c 32768 -fa on -ngl 999 -ctk q8_0 -ctv q8_0 --spec-type draft-mtp --spec-draft-n-max 2 --no-warmup

I have the same issue when i use Q8 Cache Quantization with Vulkan. If you turn it off, it works properly. @am17an

theDTV2 avatar May 20 '26 16:05 theDTV2

I can reproduce the 0% acceptance rate when the main model's KV cache is quantized to q8_0. With f16 KV cache, the acceptance rate seems normal. It seems quantizing the KV cache breaks it.

theo77186 avatar May 20 '26 16:05 theo77186

Thanks, that's a real bug then. I will fix

am17an avatar May 20 '26 16:05 am17an

@BootsSiR for me on 1x4090, 1x5090 on this test https://gist.github.com/am17an/228edfb84ed082aa88e3865d6fa27090

MTP: "wall_s_total": 18.23 no-MTP: "wall_s_total": 47.13

You may need to specify --spec-device-draft

Tested with the latest code and that python test.

Device Info

CUDA0   : NVIDIA GeForce RTX 5090 (32108 MiB, 28786 MiB free)
CUDA1   : NVIDIA GeForce RTX 4090 (24082 MiB, 23671 MiB free)

No MTP

llama-server -m ~/ai-models/mtp/Gemma4-31B-Q8_0.gguf -c 16384

  code_python        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=33.9
  code_cpp           pred= 192 draft=   0 acc=   0 rate=n/a tok/s=33.6
  explain_concept    pred= 192 draft=   0 acc=   0 rate=n/a tok/s=33.8
  summarize          pred= 192 draft=   0 acc=   0 rate=n/a tok/s=33.6
  qa_factual         pred= 192 draft=   0 acc=   0 rate=n/a tok/s=33.9
  translation        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=33.9
  creative_short     pred= 192 draft=   0 acc=   0 rate=n/a tok/s=33.9
  stepwise_math      pred= 192 draft=   0 acc=   0 rate=n/a tok/s=33.8
  long_code_review   pred= 192 draft=   0 acc=   0 rate=n/a tok/s=33.2

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 0,
  "total_draft_accepted": 0,
  "aggregate_accept_rate": null,
  "wall_s_total": 52.52
}

MTP Enabled

llama-server -m ~/ai-models/mtp/Gemma4-31B-Q8_0.gguf -md ~/ai-models/mtp/mtp-gemma-4-31B-it.gguf -c 16384 --spec-type draft-mtp --spec-draft-n-max 4 --device-draft CUDA1

  code_python        pred= 192 draft= 207 acc= 139 rate=0.671 tok/s=94.7
  code_cpp           pred= 192 draft= 212 acc= 138 rate=0.651 tok/s=94.4
  explain_concept    pred= 192 draft= 255 acc= 127 rate=0.498 tok/s=78.0
  summarize          pred= 192 draft= 188 acc= 143 rate=0.761 tok/s=104.0
  qa_factual         pred= 192 draft= 221 acc= 135 rate=0.611 tok/s=89.5
  translation        pred= 192 draft= 226 acc= 133 rate=0.589 tok/s=86.9
  creative_short     pred= 192 draft= 272 acc= 122 rate=0.449 tok/s=72.6
  stepwise_math      pred= 192 draft= 201 acc= 140 rate=0.697 tok/s=97.6
  long_code_review   pred= 192 draft= 225 acc= 134 rate=0.596 tok/s=85.6

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 2007,
  "total_draft_accepted": 1211,
  "aggregate_accept_rate": 0.6034,
  "wall_s_total": 21.05
}

👏

BootsSiR avatar May 20 '26 16:05 BootsSiR

@am17an Update: it is working now.

I deleted the dir and pull again. The issue was the quantized KV cache. With -ctk q8_0 -ctv q8_0, Draft-MTP initialized but had 0% acceptance. After rebuilding the latest PR code and removing Q8 KV cache, acceptance became normal.

Hardware:

  • 2x RTX 3080 20GB
  • Gemma4-31B-Q8_0
  • Draft model: mtp-gemma-4-31B-it.gguf

Working command:

./build-cuda/bin/llama-server -m Gemma4-31B-Q8_0.gguf -md mtp-gemma-4-31B-it.gguf -c 16384 --spec-type draft-mtp --spec-draft-n-max 4 --flash-attn on --no-mmap --temp 1 --top-p 0.95 --top-k 64 --parallel 1 --batch-size 2048 --ubatch-size 512 -ngl 999 --device-draft CUDA1 --no-warmup

Result:

eval time = 13229.08 ms / 671 tokens (19.72 ms per token, 50.72 tokens per second)
draft acceptance = 0.59596 (472 accepted / 792 generated)
#gen tokens = 792, #acc tokens = 472

So the previous 0% acceptance was caused by Q8 KV cache. With f16/default KV cache, Draft-MTP works correctly on my dual 3080 setup.

Additional confirmation: I re-tested with Q8 KV cache enabled again (-ctk q8_0 -ctv q8_0) using the same working setup.

Command:

./build-cuda/bin/llama-server -m Gemma4-31B-Q8_0.gguf -md mtp-gemma-4-31B-it.gguf -c 16384 --spec-type draft-mtp --spec-draft-n-max 4 --flash-attn on --no-mmap --temp 1 --top-p 0.95 --top-k 64 --parallel 1 --batch-size 2048 --ubatch-size 512 -ngl 999 --device-draft CUDA1 -ctk q8_0 -ctv q8_0 --no-warmup

With Q8 KV cache enabled, performance dropped again:

n_decoded = 100, tg = 14.61 t/s
n_decoded = 145, tg = 14.63 t/s
n_decoded = 189, tg = 14.63 t/s

Without Q8 KV cache, the same setup reached:

eval time = 13229.08 ms / 671 tokens (19.72 ms per token, 50.72 tokens per second)
draft acceptance = 0.59596 (472 accepted / 792 generated)
#gen tokens = 792, #acc tokens = 472

So this confirms the issue is related to Q8 KV cache. With default/f16 KV cache, Draft-MTP works correctly; with -ctk q8_0 -ctv q8_0, it degrades heavily / previously reached 0% acceptance.

fabriciomalta avatar May 20 '26 17:05 fabriciomalta

Strix Halo:

$llama-server -m models/Gemma4-31B-Q8_0.gguf --port 18080

 python3 scripts/mtp-bench.py --url http://127.0.0.1:18080
  code_python        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.7
  code_cpp           pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.6
  explain_concept    pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.7
  summarize          pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.6
  qa_factual         pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.6
  translation        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.7
  creative_short     pred=  36 draft=   0 acc=   0 rate=n/a tok/s=6.8
  stepwise_math      pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.7
  long_code_review   pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.5

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1572,
  "total_draft": 0,
  "total_draft_accepted": 0,
  "aggregate_accept_rate": null,
  "wall_s_total": 244.6
}
$llama-server -m models/Gemma4-31B-Q8_0.gguf -md models/mtp-gemma-4-31B-it.gguf -c 16384 --spec-type draft-mtp --spec-draft-n-max 4 --port 18080

python3 scripts/mtp-bench.py --url http://127.0.0.1:18080
  code_python        pred= 192 draft= 209 acc= 138 rate=0.660 tok/s=17.7
  code_cpp           pred= 192 draft= 167 acc= 149 rate=0.892 tok/s=22.1
  explain_concept    pred= 192 draft= 188 acc= 144 rate=0.766 tok/s=19.9
  summarize          pred= 192 draft= 180 acc= 145 rate=0.806 tok/s=20.3
  qa_factual         pred= 192 draft= 169 acc= 148 rate=0.876 tok/s=21.7
  translation        pred= 192 draft= 327 acc= 107 rate=0.327 tok/s=11.2
  creative_short     pred=  36 draft=  68 acc=  19 rate=0.279 tok/s=10.4
  stepwise_math      pred= 192 draft= 192 acc= 142 rate=0.740 tok/s=19.1
  long_code_review   pred= 192 draft= 317 acc= 111 rate=0.350 tok/s=11.1

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1572,
  "total_draft": 1817,
  "total_draft_accepted": 1103,
  "aggregate_accept_rate": 0.607,
  "wall_s_total": 103.42
}

Best results for me:

$llama-server -m models/gemma-4-31B-it-Q4_K_M.gguf -md models/mtp-gemma-4-31B-it.gguf -c 16384 --spec-type draft-mtp --spec-draft-n-max 3 --port 18080

  code_python        pred= 192 draft= 177 acc= 132 rate=0.746 tok/s=26.5
  code_cpp           pred= 192 draft= 201 acc= 124 rate=0.617 tok/s=22.0
  explain_concept    pred= 192 draft= 222 acc= 116 rate=0.522 tok/s=19.7
  summarize          pred= 192 draft= 156 acc= 138 rate=0.885 tok/s=27.9
  qa_factual         pred= 192 draft= 188 acc= 128 rate=0.681 tok/s=23.5
  translation        pred= 192 draft= 180 acc= 130 rate=0.722 tok/s=24.3
  creative_short     pred=  36 draft=  54 acc=  18 rate=0.333 tok/s=15.5
  stepwise_math      pred= 192 draft= 151 acc= 140 rate=0.927 tok/s=28.9
  long_code_review   pred= 192 draft= 276 acc=  97 rate=0.351 tok/s=14.8

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1572,
  "total_draft": 1605,
  "total_draft_accepted": 1023,
  "aggregate_accept_rate": 0.6374,
  "wall_s_total": 78.44
}

Q=4 with N=3 seems to be pretty fast.

exander77 avatar May 20 '26 23:05 exander77

Performance on mtp-bench on a DGX Spark 🧵

No MTP

  code_python        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.1
  code_cpp           pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.2
  explain_concept    pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.0
  summarize          pred= 192 draft=   0 acc=   0 rate=n/a tok/s=5.9
  qa_factual         pred= 192 draft=   0 acc=   0 rate=n/a tok/s=5.9
  translation        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.2
  creative_short     pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.2
  stepwise_math      pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.0
  long_code_review   pred= 192 draft=   0 acc=   0 rate=n/a tok/s=6.0

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 0,
  "total_draft_accepted": 0,
  "aggregate_accept_rate": null,
  "wall_s_total": 290.01
}

--spec-draft-n-max 4

  code_python        pred= 192 draft= 231 acc= 133 rate=0.576 tok/s=14.9
  code_cpp           pred= 192 draft= 197 acc= 141 rate=0.716 tok/s=18.0
  explain_concept    pred= 192 draft= 268 acc= 123 rate=0.459 tok/s=12.9
  summarize          pred= 192 draft= 208 acc= 138 rate=0.663 tok/s=16.2
  qa_factual         pred= 192 draft= 211 acc= 138 rate=0.654 tok/s=16.4
  translation        pred= 192 draft= 235 acc= 131 rate=0.557 tok/s=14.6
  creative_short     pred= 192 draft= 292 acc= 117 rate=0.401 tok/s=11.4
  stepwise_math      pred= 192 draft= 180 acc= 146 rate=0.811 tok/s=19.3
  long_code_review   pred= 192 draft= 222 acc= 135 rate=0.608 tok/s=14.9

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 2044,
  "total_draft_accepted": 1202,
  "aggregate_accept_rate": 0.5881,
  "wall_s_total": 120.65
}

Btw, those DGX Spark numbers look terrible.

That is worse then Strix Halo.

exander77 avatar May 21 '26 01:05 exander77

My earlier results were scuffed. This should be more representative for this hardware. Looks good!

throughput
CUDA0   : NVIDIA RTX PRO 6000 Blackwell Server Edition (97249 MiB, 96691 MiB free)
CPU     : AMD EPYC 9355 32-Core Processor (1547705 MiB, 1547705 MiB free)
Detailed Results

No MTP (Q8)

./llama-server -m ../Gemma4-31B-Q8_0.gguf -np 1

  code_python        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=39.9
  code_cpp           pred= 192 draft=   0 acc=   0 rate=n/a tok/s=40.0
  explain_concept    pred= 192 draft=   0 acc=   0 rate=n/a tok/s=40.0
  summarize          pred= 192 draft=   0 acc=   0 rate=n/a tok/s=40.1
  qa_factual         pred= 192 draft=   0 acc=   0 rate=n/a tok/s=40.2
  translation        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=40.2
  creative_short     pred= 192 draft=   0 acc=   0 rate=n/a tok/s=40.2
  stepwise_math      pred= 192 draft=   0 acc=   0 rate=n/a tok/s=40.1
  long_code_review   pred= 192 draft=   0 acc=   0 rate=n/a tok/s=39.5

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 0,
  "total_draft_accepted": 0,
  "aggregate_accept_rate": null,
  "wall_s_total": 44.51
}

MTP --spec-draft-n-max 2 (Q8)

./llama-server -m ../Gemma4-31B-Q8_0.gguf -np 1 --spec-draft-model ../mtp-gemma4-31B-it.gguf --spec-type draft-mtp --spec-draft-n-max 2

  code_python        pred= 192 draft= 155 acc= 113 rate=0.729 tok/s=72.8
  code_cpp           pred= 192 draft= 153 acc= 114 rate=0.745 tok/s=74.5
  explain_concept    pred= 192 draft= 171 acc= 104 rate=0.608 tok/s=66.2
  summarize          pred= 192 draft= 149 acc= 115 rate=0.772 tok/s=76.0
  qa_factual         pred= 192 draft= 158 acc= 111 rate=0.703 tok/s=72.3
  translation        pred= 192 draft= 150 acc= 115 rate=0.767 tok/s=76.1
  creative_short     pred= 192 draft= 184 acc=  99 rate=0.538 tok/s=62.9
  stepwise_math      pred= 192 draft= 149 acc= 116 rate=0.778 tok/s=77.0
  long_code_review   pred= 192 draft= 161 acc= 110 rate=0.683 tok/s=69.3

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 1430,
  "total_draft_accepted": 997,
  "aggregate_accept_rate": 0.6972,
  "wall_s_total": 25.6
}

MTP --spec-draft-n-max 3 (Q8)

./llama-server -m ../Gemma4-31B-Q8_0.gguf -np 1 --spec-draft-model ../mtp-gemma4-31B-it.gguf --spec-type draft-mtp --spec-draft-n-max 3

  code_python        pred= 192 draft= 186 acc= 128 rate=0.688 tok/s=83.1
  code_cpp           pred= 192 draft= 179 acc= 131 rate=0.732 tok/s=87.8
  explain_concept    pred= 192 draft= 237 acc= 111 rate=0.468 tok/s=66.4
  summarize          pred= 192 draft= 182 acc= 130 rate=0.714 tok/s=86.5
  qa_factual         pred= 192 draft= 191 acc= 127 rate=0.665 tok/s=82.8
  translation        pred= 192 draft= 186 acc= 129 rate=0.694 tok/s=85.8
  creative_short     pred= 192 draft= 238 acc= 110 rate=0.462 tok/s=66.0
  stepwise_math      pred= 192 draft= 174 acc= 132 rate=0.759 tok/s=90.2
  long_code_review   pred= 192 draft= 230 acc= 113 rate=0.491 tok/s=66.7

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 1803,
  "total_draft_accepted": 1111,
  "aggregate_accept_rate": 0.6162,
  "wall_s_total": 23.58
}

MTP --spec-draft-n-max 4 (Q8)

./llama-server -m ../Gemma4-31B-Q8_0.gguf -np 1 --spec-draft-model ../mtp-gemma4-31B-it.gguf --spec-type draft-mtp --spec-draft-n-max 4

  code_python        pred= 192 draft= 220 acc= 135 rate=0.614 tok/s=84.5
  code_cpp           pred= 192 draft= 208 acc= 139 rate=0.668 tok/s=91.8
  explain_concept    pred= 192 draft= 285 acc= 118 rate=0.414 tok/s=65.7
  summarize          pred= 192 draft= 190 acc= 143 rate=0.753 tok/s=98.9
  qa_factual         pred= 192 draft= 211 acc= 138 rate=0.654 tok/s=89.8
  translation        pred= 192 draft= 230 acc= 132 rate=0.574 tok/s=81.4
  creative_short     pred= 192 draft= 287 acc= 119 rate=0.415 tok/s=66.7
  stepwise_math      pred= 192 draft= 207 acc= 139 rate=0.671 tok/s=91.7
  long_code_review   pred= 192 draft= 235 acc= 132 rate=0.562 tok/s=79.6

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 2073,
  "total_draft_accepted": 1195,
  "aggregate_accept_rate": 0.5765,
  "wall_s_total": 22.62
}

No MTP (Q4)

./llama-server -m ../gemma4-31B-it-Q4_K_M.gguf -np 1

  code_python        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=61.8
  code_cpp           pred= 192 draft=   0 acc=   0 rate=n/a tok/s=61.9
  explain_concept    pred= 192 draft=   0 acc=   0 rate=n/a tok/s=62.1
  summarize          pred= 192 draft=   0 acc=   0 rate=n/a tok/s=62.1
  qa_factual         pred= 192 draft=   0 acc=   0 rate=n/a tok/s=62.4
  translation        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=62.6
  creative_short     pred= 192 draft=   0 acc=   0 rate=n/a tok/s=62.8
  stepwise_math      pred= 192 draft=   0 acc=   0 rate=n/a tok/s=62.5
  long_code_review   pred= 192 draft=   0 acc=   0 rate=n/a tok/s=61.0

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 0,
  "total_draft_accepted": 0,
  "aggregate_accept_rate": null,
  "wall_s_total": 29.09
}

MTP --spec-draft-n-max 2 (Q4)

./llama-server -m ../gemma-4-31B-it-Q4_0-mtp.gguf -np 1 --spec-draft-model ../mtp-gemma4-31B-it.gguf --spec-type draft-mtp --spec-draft-n-max 2

  code_python        pred= 192 draft= 166 acc= 107 rate=0.645 tok/s=93.6
  code_cpp           pred= 192 draft= 165 acc= 108 rate=0.654 tok/s=95.5
  explain_concept    pred= 192 draft= 158 acc= 111 rate=0.703 tok/s=99.3
  summarize          pred= 192 draft= 154 acc= 113 rate=0.734 tok/s=101.5
  qa_factual         pred= 192 draft= 154 acc= 114 rate=0.740 tok/s=102.8
  translation        pred= 192 draft= 169 acc= 105 rate=0.621 tok/s=92.4
  creative_short     pred= 192 draft= 184 acc=  99 rate=0.538 tok/s=86.3
  stepwise_math      pred= 192 draft= 150 acc= 116 rate=0.773 tok/s=105.4
  long_code_review   pred= 192 draft= 155 acc= 113 rate=0.729 tok/s=97.4

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 1455,
  "total_draft_accepted": 986,
  "aggregate_accept_rate": 0.6777,
  "wall_s_total": 19.26
}

MTP --spec-draft-n-max 3 (Q4)

./llama-server -m ../gemma-4-31B-it-Q4_0-mtp.gguf -np 1 --spec-draft-model ../mtp-gemma4-31B-it.gguf --spec-type draft-mtp --spec-draft-n-max 3

  code_python        pred= 192 draft= 208 acc= 121 rate=0.582 tok/s=94.4
  code_cpp           pred= 192 draft= 190 acc= 127 rate=0.668 tok/s=104.6
  explain_concept    pred= 192 draft= 199 acc= 123 rate=0.618 tok/s=99.2
  summarize          pred= 192 draft= 189 acc= 128 rate=0.677 tok/s=106.0
  qa_factual         pred= 192 draft= 184 acc= 129 rate=0.701 tok/s=107.9
  translation        pred= 192 draft= 183 acc= 128 rate=0.700 tok/s=106.7
  creative_short     pred= 192 draft= 238 acc= 111 rate=0.466 tok/s=83.8
  stepwise_math      pred= 192 draft= 178 acc= 131 rate=0.736 tok/s=111.3
  long_code_review   pred= 192 draft= 213 acc= 120 rate=0.563 tok/s=91.3

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 1782,
  "total_draft_accepted": 1118,
  "aggregate_accept_rate": 0.6274,
  "wall_s_total": 18.72
}

MTP --spec-draft-n-max 4 (Q4)

./llama-server -m ../gemma-4-31B-it-Q4_0-mtp.gguf -np 1 --spec-draft-model ../mtp-gemma4-31B-it.gguf --spec-type draft-mtp --spec-draft-n-max 4

  code_python        pred= 192 draft= 232 acc= 133 rate=0.573 tok/s=95.0
  code_cpp           pred= 192 draft= 220 acc= 136 rate=0.618 tok/s=102.4
  explain_concept    pred= 192 draft= 244 acc= 130 rate=0.533 tok/s=93.0
  summarize          pred= 192 draft= 215 acc= 137 rate=0.637 tok/s=104.8
  qa_factual         pred= 192 draft= 225 acc= 133 rate=0.591 tok/s=98.9
  translation        pred= 192 draft= 198 acc= 140 rate=0.707 tok/s=112.3
  creative_short     pred= 192 draft= 290 acc= 116 rate=0.400 tok/s=76.9
  stepwise_math      pred= 192 draft= 188 acc= 144 rate=0.766 tok/s=120.0
  long_code_review   pred= 192 draft= 281 acc= 119 rate=0.423 tok/s=78.3

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 2093,
  "total_draft_accepted": 1188,
  "aggregate_accept_rate": 0.5676,
  "wall_s_total": 19.39
}

Summary

Configuration Accept rate Wall (s) Mean tok/s Min tok/s Max tok/s Speedup vs. baseline
Q8 no MTP n/a 44.51 40.0 39.5 40.2 1.00x
Q8 MTP n=2 0.6972 25.60 71.9 62.9 77.0 1.74x
Q8 MTP n=3 0.6162 23.58 79.5 66.0 90.2 1.89x
Q8 MTP n=4 0.5765 22.62 83.3 65.7 98.9 1.97x
Q4 no MTP n/a 29.09 62.1 61.0 62.8 1.00x
Q4 MTP n=2 0.6777 19.26 97.1 86.3 105.4 1.51x
Q4 MTP n=3 0.6274 18.72 100.6 83.8 111.3 1.55x
Q4 MTP n=4 0.5676 19.39 98.0 76.9 120.0 1.50x

aldehir avatar May 21 '26 09:05 aldehir

Btw, MTP performance is dropping like stone with the number of generated tokens:

0.24.244.174 I slot print_timing: id  3 | task 0 | n_decoded =    102, tg =  21.98 t/s
0.27.281.301 I slot print_timing: id  3 | task 0 | n_decoded =    159, tg =  20.71 t/s
0.30.297.664 I slot print_timing: id  3 | task 0 | n_decoded =    219, tg =  20.48 t/s
0.33.323.579 I slot print_timing: id  3 | task 0 | n_decoded =    261, tg =  19.02 t/s
0.36.362.248 I slot print_timing: id  3 | task 0 | n_decoded =    316, tg =  18.86 t/s
0.39.403.011 I slot print_timing: id  3 | task 0 | n_decoded =    356, tg =  17.98 t/s
0.42.464.690 I slot print_timing: id  3 | task 0 | n_decoded =    399, tg =  17.45 t/s
0.45.549.605 I slot print_timing: id  3 | task 0 | n_decoded =    449, tg =  17.31 t/s
0.48.649.500 I slot print_timing: id  3 | task 0 | n_decoded =    495, tg =  17.04 t/s
0.51.772.793 I slot print_timing: id  3 | task 0 | n_decoded =    549, tg =  17.07 t/s
0.54.908.512 I slot print_timing: id  3 | task 0 | n_decoded =    596, tg =  16.88 t/s
0.58.060.444 I slot print_timing: id  3 | task 0 | n_decoded =    650, tg =  16.90 t/s
1.01.067.640 I slot print_timing: id  3 | task 0 | n_decoded =    698, tg =  16.83 t/s
1.04.092.355 I slot print_timing: id  3 | task 0 | n_decoded =    743, tg =  16.70 t/s
1.07.126.792 I slot print_timing: id  3 | task 0 | n_decoded =    770, tg =  16.20 t/s
1.10.159.027 I slot print_timing: id  3 | task 0 | n_decoded =    790, tg =  15.63 t/s
1.13.203.681 I slot print_timing: id  3 | task 0 | n_decoded =    817, tg =  15.24 t/s
1.16.253.815 I slot print_timing: id  3 | task 0 | n_decoded =    842, tg =  14.86 t/s
1.19.296.759 I slot print_timing: id  3 | task 0 | n_decoded =    863, tg =  14.46 t/s
1.22.362.333 I slot print_timing: id  3 | task 0 | n_decoded =    893, tg =  14.23 t/s
1.25.435.785 I slot print_timing: id  3 | task 0 | n_decoded =    917, tg =  13.93 t/s
1.28.513.244 I slot print_timing: id  3 | task 0 | n_decoded =    943, tg =  13.68 t/s
1.31.605.041 I slot print_timing: id  3 | task 0 | n_decoded =    974, tg =  13.53 t/s
1.34.719.200 I slot print_timing: id  3 | task 0 | n_decoded =   1010, tg =  13.45 t/s
1.37.827.497 I slot print_timing: id  3 | task 0 | n_decoded =   1044, tg =  13.35 t/s
1.40.943.354 I slot print_timing: id  3 | task 0 | n_decoded =   1078, tg =  13.25 t/s
1.44.048.735 I slot print_timing: id  3 | task 0 | n_decoded =   1108, tg =  13.12 t/s
1.47.157.223 I slot print_timing: id  3 | task 0 | n_decoded =   1133, tg =  12.94 t/s
1.50.259.207 I slot print_timing: id  3 | task 0 | n_decoded =   1157, tg =  12.76 t/s
1.53.366.193 I slot print_timing: id  3 | task 0 | n_decoded =   1177, tg =  12.55 t/s
1.56.478.671 I slot print_timing: id  3 | task 0 | n_decoded =   1202, tg =  12.41 t/s
1.59.584.404 I slot print_timing: id  3 | task 0 | n_decoded =   1224, tg =  12.24 t/s
2.02.699.398 I slot print_timing: id  3 | task 0 | n_decoded =   1259, tg =  12.21 t/s
2.05.819.221 I slot print_timing: id  3 | task 0 | n_decoded =   1291, tg =  12.15 t/s
2.08.936.941 I slot print_timing: id  3 | task 0 | n_decoded =   1327, tg =  12.14 t/s
2.12.043.967 I slot print_timing: id  3 | task 0 | n_decoded =   1356, tg =  12.06 t/s
2.15.154.959 I slot print_timing: id  3 | task 0 | n_decoded =   1386, tg =  11.99 t/s
2.18.266.778 I slot print_timing: id  3 | task 0 | n_decoded =   1414, tg =  11.92 t/s
2.21.383.934 I slot print_timing: id  3 | task 0 | n_decoded =   1440, tg =  11.82 t/s
2.24.507.527 I slot print_timing: id  3 | task 0 | n_decoded =   1470, tg =  11.77 t/s
2.27.626.369 I slot print_timing: id  3 | task 0 | n_decoded =   1500, tg =  11.72 t/s
2.30.759.873 I slot print_timing: id  3 | task 0 | n_decoded =   1535, tg =  11.70 t/s
2.33.878.260 I slot print_timing: id  3 | task 0 | n_decoded =   1556, tg =  11.59 t/s
2.37.006.136 I slot print_timing: id  3 | task 0 | n_decoded =   1581, tg =  11.51 t/s
2.40.132.048 I slot print_timing: id  3 | task 0 | n_decoded =   1607, tg =  11.44 t/s
2.43.272.379 I slot print_timing: id  3 | task 0 | n_decoded =   1637, tg =  11.39 t/s
2.46.412.870 I slot print_timing: id  3 | task 0 | n_decoded =   1671, tg =  11.38 t/s
2.49.542.495 I slot print_timing: id  3 | task 0 | n_decoded =   1701, tg =  11.34 t/s
2.52.680.157 I slot print_timing: id  3 | task 0 | n_decoded =   1729, tg =  11.30 t/s
2.55.823.514 I slot print_timing: id  3 | task 0 | n_decoded =   1758, tg =  11.25 t/s
2.58.977.763 I slot print_timing: id  3 | task 0 | n_decoded =   1790, tg =  11.23 t/s
3.02.136.909 I slot print_timing: id  3 | task 0 | n_decoded =   1820, tg =  11.20 t/s

exander77 avatar May 21 '26 11:05 exander77

Gwen drop off is not that bad with N=4:

1.51.469.481 I slot print_timing: id  0 | task 0 | n_decoded =    104, tg =  22.31 t/s
1.54.535.366 I slot print_timing: id  0 | task 0 | n_decoded =    161, tg =  20.83 t/s
1.57.583.185 I slot print_timing: id  0 | task 0 | n_decoded =    219, tg =  20.32 t/s
2.00.638.615 I slot print_timing: id  0 | task 0 | n_decoded =    267, tg =  19.30 t/s
2.03.675.405 I slot print_timing: id  0 | task 0 | n_decoded =    310, tg =  18.38 t/s
2.06.719.914 I slot print_timing: id  0 | task 0 | n_decoded =    354, tg =  17.78 t/s
2.09.754.642 I slot print_timing: id  0 | task 0 | n_decoded =    405, tg =  17.65 t/s
2.12.795.200 I slot print_timing: id  0 | task 0 | n_decoded =    466, tg =  17.93 t/s
2.15.838.330 I slot print_timing: id  0 | task 0 | n_decoded =    519, tg =  17.88 t/s
2.18.865.821 I slot print_timing: id  0 | task 0 | n_decoded =    560, tg =  17.47 t/s
2.21.904.879 I slot print_timing: id  0 | task 0 | n_decoded =    599, tg =  17.07 t/s
2.24.953.862 I slot print_timing: id  0 | task 0 | n_decoded =    640, tg =  16.78 t/s
2.27.980.490 I slot print_timing: id  0 | task 0 | n_decoded =    676, tg =  16.42 t/s
2.31.016.384 I slot print_timing: id  0 | task 0 | n_decoded =    711, tg =  16.08 t/s
2.34.055.319 I slot print_timing: id  0 | task 0 | n_decoded =    744, tg =  15.75 t/s
2.37.107.489 I slot print_timing: id  0 | task 0 | n_decoded =    780, tg =  15.51 t/s
2.40.158.953 I slot print_timing: id  0 | task 0 | n_decoded =    820, tg =  15.37 t/s
2.43.202.914 I slot print_timing: id  0 | task 0 | n_decoded =    865, tg =  15.34 t/s
2.46.252.461 I slot print_timing: id  0 | task 0 | n_decoded =    897, tg =  15.09 t/s
2.49.293.043 I slot print_timing: id  0 | task 0 | n_decoded =    939, tg =  15.03 t/s
2.52.347.741 I slot print_timing: id  0 | task 0 | n_decoded =    981, tg =  14.97 t/s
2.55.397.269 I slot print_timing: id  0 | task 0 | n_decoded =   1019, tg =  14.86 t/s
2.58.459.318 I slot print_timing: id  0 | task 0 | n_decoded =   1071, tg =  14.95 t/s
3.01.502.432 I slot print_timing: id  0 | task 0 | n_decoded =   1105, tg =  14.79 t/s
3.04.538.266 I slot print_timing: id  0 | task 0 | n_decoded =   1141, tg =  14.68 t/s
3.07.595.497 I slot print_timing: id  0 | task 0 | n_decoded =   1188, tg =  14.71 t/s
3.10.652.838 I slot print_timing: id  0 | task 0 | n_decoded =   1235, tg =  14.73 t/s
3.13.730.514 I slot print_timing: id  0 | task 0 | n_decoded =   1285, tg =  14.78 t/s
3.16.775.363 I slot print_timing: id  0 | task 0 | n_decoded =   1323, tg =  14.71 t/s
3.19.838.521 I slot print_timing: id  0 | task 0 | n_decoded =   1371, tg =  14.74 t/s
3.22.884.017 I slot print_timing: id  0 | task 0 | n_decoded =   1408, tg =  14.66 t/s
3.25.933.412 I slot print_timing: id  0 | task 0 | n_decoded =   1442, tg =  14.55 t/s
3.28.991.579 I slot print_timing: id  0 | task 0 | n_decoded =   1484, tg =  14.52 t/s
3.32.075.580 I slot print_timing: id  0 | task 0 | n_decoded =   1537, tg =  14.60 t/s
3.35.129.604 I slot print_timing: id  0 | task 0 | n_decoded =   1571, tg =  14.50 t/s
3.38.188.282 I slot print_timing: id  0 | task 0 | n_decoded =   1613, tg =  14.48 t/s
3.41.259.031 I slot print_timing: id  0 | task 0 | n_decoded =   1661, tg =  14.51 t/s
3.44.315.210 I slot print_timing: id  0 | task 0 | n_decoded =   1698, tg =  14.45 t/s
3.47.377.470 I slot print_timing: id  0 | task 0 | n_decoded =   1731, tg =  14.36 t/s
3.50.444.836 I slot print_timing: id  0 | task 0 | n_decoded =   1773, tg =  14.34 t/s
3.53.518.562 I slot print_timing: id  0 | task 0 | n_decoded =   1821, tg =  14.37 t/s
3.56.599.570 I slot print_timing: id  0 | task 0 | n_decoded =   1868, tg =  14.39 t/s
3.59.667.177 I slot print_timing: id  0 | task 0 | n_decoded =   1904, tg =  14.33 t/s
4.02.733.855 I slot print_timing: id  0 | task 0 | n_decoded =   1948, tg =  14.33 t/s

But generally N=4 is too much, there should be dynamic behavior implemented.

exander77 avatar May 21 '26 11:05 exander77

For the MoE model I don't observe a speed-up on my system, but the dense model has on average >2x speedup.

Thanks very much for this PR! The performance numbers with MTP on the dense model look great!

Regarding the MoE model, I also tried a related experiment with an Eagle3 checkpoint on DGX Spark, and it appears to provide some speedup there. This may be a useful reference point for understanding why MTP does not show the same speedup on the MoE model.

One possible explanation is that Eagle3 is more lightweight: it uses a single-layer transformer and incorporates d2t vocabulary mapping, which may reduce the draft-model overhead compared with MTP. In addition, I found that tuning --spec-draft-p-min also helps improve the speedup.

A possible future direction could be to explore whether Eagle3 and MTP can be combined. MTP is generally strong across broad tasks because it is paired with target-model pretraining, while Eagle3 may be easier to adapt for domain-specific use cases, since users can train Eagle3 separately on their own customized datasets.

For reference, here are the Eagle3 performance numbers with Gemma4-A4B-26B (BF16) on DGX Spark:

  • Without Eagle3
  code_python        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=28.3
  code_cpp           pred= 192 draft=   0 acc=   0 rate=n/a tok/s=28.3
  explain_concept    pred= 192 draft=   0 acc=   0 rate=n/a tok/s=28.3
  summarize          pred= 192 draft=   0 acc=   0 rate=n/a tok/s=28.3
  qa_factual         pred= 192 draft=   0 acc=   0 rate=n/a tok/s=28.3
  translation        pred= 192 draft=   0 acc=   0 rate=n/a tok/s=28.3
  creative_short     pred= 192 draft=   0 acc=   0 rate=n/a tok/s=28.3
  stepwise_math      pred= 192 draft=   0 acc=   0 rate=n/a tok/s=28.3
  long_code_review   pred= 192 draft=   0 acc=   0 rate=n/a tok/s=27.6

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 0,
  "total_draft_accepted": 0,
  "aggregate_accept_rate": null,
  "wall_s_total": 64.01
}
  • With Eagle3
  code_python        pred= 192 draft= 215 acc= 116 rate=0.539 tok/s=41.4
  code_cpp           pred= 192 draft= 181 acc= 102 rate=0.564 tok/s=38.6
  explain_concept    pred= 192 draft= 172 acc=  99 rate=0.576 tok/s=37.0
  summarize          pred= 192 draft= 211 acc= 119 rate=0.564 tok/s=42.3
  qa_factual         pred= 192 draft= 181 acc= 108 rate=0.597 tok/s=40.7
  translation        pred= 192 draft= 176 acc=  95 rate=0.540 tok/s=36.0
  creative_short     pred= 192 draft= 182 acc=  80 rate=0.440 tok/s=32.4
  stepwise_math      pred= 192 draft= 204 acc= 121 rate=0.593 tok/s=44.2
  long_code_review   pred= 192 draft= 155 acc= 108 rate=0.697 tok/s=40.1

Aggregate: {
  "n_requests": 9,
  "total_predicted": 1728,
  "total_draft": 1677,
  "total_draft_accepted": 948,
  "aggregate_accept_rate": 0.5653,
  "wall_s_total": 46.12
}

Details can be found in Eagle3 PR: https://github.com/ggml-org/llama.cpp/pull/18039#issuecomment-4500827273 Q4_K_M quantized models is a bit worse. https://github.com/ggml-org/llama.cpp/pull/18039#issuecomment-4507174617

ruixiang63 avatar May 21 '26 13:05 ruixiang63

Why is the E4B/E2B not supported yet? Is it that different?

Handyfff avatar May 23 '26 04:05 Handyfff

Quantized kv-cache should now work, it was missing the hadamard rotn for Q.

@Handyfff it will be added later

am17an avatar May 23 '26 07:05 am17an