Skip to content

Commit c66e4ce

Browse files
simplify eplb policy
1 parent cc35a75 commit c66e4ce

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

vllm_ascend/eplb/core/policy/policy_factory.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@ def generate_policy(policy_type: int, config: DynamicConfig) -> EplbPolicy:
1313
# Constraint applying Dynamic EPLB policy V2:
1414
# If there exists redundant expert:
1515
# only one redundant expert can be placed in one NPU and its physical expert index must be 0
16-
17-
# Applying bipartite d2d expert weight update composing
18-
0:MockLoadBalance, # MockLoadBalance
19-
1:DynamicEplb, # Dynamic EPLB policy
20-
2:DynamicEplbV2, # Dynamic EPLB policy V2
2116

2217
# Applying greedy d2d expert weight update composing
23-
3:MockLoadBalance, # MockLoadBalance
24-
4:DynamicEplb, # Dynamic EPLB policy
25-
5:DynamicEplbV2, # Dynamic EPLB policy V2
18+
0:MockLoadBalance, # MockLoadBalance: shuffle last physical expert on NPU 1 and 3
19+
1:DynamicEplb, # Dynamic EPLB policy: overall expert replacement based on current moe load
20+
2:DynamicEplbV2, # Dynamic EPLB policy V2: expert replacement with constrained number of expert shuffle
2621
}
2722
return policy.get(policy_type, MockLoadBalance)(config)

vllm_ascend/eplb/core/worker/eplb_worker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ def do_update(self):
7171
self.update_expert_map(new_expert_maps)
7272
logger.debug(f"[EPLB Process new_map differs, performing D2D")
7373

74-
update_info = self.compose_expert_update_info_bipartite(new_expert_maps, self.old_expert_maps)\
75-
if self.policy_type <= 2 else self.compose_expert_update_info_greedy(new_expert_maps, self.old_expert_maps)
74+
update_info = self.compose_expert_update_info_greedy(new_expert_maps, self.old_expert_maps)
7675
self.old_expert_maps = new_expert_maps
7776
logger.info("EPLB Process compute complete")
7877

0 commit comments

Comments
 (0)