Having problem running with MTP enabled

#3
by hkhan777 - opened

Hi,

first of all, thanks for the great modal! I am getting around 24 tok/s on 7900xtx with llama-cpp build with ROCm 7.1x.
I have tried running it with unsloth 8b MTP head as suggested in description but I get error of parameter mismatch

/build/bin/llama-cli
-m ~/.cache/huggingface/hub/models--AnonimousA--Qwen3.8-Flash-Next-REAP-320-GGUF/snapshots/5fb294f5d45410d31a3dca15277d87a19b659630/Q2/Qwen3.8-Flash-Next-UD-Q2_K_XL-reap320-00001-of-00002.gguf -ngl 52 -fa on --parallel 1 -c 100000 -ctv q4_0 -ctk q4_0 --temperature 1.0 --top_p 0.95 --top_k 20 --min_p 0.0 --presence_penalty 0.0 -t 16 --n-cpu-moe 28 -md ~/Downloads/mtp-Qwen3.8-Flash-Next-shared-Q8_0.gguf --spec-type draft-mtp --spec-draft-n-max 2 --no-mmap

Loading model... |0.00.759.084 E llama_model_load: error loading model: check_tensor_dims: tensor 'token_embd.weight' not found
0.00.759.095 E llama_model_load_from_file_impl: failed to load model
|0.12.013.181 E llama_model_load: error loading model: check_tensor_dims: tensor 'token_embd.weight' not found
0.12.013.185 E llama_model_load_from_file_impl: failed to load model
0.12.013.186 E common_speculative_init_result: failed to load draft model, '/Downloads/mtp-Qwen3.8-Flash-Next-shared-Q8_0.gguf'
0.12.013.195 E srv load_model: failed to load draft model, '
/Downloads/mtp-Qwen3.8-Flash-Next-shared-Q8_0.gguf'
0.12.013.947 E srv llama_server: exiting due to model loading error
/llama_server exited with code 1
Error: the server exited before becoming ready

It would be great if you could guide me. Thanks in Advance!

Thanks for the report. 24 tok/s on a 7900 XTX with 28 expert layers on CPU is a solid number for this model.

The error is expected on mainline llama.cpp, and the file is fine. The shared MTP heads deliberately omit token_embd.weight (and the output projection): they borrow both from the main model at load time, which is what saves ~1.3 GB. Mainline has the --spec-type draft-mtp flag, but it does not have the Qwen3.8-Flash-Next MTP graph nor the "borrow from the target" loader, so it tries to open the draft as a standalone model and stops at the first missing tensor. That is exactly the message you got.

Fix: use a build that actually has the MTP support. Three options, all listed in Unsloth's MTP/README.md:

  1. Unsloth's fork, release tag b10715-mix-86bd2d3 or newer: https://github.com/unslothai/llama.cpp/releases. The prebuilt binaries there are CUDA/CPU only, so for ROCm take the source tarball of that tag and build it the same way you built mainline (-DGGML_HIP=ON). This is what we run here (a b10798-mix build on Windows/CUDA).
  2. Upstream PR https://github.com/ggml-org/llama.cpp/pull/28243 (same code on its way to mainline, still marked draft as of today).
  3. Unsloth fork PR #144.

Once on one of those builds keep exactly the flags you already have (-md … --spec-type draft-mtp --spec-draft-n-max 2). At startup the shared head prints one error line about borrowing the embeddings. That line is normal, it works.

Don't try the non-shared mtp-Qwen3.8-Flash-Next-Q8_0.gguf on mainline as a workaround: it carries its own embeddings so it gets past this error, but mainline still has no MTP graph for this architecture, so it fails later.

Two things we measured that may help on a 24 GB card:

  • The head costs ~3 GB of VRAM no matter what --n-cpu-moe is, so expect to push 2–3 more expert layers to CPU to fit. The shared-Q4_K_M head saves another ~840 MiB with the same acceptance (we measured 0.70 vs 0.72 for Q8_0), worth it at 24 GB.
  • Acceptance is 0.7–0.8 with n-max 2 and net decode gain on our side was about +30%. Another user reported --spec-draft-n-max 3 working well for him, so it is worth a quick A/B once it loads.

Let me know what you get once it is running.

Thanks for the detailed guidance, I was able to use Unsloth's shared MPT head with their llama.cpp fork as you suggested and got upto 30 tok/s at 8K context.

However, I tried a frontend task, a casual Kanban prompt from https://github.com/ChapouX/benchmarking/blob/main/prompts/kanban.txt got very bizarre UI, everything worked but the UI was like web 1.0.

image

First I ran same command with thinking on and got similar result, it looked more functional than this but all vertical again. Maybe you can try this as well?

hkhan777 changed discussion status to closed
hkhan777 changed discussion status to open

Sign up or log in to comment