[v0.18.0] Apply Eagle3 to MiniMax-M2.5 (#7619)#7714
[v0.18.0] Apply Eagle3 to MiniMax-M2.5 (#7619)#7714MengqingCao merged 1 commit intovllm-project:releases/v0.18.0from
Conversation
### What this PR does / why we need it? Apply Eagle3 to MiniMax-M2.5 to increase model performance This will be discard after Eagle3 weight for MiniMax-M2.5 releases and code change accepted by official repo https://github.com/vllm-project/vllm/pull/37512/changes ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.18.0 - vLLM main: vllm-project/vllm@ed359c4 --------- Signed-off-by: limuyuan <limuyuan3@huawei.com> Co-authored-by: limuyuan <limuyuan3@huawei.com>
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 introduces support for Eagle3 speculative decoding on MiniMax-M2.5 models within the vLLM Ascend environment. By patching core configuration validators and extending the model's forward pass and interface, the changes allow the model to emit the auxiliary hidden states necessary for speculative decoding. These modifications are intended as a temporary measure until official upstream support for MiniMax-M2.5 is integrated into the main vLLM repository. 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. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
Suggested PR Title:
[Attention][Feature] Support Eagle3 speculative decoding for MiniMax-M2 on NPUSuggested PR Summary:
### What this PR does / why we need it?
This PR enables Eagle3 speculative decoding for MiniMax-M2 models on NPU by implementing several monkey-patches. It bypasses the `SpeculativeConfig` model type whitelist, registers the `Eagle3MiniMaxM2ForCausalLM` architecture alias, and extends the `MiniMaxM2Model` forward pass to support auxiliary hidden state collection. Additionally, it implements the `SupportsEagle3` protocol for `MiniMaxM2ForCausalLM`. Feedback was provided to improve the robustness of the exception handling in the configuration patch to avoid reliance on specific upstream error strings.
### Does this PR introduce _any_ user-facing change?
Yes, users can now use Eagle3 speculative decoding with MiniMax-M2 models on NPU platforms.
### How was this patch tested?
CI passed with existing tests; manual verification of speculative decoding functionality is recommended.| msg = str(e).lower() | ||
| if "only supported for" in msg and "models" in msg: | ||
| # Upstream `_verify_args` calls `verify_equal_vocab_size_if_draft_model` after | ||
| # the aux-hidden allowlist; returning here would skip it. | ||
| verify_vocab = getattr(self, "verify_equal_vocab_size_if_draft_model", None) | ||
| if callable(verify_vocab): | ||
| verify_vocab() | ||
| return self | ||
| raise |
There was a problem hiding this comment.
Relying on string matching of an exception message is brittle and can break if the upstream error message changes. This could lead to silent failures of this patch. It's better to extract the condition into a clearly named variable and add a comment to highlight the fragility.
| msg = str(e).lower() | |
| if "only supported for" in msg and "models" in msg: | |
| # Upstream `_verify_args` calls `verify_equal_vocab_size_if_draft_model` after | |
| # the aux-hidden allowlist; returning here would skip it. | |
| verify_vocab = getattr(self, "verify_equal_vocab_size_if_draft_model", None) | |
| if callable(verify_vocab): | |
| verify_vocab() | |
| return self | |
| raise | |
| msg = str(e).lower() | |
| # This check is brittle as it relies on the upstream error message. | |
| is_whitelist_error = "only supported for" in msg and "models" in msg | |
| if is_whitelist_error: | |
| # Upstream `_verify_args` calls `verify_equal_vocab_size_if_draft_model` after | |
| # the aux-hidden allowlist; returning here would skip it. | |
| verify_vocab = getattr(self, "verify_equal_vocab_size_if_draft_model", None) | |
| if callable(verify_vocab): | |
| verify_vocab() | |
| return self | |
| raise |
6fbd004
into
vllm-project:releases/v0.18.0
What this PR does / why we need it?
Apply Eagle3 to MiniMax-M2.5 to increase model performance This will be discard after Eagle3 weight for MiniMax-M2.5 releases and code change accepted by official repo
https://github.com/vllm-project/vllm/pull/37512/changes
Does this PR introduce any user-facing change?
How was this patch tested?
What this PR does / why we need it?
Does this PR introduce any user-facing change?
How was this patch tested?