[Speculative] Fix Eagle3/DFLASH aux hidden state capture during CUDA graph init#22836
Merged
merrymercy merged 3 commits intomainfrom Apr 15, 2026
Merged
[Speculative] Fix Eagle3/DFLASH aux hidden state capture during CUDA graph init#22836merrymercy merged 3 commits intomainfrom
merrymercy merged 3 commits intomainfrom
Conversation
…graph init Move `set_eagle3_layers_to_capture()` and `set_dflash_layers_to_capture()` into a new `init_aux_hidden_state_capture()` method and call it BEFORE `init_device_graphs()` in `ModelRunner.initialize()`. Previously these were called AFTER CUDA graph capture, so the captured graphs ran without aux hidden state capture enabled. For Eagle3 this caused zero acceptance length at runtime. The `CudaGraphRunner` had a workaround that called `set_eagle3_layers_to_capture()` without args, which used default layer IDs instead of the config-specified ones. Remove the redundant aux hidden state setup from `CudaGraphRunner.__init__()` and `_dummy_run()`.
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
merrymercy
commented
Apr 15, 2026
Co-authored-by: Lianmin Zheng <lianminzheng@gmail.com>
merrymercy
commented
Apr 15, 2026
|
|
||
| self.tbo_plugin = TboCudaGraphRunnerPlugin() | ||
|
|
||
| # Speculative_inference |
Contributor
Author
There was a problem hiding this comment.
we should call this in model_runner.py::initialize instead of the cuda graph runner.
The old code call this similar code twice with different arguments, which is wrong.
Contributor
Author
|
/tag-and-rerun-ci |
jmamou
pushed a commit
to jmamou/sglang
that referenced
this pull request
Apr 20, 2026
yhyang201
pushed a commit
to yhyang201/sglang
that referenced
this pull request
Apr 22, 2026
zhangying098
pushed a commit
to zhangying098/sglang
that referenced
this pull request
Apr 23, 2026
kyx1999
pushed a commit
to KMSorSMS/sglang
that referenced
this pull request
Apr 27, 2026
empty-quiver
pushed a commit
to empty-quiver/sglang-turboquant
that referenced
this pull request
Apr 28, 2026
…graph init (sgl-project#22836) (cherry picked from commit 43925d1)
empty-quiver
pushed a commit
to empty-quiver/sglang-turboquant
that referenced
this pull request
Apr 28, 2026
…graph init (sgl-project#22836) (cherry picked from commit 43925d1)
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.
Summary
set_eagle3_layers_to_capture()andset_dflash_layers_to_capture()into a newinit_aux_hidden_state_capture()methodinit_device_graphs()inModelRunner.initialize()so CUDA graphs are captured with aux hidden state paths enabledCudaGraphRunner.__init__()and_dummy_run()Motivation
Previously
set_eagle3_layers_to_capture()was called AFTER CUDA graph capture ininitialize(), so the captured graphs ran without aux hidden state capture enabled. For Eagle3 this caused zero acceptance length at runtime. TheCudaGraphRunnerhad a workaround that calledset_eagle3_layers_to_capture()without args, which used default layer IDs instead of config-specified ones — breaking models with customeagle_aux_hidden_state_layer_ids.Test plan
eagle_aux_hidden_state_layer_idsfrom config