Skip to content

[Fix] Fix EAGLE3 layer capture for Qwen3.5-VL/MoE - #25408

Closed
jiahang01 wants to merge 9 commits into
sgl-project:mainfrom
jiahang01:main
Closed

jiahang01 wants to merge 9 commits into
sgl-project:mainfrom
jiahang01:main

Conversation

@jiahang01

@jiahang01 jiahang01 commented May 15, 2026 •

Copy link
Copy Markdown

Motivation

Qwen3.5 VL/MoE with EAGLE3 requires auxiliary hidden states from selected target model layers. The wrapper calls set_eagle3_layers_to_capture, but Qwen3.5 only assigned layers_to_capture without marking the actual decoder layers with _is_layer_to_capture.

As a result, aux hidden states were not captured correctly and EAGLE3 execution could fail when starting Qwen3.5 MoE models.

Modifications

  • Add set_eagle3_layers_to_capture to Qwen3_5ForCausalLM.
  • Mark selected layers with _is_layer_to_capture, matching the existing DFLASH capture path.
  • Update Qwen3VLForConditionalGeneration.set_eagle3_layers_to_capture to call the language model capture method when available, instead of only assigning layers_to_capture.

Accuracy Tests

Manually verified that Qwen3.5 MoE with EAGLE3 can start and run with this patch.

The EAGLE3 draft model used for validation is publicly available at:
https://huggingface.co/AQ-MedAI/Qwen3.5-397B-A17B-eagle3

python -m py_compile python/sglang/srt/models/qwen3_5.py python/sglang/srt/models/qwen3_vl.py
git diff --check

Speed Tests and Profiling

Not applicable. This change only fixes layer capture setup for EAGLE3 auxiliary hidden states and does not change kernels or inference computation paths outside the capture configuration.

Checklist

Add set_eagle3_layers_to_capture method to Qwen3_5ForCausalLM so that the _is_layer_to_capture attribute is correctly set on captured layers when called from Qwen3VLForConditionalGeneration, instead of only assigning the list without marking the layers.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@jiahang01

Copy link
Copy Markdown
Author

Motivation

When running Qwen3.5 MoE with EAGLE3 using the latest SGLang code, server startup fails because the target model does not correctly expose the EAGLE3 layer-capture setup path.

The observed error is:

AttributeError: 'Qwen3_5MoeForConditionalGeneration' object has no attribute 'set_eagle3_layers_to_capture'

Qwen3.5 MoE + EAGLE3 needs to capture auxiliary hidden states from selected target-model layers. Without properly setting the captured layers, the EAGLE3 draft-and-verify path cannot be initialized correctly.

This PR fixes the layer-capture setup for Qwen3.5 by ensuring that captured layers are marked with _is_layer_to_capture instead of only assigning the layers_to_capture list.

With this fix, Qwen3.5 MoE + EAGLE3 can successfully start the SGLang server and run inference.

The public EAGLE3 draft model used for validation is available at:

https://huggingface.co/AQ-MedAI/Qwen3.5-397B-A17B-eagle3

@github-actions
github-actions Bot requested a review from sogalin as a code owner June 15, 2026 17:09
@github-actions

Copy link
Copy Markdown
Contributor

Thanks @jiahang01. Closing this because it has had no updates in 91 days.

Reopen it if the work is still relevant.

Some directories moved recently, so an older branch may need retargeting:
sgl-kernel/ -> python/sglang/kernels/aot/, python/sglang/jit_kernel/
-> python/sglang/kernels/jit/, docs/ -> docs/docs/ (.mdx),
bench_serving.py -> benchmark/serving.py, test/srt/ -> test/registered/.

@github-actions github-actions Bot closed this Sep 18, 2026
cih9088 added a commit to cih9088/SpecForge that referenced this pull request Sep 28, 2026
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.

1 participant