Repository navigation
[Bugfix] mtp forces eager mode - #6760
Conversation
Signed-off-by: zhenwenqi2024 <zhenwenqi_2022@qq.com>
Summary of ChangesHello @zhenwenqi2024, 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 bug within the 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 disables CUDA graph for MTP speculative decoding. This is a valid bugfix that forces MTP to run in eager mode, addressing potential issues with graph mode. However, this change introduces a significant amount of now-unreachable code related to graph mode in vllm_ascend/spec_decode/mtp_proposer.py. This dead code should be removed in a follow-up pull request to improve maintainability.
Additionally, the pull request title and description do not follow the repository's style guide. Here are the suggested updates:
Suggested PR Title:
[SpecDecode][BugFix] Force eager mode for MTPSuggested PR Summary:
### What this PR does / why we need it?
This PR fixes a bug where MTP (Multi-Token Prediction) speculative decoding was not correctly forced into eager mode, leading to issues when CUDA graph was enabled.
The change disables CUDA graph (`use_cuda_graph = False`) for the MTP method unconditionally within `EagleProposer`. Previously, it was only disabled when asynchronous scheduling was active. This ensures MTP always runs in eager mode, preventing potential correctness or performance issues with graph mode.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
CI passed. The correctness of MTP is validated by existing tests, such as `test_deepseek_mtp_correctness`, which will now run in eager mode for MTP as intended by this fix.| and not self.vllm_config.speculative_config.enforce_eager) | ||
| if self.method == "mtp": | ||
| self.use_cuda_graph = self.use_cuda_graph and not self.use_async_scheduling | ||
| self.use_cuda_graph = False |
There was a problem hiding this comment.
By setting use_cuda_graph to False for MTP, a significant amount of code in the MtpProposer class (in vllm_ascend/spec_decode/mtp_proposer.py) becomes dead code. Specifically, all logic conditioned on aclgraph_runtime_mode == CUDAGraphMode.FULL or forward_context.cudagraph_runtime_mode == CUDAGraphMode.FULL is now unreachable.
To improve code maintainability, this dead code should be removed. Please consider creating a follow-up PR to refactor MtpProposer and clean up the now-unnecessary graph-related logic.
|
/ready |
What this PR does / why we need it?
in mtp_proposer, we set self.use_cuda_graph false in mtp, becasuse async_scheduler is set true in default, mtp dose not need aclgraph. otherwise, in piecewise ,mtp need aclgraph too, it will change some unexpected errors.
Does this PR introduce any user-facing change?
NA
How was this patch tested?