-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
[Feature][EPLB] Add eplb support for Qwen2 #21035
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: rongfu.leng <[email protected]>
There was a problem hiding this 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 adds support for Expert Parallelism Load Balancing (EPLB) to the Qwen2 MoE model. The changes are mostly confined to vllm/model_executor/models/qwen2_moe.py
and involve adding EPLB-related configurations, implementing the MixtureOfExperts
interface, and updating the weight loading logic to handle expert replicas. The implementation appears to be heavily inspired by the existing deepseek_v2
model, which is a reasonable approach. I've identified one high-severity issue related to an import that creates an unnecessary dependency, which should be addressed to improve code maintainability.
@@ -50,6 +52,7 @@ | |||
from vllm.model_executor.layers.vocab_parallel_embedding import ( | |||
ParallelLMHead, VocabParallelEmbedding) | |||
from vllm.model_executor.model_loader.weight_utils import default_weight_loader | |||
from vllm.model_executor.models.deepseek_v2 import MixtureOfExperts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve modularity and reduce coupling between different model implementations, MixtureOfExperts
should be imported directly from its definition file. It is defined as a protocol in vllm.model_executor.models.interfaces
. Importing from another model's implementation file (deepseek_v2
) creates an unnecessary dependency.
from vllm.model_executor.models.deepseek_v2 import MixtureOfExperts | |
from vllm.model_executor.models.interfaces import MixtureOfExperts |
👋 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 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 🚀 |
This pull request has merge conflicts that must be resolved before it can be |
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.Purpose
Test Plan
Test Result
(Optional) Documentation Update