-
Notifications
You must be signed in to change notification settings - Fork 622
[Bugfix]Fix eplb enable when using mtp float weights. #4576
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
offline893
wants to merge
6
commits into
vllm-project:v0.11.0-dev
Choose a base branch
from
offline893:v0.11.0-dev-1129
base: v0.11.0-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9
−4
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0ac8da4
[Bugfix]Fix eplb enable when using mtp float weights.
offline0806 08d41bc
Update vllm_ascend/ops/common_fused_moe.py
offline893 3c75770
Merge remote-tracking branch 'upstream/v0.11.0-dev' into v0.11.0-dev-…
offline0806 2c2d2d2
Merge remote-tracking branch 'upstream_gitee/v0.11.0-dev-1129' into v…
offline0806 70459b2
[CI]Fix ci.
offline0806 79f1e11
Merge remote-tracking branch 'upstream/v0.11.0-dev' into v0.11.0-dev-…
offline0806 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,11 +169,15 @@ def __init__(self, *args, **kwargs): | |
| self.expert_map_path = ascend_config.expert_map_path | ||
| self.global_redundant_expert_num = ascend_config.init_redundancy_expert | ||
| self.global_num_experts = num_experts + self.global_redundant_expert_num | ||
| # TODO: Flag for static expert placement. This is a temporary workaround | ||
| # to allow dynamic EPLB with float weights by skipping quantization checks. | ||
| self.static_eplb_enabled = False | ||
| if self.custom_routing_function is None and self.e_score_correction_bias is not None: | ||
| vllm_config = get_current_vllm_config() | ||
| self.e_score_correction_bias.data = self.e_score_correction_bias.data.to( | ||
| dtype=vllm_config.model_config.dtype) | ||
| # static eplb initializing with expert_map_path | ||
| init_eplb_enable = False | ||
| if self.expert_map_path and os.path.exists( | ||
| self.expert_map_path) and os.access(self.expert_map_path, | ||
| os.R_OK): | ||
|
|
@@ -189,6 +193,7 @@ def __init__(self, *args, **kwargs): | |
| self.moe_instance_id, self.ep_rank)) | ||
| self.log2phy = self.expert_load_balancer.get_rank_log2phy_map( | ||
| self.moe_instance_id, self.ep_rank).npu() | ||
| init_eplb_enable = True | ||
| except Exception as e: | ||
| logger.warning( | ||
| f"Init expert map of mtp/eagle when using sample.{e}") | ||
|
|
@@ -219,10 +224,10 @@ def __init__(self, *args, **kwargs): | |
| self.moe_load = torch.zeros(local_num_experts, | ||
| dtype=torch.int64).npu() | ||
|
|
||
| eplb_enable = self.dynamic_eplb or (self.expert_map_path is not None) | ||
| if eplb_enable and (not hasattr(self.quant_method, "quant_method") or | ||
| not isinstance(self.quant_method.quant_method, | ||
| AscendW8A8DynamicFusedMoEMethod)): | ||
| if init_eplb_enable and ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| not hasattr(self.quant_method, "quant_method") | ||
| or not isinstance(self.quant_method.quant_method, | ||
| AscendW8A8DynamicFusedMoEMethod)): | ||
| raise ValueError("Eplb supports only w8a8_dynamic quantization.") | ||
|
|
||
| self.moe_config.num_experts = self.global_num_experts | ||
|
|
||
Oops, something went wrong.
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.
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 be consistent with the suggested change of using an instance attribute, this should be updated to set
self.static_eplb_enabled.