Skip to content

[Bugfix] Fix potential EAGLE spec decode segfault during graph capture#32818

Merged
LucasWilkinson merged 1 commit intovllm-project:mainfrom
ROCm:fix_spec_decode_CAR
Jan 22, 2026
Merged

[Bugfix] Fix potential EAGLE spec decode segfault during graph capture#32818
LucasWilkinson merged 1 commit intovllm-project:mainfrom
ROCm:fix_spec_decode_CAR

Conversation

@mawong-amd
Copy link
Contributor

@mawong-amd mawong-amd commented Jan 22, 2026

Purpose

This PR restores the original logic in SpecDecodeBaseProposer's dummy_run function, which was changed after the refactor in #30143. Credits also to @micah-wil for the investigation and fix.

After the refactor, the use_cudagraphs parameter is left unused which incorrectly leads to CUDA graph dispatch where they previously would not have occurred. We are seeing this manifest on MI300X as a segfault during CUDA graph capture with EAGLE spec decode on TP > 1, e.g. by running
vllm serve meta-llama/Llama-3.1-8B-Instruct --max-model-len 2048 -tp 2 --max-num-batched-tokens 2048 --speculative-config='{"method": "eagle", "model": "yuhuili/EAGLE-LLaMA3.1-Instruct-8B", "num_speculative_tokens": 3, "max_model_len": 2048}'
or
vllm serve meta-llama/Llama-4-Scout-17B-16E-Instruct --max-model-len 2048 -tp 2 --max-num-batched-tokens 2048 --speculative-config='{"method": "eagle", "model": "morgendave/EAGLE-Llama-4-Scout-17B-16E-Instruct", "num_speculative_tokens": 3, "max_model_len": 2048}' --load-format dummy --max-num-seqs 1 --compilation-config='{"cudagraph_capture_sizes": [1]}'

This is also leading to failures inside tests like tests/v1/e2e/test_spec_decode.py::test_eagle_correctness.

Test Plan

pytest -sv tests/v1/e2e/test_spec_decode.py -k test_eagle_correctness

Test Result

The test above should pass.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a bug in SpecDecodeBaseProposer.dummy_run where the use_cudagraphs parameter was being ignored, leading to unconditional CUDA graph dispatch and potential segmentation faults. The change correctly restores the intended logic by wrapping the cudagraph_dispatcher.dispatch call in a conditional block that respects the use_cudagraphs flag. When use_cudagraphs is false, it now correctly sets cudagraph_runtime_mode to CUDAGraphMode.NONE. The fix is correct, well-contained, and directly addresses the described bug. The code is clear and I have no further suggestions.

Copy link
Collaborator

@LucasWilkinson LucasWilkinson left a comment

Choose a reason for hiding this comment

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

LGTM thanks for the fix!

@LucasWilkinson LucasWilkinson enabled auto-merge (squash) January 22, 2026 00:13
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jan 22, 2026
@LucasWilkinson LucasWilkinson merged commit c5487e2 into vllm-project:main Jan 22, 2026
52 of 54 checks passed
@mawong-amd mawong-amd deleted the fix_spec_decode_CAR branch January 22, 2026 03:12
monajafi-amd pushed a commit to monajafi-amd/vllm that referenced this pull request Jan 23, 2026
vllm-project#32818)

Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
Signed-off-by: mohammad najafi <mohammad.najafi@amd.com>
cwazai pushed a commit to cwazai/vllm that referenced this pull request Jan 25, 2026
vllm-project#32818)

Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
Signed-off-by: 陈建华 <1647430658@qq.com>
lapy pushed a commit to lapy/vllm that referenced this pull request Jan 27, 2026
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready ONLY add when PR is ready to merge/full CI is needed speculative-decoding v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants