[Qwen3.5 bugfix] Add mm_input_embeds in piecewise cuda graph replay#20448
[Qwen3.5 bugfix] Add mm_input_embeds in piecewise cuda graph replay#20448Chen-0210 wants to merge 5 commits intosgl-project:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a specific issue in the Qwen3.5 model's execution pipeline, where a combination of performance optimizations (piecewise CUDA graphs and MTP) caused a failure due to improper handling of multimodal input embeddings. The fix ensures that these embeddings are correctly propagated through the system during graph replay, thereby restoring the stability and functionality of Qwen3.5 under these optimized conditions. This change is crucial for maintaining the model's performance and multimodal capabilities when advanced execution strategies are employed. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses a bug that occurs when using piecewise CUDA graph with multi-turn prefill (MTP) for Qwen3.5 models. The issue stems from mm_input_embeds not being propagated correctly during CUDA graph replay, leading to an assertion failure. The fix involves adding mm_input_embeds to the LogitsProcessorOutput in the replay method of PiecewiseCudaGraphRunner, ensuring multimodal embeddings are available in subsequent steps. The change is consistent with how other output tensors like hidden_states are handled and appears to be a correct and necessary fix.
|
/tag-run-ci-label |
|
/tag-run-ci-label |
1 similar comment
|
/tag-run-ci-label |
|
/rerun-failed-ci |
1 similar comment
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
This patch fixed crash during warmup, but multimodal inference still triggers runtime recompilation. Runtime recompilation appears to be triggered when multiple images are present across multiple input rounds. |
It works after applying #16785 |
|
/rerun-failed-ci |
2 similar comments
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
/rerun-failed-ci |
Motivation
There is a bug when piecewise CUDA graph and mtp are enabled together when serving Qwen3.5.
Modifications
Add
mm_input_embedsinLogitsProcessorOutput, so theforward_draft_extendpath can receive the multimodal embeddings.Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci