Repository navigation
[Feat] spec: Let out-of-tree platforms provide EAGLE draft graph runners - #45145
Merged
Merged
Conversation
AgainstEntropy
requested review from
JustinTong0323,
Qiaolin-Yu,
Ying1123,
alexnails,
hnyls2002,
merrymercy,
sogalin,
whybeyoung,
wisclmy0611 and
zijiexia
as code owners
October 19, 2026 09:27
AgainstEntropy
force-pushed
the
yihao/oot-draft-graph-runners
branch
from
October 22, 2026 21:08
a0766e1 to
ef8ca35
Compare
Collaborator
Author
|
/tag-and-rerun-ci |
4 of 5 tasks
Collaborator
Author
|
/rerun-failed-ci |
alexnails
force-pushed
the
yihao/oot-draft-graph-runners
branch
from
October 24, 2026 03:59
ef8ca35 to
6fb31cf
Compare
alexnails
requested review from
BBuf,
DarkSharpness,
HaiShaw,
HydraQYH,
alphabetc1,
celve and
yuan-luo
as code owners
October 24, 2026 04:25
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Stacked on "[Feat] spec: Let out-of-tree platforms provide their own speculative worker". An out-of-tree platform that runs the built-in EAGLEWorkerV2 with device graph capture cannot capture the draft graphs: EagleDraftWorker looks the draft decode / draft extend runners up in maps keyed by in-tree device names, which raises KeyError for an OOT device. Adaptive speculation also hardcodes the CUDA runner for its per-configuration target verify graphs. - SRTPlatform.get_speculative_graph_runner_cls(algorithm, phase) for "draft_decode" and "draft_extend"; None runs the phase eagerly, and it is not consulted when capabilities.graph_capture is False. On an OOT platform the device-keyed maps are never indexed. - Adaptive target verify runners on an OOT platform come from get_graph_runner_cls(), the class the startup target verify graph already uses; document the keyword arguments it must accept. - Built-in platforms keep their current selection. - Document the hook in the plugin guide. Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexnails
force-pushed
the
yihao/oot-draft-graph-runners
branch
from
October 24, 2026 04:27
6fb31cf to
f8e4e2b
Compare
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
An out-of-tree (OOT) platform that runs the built-in
EAGLEWorkerV2with device graph capture cannot capture the EAGLE draft graphs:EagleDraftWorker._capture_cuda_graphslooks the draft decode and draft extend runners up in maps keyed by in-tree device names (cuda,npu,xpu,musa), which raisesKeyErrorfor an OOT device.--speculative-adaptive) hardcodesNPUGraphRunner if _is_npu else DecodeCudaGraphRunnerfor its per-configuration target verify graphs, so an OOT platform gets the CUDA runner, while its startup target verify graph comes fromget_graph_runner_cls().This is part of generic OOT speculative-decoding support, for platforms that use the built-in worker (the previous PR covers platforms that bring their own worker).
Modifications
SRTPlatform.get_speculative_graph_runner_cls(algorithm, phase)(defaultNone) withphasein"draft_decode"/"draft_extend". The class is constructed like the built-in runner for that phase.Noneruns the phase eagerly, and the hook is not consulted whencapabilities.graph_captureis False._select_spec_graph_runner_clspicks the runner in one place: built-in platforms keep today's device-keyed selection (including the draft extend backend conditions); on an OOT platform only the platform answers, so the device maps are never indexed.get_graph_runner_cls(), the same class as the startup target verify graph, so one run never mixes runner classes across step configurations. The keyword arguments it must accept (attn_backend,speculative_num_steps,speculative_num_draft_tokens) are documented on the hook.get_graph_runner_cls().Accuracy Tests
No change on built-in platforms: their runner selection is evaluated exactly as before.
Speed Tests and Profiling
N/A.
Tests
Added to
test/registered/unit/spec/test_oot_eagle_hooks.py(CPU):_capture_cuda_graphson an OOT device takes the draft decode and draft extend runners from the platform and constructs them with the worker (fails withKeyError: 'custom'before this change);capabilities.graph_capture;Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #40062441986
Latest PR Test (Extra): ❌ Run #40062442010
Latest PR Test (AMD ROCm 10): 🚫 Run #40062442003