Repository navigation
[Docs] Update the ngram speculative decoding notes: devices, overlap scheduler, external corpus flags - #42687
Open
7konigsberg wants to merge 1 commit into
Open
7konigsberg wants to merge 1 commit into
7konigsberg wants to merge 1 commit into
Conversation
7konigsberg
requested review from
JustinTong0323,
sogalin,
wisclmy0611 and
zijiexia
as code owners
October 6, 2026 00:40
…scheduler, external corpus flags Four statements in the Ngram section no longer match the code: - "only supports CUDA": `_handle_ngram` in `arg_groups/speculative_hook.py` accepts cuda, cpu and xpu, and `ngram_worker.py` has CPU and XPU paths. - "disables the overlap scheduler": only `_disable_overlap_schedule_for_cpu` does that, on CPU. A CUDA NGRAM server runs with the overlap scheduler on (`disable_overlap_schedule: False` in its printed server args). Mixed chunked prefill is still disabled, which the note keeps. - `--speculative-num-draft-tokens` "defaults to min(max-trie-depth, 12)": `_handle_ngram` sets 12 unconditionally. - The parameter table stopped at `--speculative-ngram-capacity`; the three external-corpus flags from `arg_groups/fields/spec.py`, which `server_arguments.mdx` already documents, were missing here. The feature table row for NGRAM is updated to match the notes. Co-Authored-By: Claude Fable 5.1 <[email protected]>
7konigsberg
force-pushed
the
docs/ngram-spec-decoding-notes
branch
from
October 6, 2026 00:42
e51f53b to
a4216be
Compare
4 of 5 tasks
4 of 5 tasks
This was referenced Nov 9, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
While working on #42313 I read the Ngram section of
speculative_decoding.mdxnext to the code, and four things on the page no longer match it. Small page, but it is the first thing someone turning on NGRAM reads, so I think it is worth keeping right.Modifications
_handle_ngraminarg_groups/speculative_hook.pyacceptscuda,cpuandxpu, andngram_worker.pyhas CPU and XPU paths. Note and feature-table row updated._disable_overlap_schedule_for_cpu, so CPU only. A CUDA NGRAM server starts withdisable_overlap_schedule: Falsein its printed server args. Mixed chunked prefill is still disabled, kept that part.--speculative-num-draft-tokens"defaults tomin(--speculative-ngram-max-trie-depth, 12)":_handle_ngramsets 12 unconditionally. There is no clamp against the trie depth anywhere.--speculative-ngram-capacity: added the three external-corpus flags fromarg_groups/fields/spec.py(-external-corpus-path,-external-sam-budget,-external-corpus-max-tokens), with the descriptions already used inserver_arguments.mdx, plus the two validation rules_handle_ngramenforces on the budget.Defaults in the table (1, 10, 18, 10,000,000) match the code and are unchanged. Nothing outside the Ngram section was touched.
Accuracy Tests
N/A, docs only.
Speed Tests and Profiling
N/A, docs only.
Checklist
CI States
Latest PR Test (Base): ✅ Run #37395407191
Latest PR Test (Extra): ❌ Run #37395406980
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.