[BUG] update moe check logic and make .gate ignore general#1517
Merged
Conversation
Signed-off-by: Xin He <xin3.he@intel.com>
wenhuach21
reviewed
Mar 9, 2026
wenhuach21
reviewed
Mar 9, 2026
for more information, see https://pre-commit.ci
wenhuach21
approved these changes
Mar 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes MoE-model detection and broadens the “ignore gate layers” behavior to work across more MoE model variants, reducing reliance on hardcoded per-model rules.
Changes:
- Update
is_moe_model_via_configto detect MoE-related configs by scanning the string form of the config. - Remove the MiniMax M2-specific ignore-layer rule and instead add a generic mechanism to ignore all modules ending with
.gatefor MoE configs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
auto_round/utils/model.py |
Changes MoE detection heuristic used by other components to decide MoE-specific behaviors. |
auto_round/special_model_handler.py |
Replaces a model-specific ignore rule with generic “discover .gate modules and ignore them” logic. |
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Current function has bug, cannot detect moe correctly.
Type of Change
Related Issues
Fixes or relates to #
Checklist Before Submitting