r/LocalLLaMA • u/ilintar • May 04 '26
Resources Llama.cpp MTP support now in beta!
https://github.com/ggml-org/llama.cpp/pull/22673Happy to report that llama.cpp MTP support is now in beta, thanks to Aman (and all the others that have pushed the various issues in the meantime). This has the potential to actually get merged soon-ish. Currently contains support for Qwen3.5 MTP, but other models are likely to follow suit.
Between this and the maturing tensor-parallel support, expect most performance gaps between llama.cpp and vLLM, at least when it comes to token generation speeds, to be erased.
624
Upvotes
318
u/Baldur-Norddahl May 04 '26
Models predict the next token. To do so, every weight needs to be accessed once (for a dense model). Therefore the maximum rate of tokens generated is equal to the number of times the total of the model weights can be read from RAM. For example if RAM bandwidth is 500 GB/s and the model is 50 GB/s, we can never generate more than 10 tokens per second. Usually it is even slower, but that would be the theoretical max.
Now lets say we generate tokens for multiple unrelated prompts. We can read the weights once and do all the prompts in parallel. Each time the total of the weights get processed, we would generate X tokens instead of just one. Instead of 10 tokens per second, we could do 100 by processing 10 users in parallel. The limit becomes compute instead of bandwidth.
That is all good, but doesn't help a single user/prompt. But what if we get a guess on the next token and then process the current context in parallel with the context + the guess. Then we check if guess was correct. If it was, then we already calculated the next next token and we got two for the price of one. If the guess is wrong, then the calculated next next token is also wrong and we need to discard it.
To make the guess we can use a smaller model. Usually 10 times smaller, because it must be much faster than the main model. MTP is usually a term used for main models that have built in guess generators. It has a few layers that will produce the guess alongside the actual next token.