Skip to content

Improve expert parallelism placement #15517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wrmedford
Copy link
Contributor

@wrmedford wrmedford commented Mar 26, 2025

Changes two key behaviors:

  1. Changes default expert parallelism placement logic to be round robin instead of overloading the last rank.
  2. Changes expert parallelism placement logic to be group aware which should improve GPU utilization.

Copy link

👋 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 can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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.

🚀

Signed-off-by: Wes Medford <[email protected]>
@youkaichao youkaichao requested a review from tlrmchlsmth March 26, 2025 14:09
@youkaichao
Copy link
Member

@tlrmchlsmth can you help review?

Copy link
Member

@youkaichao youkaichao left a comment

Choose a reason for hiding this comment

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

why does it improve performance?

@wrmedford
Copy link
Contributor Author

why does it improve performance?

Without group aware placement, there is nothing preventing all experts from the same group existing on the same rank. Because grouped topk does a group selection before expert selection, at least with DeepSeek-V3 models no experts in 4 of 8 groups are used at all in any given expert layer. In the worst case scenario where a group is entirely on one rank and the expert TopK only selects from that single group, that could mean that only one rank can process that layer.

This removes that worst case and should also reduce waiting both with the current implementation where inactive experts are zeroed followed by an All-Reduce, as well as after DeepEP is implemented as it should result in better resource utilization.

Technically you can still get "unlucky" and have all selected experts share the same rank (which is significantly more likely with fewer GPUs), but it should be significantly less likely than in the current implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants