MTP slows it down?

#32
by naasking - opened

Running Qwen3.8-27B-Cold-Fusion-GAIN-V1.1-NM-DAU-NEO-MAX-NEO-MTP-Q4_K_M.gguf with MTP on llama.cpp, flags --spec-type ngram-map-k4v,draft-mtp --spec-draft-n-max 4 --spec-draft-p-min 0.3, I get ~18 tps.

On Qwopus3.8 and the base model I get 75 tps on code and 45 tps on prose with these same flags.

If I remove the MTP flags for Cold Fusion/GAIN I get the expected baseline of ~30 tps. Varying the n-max and p-min has no effect. Seems like there might be something wrong with the MTP head on this model, or maybe that specific quant.

Owner

Draft level is too high, using 2 or 3 max.
Also see section on which parameters (temp, rep pen) affect MTP.

NOTE:
Qwen/llamacpp has TWO MTP types : One with the drafter/tensors in the GGUF and one external (separate GGUF file).
The quants at this repo use the former.
Make sure your settings account for this issue.

RE: Prose (creative).
In this case is it normal for MTP speeds to drop, as creative use cases will often dip.
With Cold Fusion, there is creative training in some of the datasets and it is unclear if this transferred to MTP tensors.
(an issue unclear with training in general atm with all MTP tensors)

Re: draft level too high, I also tried n-max=2, same results. I tried various permutations of draft n-max and p-min values. When I did this with the base Qwen model I saw changes in performance, but no changes to this model's performance.

Re: two MTP types, I compared Unsloth Q4_K_M which has tensors built-in. I used the same llama.cpp parameters for Unsloth and just switched to this Q4 (with this mmproj). Then I tried various n-max and p-min permutations, per the above. The only difference I saw was removing drafting entirely, which nearly doubled speed.

Full default parameters:

/root/llama.cpp/build/bin/llama-server --host 0.0.0.0 --port 8080 \
 -m /root/models/Qwen3.8-27B-Cold-Fusion-GAIN-V1.1-NM-DAU-NEO-MAX-NEO-MTP-Q4_K_M.gguf -ngl all \
 -c 405000 -ctk q8_0 -ctv q8_0 -fa on -t 4 \
 -b 4096 -ub 1024 --jinja --parallel 3 --chat-template-kwargs '{"preserve_thinking": true}' \
 --spec-type ngram-map-k4v,draft-mtp --spec-draft-n-max 4 --spec-draft-p-min 0.95 --kv-unified \
 -cram 20480 --ctx-checkpoints 32 --cache-idle-slots --temp 1.0 \
 --mmproj /root/models/cold-fusion-mmproj-F16.gguf --top-k 20

Also tried with the froggeric chat template, no difference.

Owner

-c 405000 ?

Max is 256,000 => and 405,000 will take a lot of VRAM , maybe too much => low T/S with ram being used/shuffled.

I'm running very simple tests with only one connection at a time that's less than 1k of context. Max tokens per context is 262k, which llama.cpp detects, the -c parameter specifies total context across up to 3 parallel sessions (-parallel 3) across a --kv-unified cache, and the -cram parameter offloads extra to system RAM. In any case, this is besides the point because as I keep saying, base Qwen and Qwopus both run with excellent MTP speedup with the exact same parameters, same simple tests.

Sign up or log in to comment