Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions vllm_ascend/ascend_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def __init__(self, vllm_config: "VllmConfig"):
self.gate_eplb = additional_config.get("gate_eplb", False)
self.num_wait_worker_iterations = additional_config.get(
"num_wait_worker_iterations", 30)
eplb_config = additional_config.get("eplb_config", {})
self.refresh_eplb_config(eplb_config)
Comment thread
shenchuxiaofugui marked this conversation as resolved.

self.enable_shared_expert_dp = additional_config.get(
"enable_shared_expert_dp",
False) and vllm_config.parallel_config.enable_expert_parallel
Expand Down Expand Up @@ -147,6 +150,19 @@ def __init__(self, vllm_config: "VllmConfig"):
"enable_kv_nz is only supported in pd scenario and can "
"only be used in D node.")

def refresh_eplb_config(self, config):
self.expert_map_path = config.get("expert_map_path", None)
self.eplb_policy_type = config.get("eplb_policy_type", 1)
self.expert_map_record_path = config.get(
"expert_map_record_path",
None) # Provide path to export expert map
self.init_redundancy_expert = config.get("num_redundant_experts", 0)
self.dynamic_eplb = config.get("dynamic_eplb", False)
self.num_iterations_eplb_update = config.get(
"expert_heat_collection_interval", 4000)
self.num_wait_worker_iterations = config.get(
"algorithm_execution_interval", 150)
Comment on lines +159 to +164
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

There's an inconsistency between the class attribute names and the new configuration keys they are populated from. For instance, self.num_iterations_eplb_update is populated from the key expert_heat_collection_interval. This mismatch makes the code difficult to understand and maintain. To improve clarity, the class attributes should be renamed to match the new configuration keys. While this requires updating usages elsewhere, it's a crucial step for long-term code health.

I suggest the following renames:

  • self.init_redundancy_expert -> self.num_redundant_experts
  • self.num_iterations_eplb_update -> self.expert_heat_collection_interval
  • self.num_wait_worker_iterations -> self.algorithm_execution_interval
Suggested change
self.init_redundancy_expert = config.get("num_redundant_experts", 0)
self.dynamic_eplb = config.get("dynamic_eplb", False)
self.num_iterations_eplb_update = config.get(
"expert_heat_collection_interval", 4000)
self.num_wait_worker_iterations = config.get(
"algorithm_execution_interval", 150)
self.num_redundant_experts = config.get("num_redundant_experts", 0)
self.dynamic_eplb = config.get("dynamic_eplb", False)
self.expert_heat_collection_interval = config.get(
"expert_heat_collection_interval", 4000)
self.algorithm_execution_interval = config.get(
"algorithm_execution_interval", 150)



class FinegrainedTPConfig:
"""
Expand Down
Loading