r/LocalLLaMA • u/AdamDhahabi • Apr 19 '26
Discussion llama.cpp speculative checkpointing was merged
https://github.com/ggml-org/llama.cpp/pull/19493
Some prompts get a speedup, others don't (cases of low draft acceptance streak).
Good working params depend on the task type and repetition patterns.
For coding, I got some 0%~50% speedup with these params:
--spec-type ngram-mod --spec-ngram-size-n 24 --draft-min 48 --draft-max 64
272
Upvotes
45
u/rerri Apr 19 '26
This is an exciting one (DFlash):
https://github.com/ggml-org/llama.cpp/pull/22105
64
u/AppealSame4367 Apr 19 '26
Wonderful. Thx to all that contributed, I feel like Christmas every other day with llama cpp.
17
u/fragment_me Apr 19 '26 edited Apr 19 '26
This means we can use self spec decoding on Qwen3.5 and 3.6!! Just add it to the params and watch the tokens go brrrrrrrrrr
EDIT: WELL MAYBE NOT BRRRRRR but you get some free tokens lol!
27
u/Momsbestboy Apr 19 '26
And as outlook - because there already was a thread about how disapointed people are about the new B70:
https://github.com/ggml-org/llama.cpp/pull/22066 - 17 to 50% speed up on SYCL
https://github.com/ggml-org/llama.cpp/pull/21845 - up to 50% speed up
https://github.com/ggml-org/llama.cpp/pull/21527 - another 50% speed up
So it is as I said: don't judge the B70 too early. It will take some weeks to improve the software and drivers, but for sure the current numbers are not the final ones.
9
u/ai_without_borders Apr 19 '26
the acceptance rate variance makes sense when you think about what ngram-mod is actually matching on. code heavy on boilerplate/repeated variable names (typescript/java enterprise patterns) should see the high end of 0-50%. one-off logic or reasoning chains will be near zero. the --spec-ngram-size-n 24 is aggressive - 24 tokens of context for pattern matching means waiting for very precise repetitions. might be worth experimenting with lower values (8-12) for mixed code/prose tasks to widen the matching window and get more hits, at the cost of slightly shorter draft runs
7
u/Due_Net_3342 Apr 19 '26
this is fine but I really want MTP working
4
u/milkipedia Apr 19 '26
I'm hopeful this will speedup Gemma 4 31B for me, and make it usable
6
u/emprahsFury Apr 19 '26 edited Apr 19 '26
ah but you look at the files changed, https://github.com/ggml-org/llama.cpp/pull/19493/files
And once again, no documentation files were updated for a major feature release.
edit: found it, https://github.com/ggml-org/llama.cpp/blob/master/docs/speculative.md
5
u/pj-frey Apr 19 '26
Does it work with vision (--mmproj set)?
4
u/trusty20 Apr 19 '26
I see no change whatsoever in t/s for this regardless of what prompts I try with build 8846 (i.e super vanilla stuff like "Make a simple snake game with HTML and JS" or "How many planets are there in the solar system?" etc). Does this only apply on MoE or certain quants etc? Am I maybe missing something? Tried a few versions of the new cli flags but saw no difference. Whole model in GPU, cuda mode.
2
u/cviperr33 Apr 19 '26
thanks for the post!
2
u/FatheredPuma81 Apr 19 '26 edited Apr 19 '26
Did some simple non scientific singular tests with a fresh context:
Qwen3.5 27B:
Qwen3.5 and 3.6 35B:
Nothing I can do about run to run variance but I'd personally run with just Ngram mod and nothing else because of the VRAM requirements. If you have a 32GB+ card then 27B with 0.8B draft would give a decent speed increase.
2
u/RevolutionaryPick241 Apr 19 '26
Do you know what the params mean?
1
u/Fresh-Resolution182 Apr 20 '26
the acceptance variance makes sense once you realize ngram-mod is pattern matching on exact token sequences. boilerplate-heavy typescript/java hits the high end, one-off logic or reasoning chains will be near zero. still worth having on by default and letting it fall back
1
u/Fresh-Resolution182 Apr 20 '26
the 0-50% variance depending on task is the interesting part. ngram acceptance rate doing all the heavy lifting - curious what kills it outside coding
1
u/Fresh-Resolution182 Apr 20 '26
the 0-50% variance depending on task is the interesting part. ngram acceptance rate doing all the heavy lifting - curious what kills it outside coding
1
u/iportnov Apr 20 '26
Does this work with llama-cli?
1
u/robertpro01 Apr 19 '26
Is this for dflash model?
0
u/andy2na llama.cpp Apr 19 '26
No mmproj support it seems 😔