Skip to content

[v0.18.0] Apply Eagle3 to MiniMax-M2.5 (#7619)#7714

Merged
MengqingCao merged 1 commit intovllm-project:releases/v0.18.0from
SparrowMu:releases/v0.18.0
Mar 27, 2026
Merged

[v0.18.0] Apply Eagle3 to MiniMax-M2.5 (#7619)#7714
MengqingCao merged 1 commit intovllm-project:releases/v0.18.0from
SparrowMu:releases/v0.18.0

Conversation

@SparrowMu
Copy link
Contributor

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?

### 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>
@SparrowMu SparrowMu requested a review from wangxiyuan as a code owner March 27, 2026 03:16
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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

  • Speculative Decoding Support: Enabled Eagle3 speculative decoding for MiniMax-M2.5 models by monkey-patching the configuration validation whitelist and registering the necessary model aliases.
  • Model Forward Pass Modification: Extended the MiniMaxM2Model forward pass to support the collection and return of auxiliary hidden states required by the Eagle3 speculative decoding mechanism.
  • Interface Injection: Injected required Eagle3 interface methods and attributes into MiniMaxM2ForCausalLM to allow vLLM to correctly configure and utilize the model for speculative decoding.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Suggested PR Title:

[Attention][Feature] Support Eagle3 speculative decoding for MiniMax-M2 on NPU

Suggested 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.

Comment on lines +195 to +203
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
Copy link
Contributor

Choose a reason for hiding this comment

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

high

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.

Suggested change
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

@yiz-liu yiz-liu added this to the v0.18.0rc1 milestone Mar 27, 2026
@yiz-liu yiz-liu changed the title Apply Eagle3 to MiniMax-M2.5 (#7619) [v0.18.0] Apply Eagle3 to MiniMax-M2.5 (#7619) Mar 27, 2026
@yiz-liu yiz-liu added ready read for review ready-for-test start test by label for PR and removed ready-for-test start test by label for PR labels Mar 27, 2026
@MengqingCao MengqingCao merged commit 6fbd004 into vllm-project:releases/v0.18.0 Mar 27, 2026
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready read for review ready-for-test start test by label for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants