Skip to content

[BUG] update moe check logic and make .gate ignore general#1517

Merged
xin3he merged 2 commits intomainfrom
xinhe/3-9a
Mar 9, 2026
Merged

[BUG] update moe check logic and make .gate ignore general#1517
xin3he merged 2 commits intomainfrom
xinhe/3-9a

Conversation

@xin3he
Copy link
Copy Markdown
Contributor

@xin3he xin3he commented Mar 9, 2026

Description

Current function has bug, cannot detect moe correctly.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Other (please specify):

Related Issues

Fixes or relates to #

Checklist Before Submitting

  • My code has been tested locally.
  • Documentation has been updated as needed.
  • New or updated tests are included where applicable.

Signed-off-by: Xin He <xin3.he@intel.com>
@xin3he xin3he requested review from a32543254, Copilot, wenhuach21 and yiliu30 and removed request for Copilot March 9, 2026 03:51
Copilot AI review requested due to automatic review settings March 9, 2026 03:52
@xin3he xin3he review requested due to automatic review settings March 9, 2026 03:52
Copilot AI review requested due to automatic review settings March 9, 2026 05:06
@wenhuach21 wenhuach21 self-requested a review March 9, 2026 05:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_config to 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 .gate for 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.

@xin3he xin3he merged commit 2eaa3b1 into main Mar 9, 2026
29 checks passed
@xin3he xin3he deleted the xinhe/3-9a branch March 9, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants