cd /news/large-language-models/i-patched-llama-cpp-to-gain-20-promp… · home topics large-language-models article
[ARTICLE · art-42005] src=news.ycombinator.com ↗ pub= topic=large-language-models verified=true sentiment=↑ positive

I patched llama.cpp to gain 20% prompt processing TPS. Help me make a PR

A developer patched llama.cpp to improve prompt processing throughput by 20% when using Multi-Token Prediction (MTP) on GPU, recovering performance lost to MTP overhead. The proof-of-concept processes only the output row instead of the entire ubatch for the last layer MoE FFN, restoring prompt processing TPS to non-MTP levels while retaining most MTP benefits for token generation. The developer seeks collaborators to open a pull request, as the code is AI-generated and cannot be submitted directly due to llama.cpp's contribution policy.

read1 min views1 publishedJun 27, 2026

I've been running Qwen3.6-35B-A3B locally on llama.cpp and noticed that prompt processing throughput gets too low with MTP. I got nerd-sniped.

What started as curiosity turned into a two-week rabbit hole of experiments and ended with a PoC that fully recovers the MTP PP overhead on GPU, above any expectation I had.

TL;DR: instead of processing the last layer MoE FFN for the entire ubatch tokens (usually 512-2048 tokens), this PoC processes only the output row (usually 1 token during prefill). The result is PP TPS is back to the same as with MTP disabled, keeping most of MTP's benefits to TG TPS, even with a slight drop in draft acceptance rate in one of the benchs.

I'm not opening a PR to llama.cpp because this is AI-generated code, which goes against their contribution policy, which I support. If you know C++ and llama.cpp internals, I invite to work together with me to open a PR with a more mature implementation.

Comments URL: [https://news.ycombinator.com/item?id=48700782](https://news.ycombinator.com/item?id=48700782)

Points: 2

── more in #large-language-models 4 stories · sorted by recency
── more on @llama.cpp 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-patched-llama-cpp-…] indexed:0 read:1min 2026-06-27 ·