feat: support EPLB for DeepSeek-V3.2 Python model executor. - #2283
Draft
yingxudeng wants to merge 1 commit into
Draft
feat: support EPLB for DeepSeek-V3.2 Python model executor.#2283yingxudeng wants to merge 1 commit into
yingxudeng wants to merge 1 commit into
Conversation
Add Expert Parallel Load Balancing (EPLB) support to the Python MoE path. The implementation uses slot-reuse mode where device_experts_num stays at num_local_experts to avoid exceeding the NPU fused GMM kernel groupList length limit. EPLB replaces cold expert weights in-place within fixed slots rather than allocating additional redundant slots. Key changes: - New xllm/python/layers/eplb.py with helper functions ported from C++ - PyCausalLM bridges prepare/start_transfer/update/last_ok to Python - DeepseekV3MoE: log2phy_map remap in forward, dynamic lifecycle - grouped_moe kernel: log2phy_map parameter for expert id remapping Verified EP=2 (redundant=0) and EP=4 (redundant=1) outputs match baseline (EPLB off) token-for-token on 6-layer w8a8 model.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Expert Parallel Load Balancing (EPLB) support to the Python MoE path. The implementation uses slot-reuse mode where device_experts_num stays at num_local_experts to avoid exceeding the NPU fused GMM kernel groupList length limit. EPLB replaces cold expert weights in-place within fixed slots rather than allocating additional redundant slots.
Key changes:
Verified EP=2 (redundant=0) and EP=4 (redundant=1) outputs match baseline (EPLB off) token-for-token on 6-layer w8a8 model.
Description
Related Issues
Change Type
Pull Request Checklist
Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.
PR Title and Commit Messages
<type>: <subject>.Pre-commit Checks
pre-commitby runningpip install pre-commitor an equivalent command.pre-commit install.pre-commit run --all-filesand fixed any reported issues.Self Review
.agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.mainbranch.Build and Test Coverage
python setup.py build testhas passed on a CUDA machine.python setup.py build testhas passed on an NPU machine.python setup.py build testhas passed on an MLU machine.Reviewer Notes