Skip to content

spec : fix the check-rate logic of ngram-simple#19261

Merged
ggerganov merged 2 commits into
masterfrom
gg/spec-simple-freq-check
Feb 4, 2026
Merged

spec : fix the check-rate logic of ngram-simple#19261
ggerganov merged 2 commits into
masterfrom
gg/spec-simple-freq-check

Conversation

@ggerganov

@ggerganov ggerganov commented Feb 2, 2026

Copy link
Copy Markdown
Member

fix #19231

For the spec-simple method, we don't need to keep track of the last length to rate-limit the generations. We can simply use an incremental counter. This makes the speculator work with "Regenerate" of last message or branching the conversation from previous messages.

Also, removed struct common_ngram_simple_state - seemed a bit redundant.

@ggerganov
ggerganov force-pushed the gg/spec-simple-freq-check branch from dee323f to b3fa165 Compare February 2, 2026 07:04
@easyfab

easyfab commented Feb 2, 2026

Copy link
Copy Markdown

Thank you very much, it works perfectly now with this fix.

@ggerganov
ggerganov requested a review from srogmann February 3, 2026 06:19

@srogmann srogmann left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the config parameter --spec-ngram-check-rate completely? This parameter was introduced when we didn't have the hash maps in ngram-map-* and ngram-mod. The ngram-simple implementation would get a bit simpler (less risk of bugs like in #19231 ).

@ggerganov
ggerganov merged commit d838c22 into master Feb 4, 2026
74 of 78 checks passed
@ggerganov

Copy link
Copy Markdown
Member Author

Should we remove the config parameter --spec-ngram-check-rate completely?

Yes, let's remove it. Feel free to PR the change.

@ggerganov
ggerganov deleted the gg/spec-simple-freq-check branch February 4, 2026 08:40
liparetejas pushed a commit to liparetejas/llama.cpp that referenced this pull request Feb 23, 2026
* spec : fix the check-rate logic of ngram-simple

* cont : refactor + fix checks
NihilDigit pushed a commit to NihilDigit/llama.cpp that referenced this pull request Apr 12, 2026
* spec : fix the check-rate logic of ngram-simple

* cont : refactor + fix checks
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* spec : fix the check-rate logic of ngram-simple

* cont : refactor + fix checks
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* spec : fix the check-rate logic of ngram-simple

* cont : refactor + fix checks
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* spec : fix the check-rate logic of ngram-simple

* cont : refactor + fix checks
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* spec : fix the check-rate logic of ngram-simple

* cont : refactor + fix checks
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
* spec : fix the check-rate logic of ngram-simple

* cont : refactor + fix checks
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
* spec : fix the check-rate logic of ngram-simple

* cont : refactor + fix checks
MrLordCat referenced this pull request in MrLordCat/llama.cpp-with-GUI Jul 16, 2026
* spec : fix the check-rate logic of ngram-simple

* cont : refactor + fix checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: Speculative decoding only works once with /v1/chat/completions

3 participants