Skip to content

[MoE] Validate grouped AutoEP top-k routing - #8630

Merged
tohtana merged 3 commits into
deepspeedai:masterfrom
Silas-Zeng:fix/autoep-grouped-topk-validation
Nov 26, 2026
Merged

tohtana merged 3 commits into
deepspeedai:masterfrom
Silas-Zeng:fix/autoep-grouped-topk-validation

Conversation

@Silas-Zeng

@Silas-Zeng Silas-Zeng commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Grouped AutoEP masks experts outside the selected groups before topk. When top_k exceeds the available experts, torch.topk fills the remaining slots with masked -inf entries and can produce routes outside the configured groups.

Change

Reject the invalid configuration before router construction and during post-detection validation. Update the native MoE k documentation to match its arbitrary top-k implementation.

Validation

  • flake8 on changed files.
  • yapf --diff on changed files.
  • git diff --check.
  • Python compileall on changed files.
  • Runtime tests were not run.

Signed-off-by: HR-zengzzz <hrzeng123456@gmail.com>
@Silas-Zeng

Copy link
Copy Markdown
Contributor Author

Hi @tjruwase @hwchen2017 @tohtana @loadams, could one of you take a look at this PR? It adds early validation to prevent grouped AutoEP routing from selecting masked-out experts when top_k exceeds the number of experts available in the selected groups. Regression tests are included for both the router constructor and post-detection validation. I’d appreciate your feedback. Thanks!

@auto-pr-labeler-with-jev auto-pr-labeler-with-jev Bot added the skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. label Nov 14, 2026

@tohtana tohtana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @Silas-Zeng, and sorry for the delay. This looks good to me.

@tohtana
tohtana enabled auto-merge November 25, 2026 00:00
@auto-pr-labeler-with-jev auto-pr-labeler-with-jev Bot added skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. and removed skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. labels Nov 26, 2026
@tohtana
tohtana added this pull request to the merge queue Nov 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2026
@tohtana
tohtana added this pull request to the merge queue Nov 26, 2026
Merged via the queue into deepspeedai:master with commit bef80db Nov 26, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants