Skip to content

Fix MoE for llama/gpt-oss - #1557

Merged
yiliu30 merged 2 commits into
mainfrom
fix-moe
Mar 18, 2026
Merged

Fix MoE for llama/gpt-oss#1557
yiliu30 merged 2 commits into
mainfrom
fix-moe

Conversation

@yiliu30

@yiliu30 yiliu30 commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Fix #1369

Description

Please briefly describe your main changes, the motivation.

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.

Copilot AI review requested due to automatic review settings March 17, 2026 10:43
yiliu30 added 2 commits March 17, 2026 10:45
Signed-off-by: yiliu30 <yi4.liu@intel.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the sequential (per-expert) MoE forward passes for Llama-4 and GPT-OSS to skip experts that receive no tokens, reducing unnecessary expert compute during calibration/quantization flows.

Changes:

  • Update Llama-4 MoE forward to only run experts with non-zero routing mass.
  • Update GPT-OSS MoE forward to only run experts that have any tokens routed to them.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

File Description
auto_round/modeling/fused_moe/llama4.py Skips expert MLP evaluation for experts with zero routing weight.
auto_round/modeling/fused_moe/gpt_oss.py Skips expert MLP evaluation for experts with no routed tokens (but currently includes an accidental debugger breakpoint).

Comment thread auto_round/modeling/fused_moe/gpt_oss.py
@yiliu30
yiliu30 merged commit 555052e into main Mar 18, 2026
28 of 29 checks passed
@yiliu30
yiliu30 deleted the fix-moe branch March 18, 2026 03:14
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.

[Bug] several patched models active all experts in forward

4 participants