Skip to content

Conversation

@zhaozx-cn
Copy link
Contributor

@zhaozx-cn zhaozx-cn commented Nov 7, 2025

Purpose

When using all2all-based MoE strategy in vllm-ascend, there is no need to do all-reduce after SharedFusedMoE forward. Applying maybe_all_reduce_tensor_model_parallel could fix accuracy problem, as it did for​ other MoE models like glm4_moe and deepseek_v2.

Test Plan

No need to add new test.

Test Result

all tests should pass

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: zhaozx-cn <[email protected]>
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

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

This pull request addresses an accuracy issue in the bailing_moe model when using an all-to-all communication strategy for Mixture-of-Experts. The change replaces an unconditional tensor_model_parallel_all_reduce with a call to self.experts.maybe_all_reduce_tensor_model_parallel. This correctly delegates the decision of whether to perform an all-reduce to the MoE layer, which is aware of the communication strategy being used. This prevents an unnecessary and incorrect reduction when all-to-all is active, resolving the accuracy problem. The change is clean, targeted, and improves both correctness and design by centralizing the reduction logic. It also brings bailing_moe in line with other MoE models in the repository.

Signed-off-by: zhaozx-cn <[email protected]>
Copy link
Collaborator

@heheda12345 heheda12345 left a comment

Choose a reason for hiding this comment

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

LGTM!

@heheda12345 heheda12345 enabled auto-merge (squash) November 11, 2025 07:45
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 11, 2025
zhaozx-cn and others added 4 commits November 12, 2025 19:28
Signed-off-by: zhaozx-cn <[email protected]>
Co-authored-by: hwhaokun <[email protected]>

Signed-off-by: zhaozx-cn <[email protected]>
Signed-off-by: zhaozx-cn <[email protected]>
@heheda12345 heheda12345 merged commit 433c0f8 into vllm-project:main Nov 14, 2025
50 checks passed
geodavic pushed a commit to geodavic/vllm that referenced this pull request Nov 16, 2025
bwasti pushed a commit to bwasti/vllm that referenced this pull request Nov 17, 2025
devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
kitaekatt pushed a commit to kitaekatt/vllm that referenced this pull request Dec 1, 2025
charlotte12l pushed a commit to charlotte12l/vllm that referenced this pull request Dec 5, 2025
Zhathw pushed a commit to Zhathw/vllm that referenced this pull request Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants