Automatically configure for EPLB-related args (#6628)

This commit is contained in:
fzyzcjy
2025-05-26 23:42:49 +08:00
committed by GitHub
parent 14d1075f2c
commit fe386acae6

View File

@@ -366,12 +366,28 @@ class ServerArgs:
"Pipeline parallelism is incompatible with overlap schedule."
)
if self.enable_eplb and (self.expert_distribution_recorder_mode is None):
self.expert_distribution_recorder_mode = "stat"
logger.info(
f"EPLB is enabled. The expert_distribution_recorder_mode is automatically set."
)
if (self.enable_eplb or (self.init_expert_location is not None)) and (
self.ep_dispatch_algorithm is None
):
self.ep_dispatch_algorithm = "static"
logger.info(
f"EPLB is enabled or init_expert_location is provided. ep_dispatch_algorithm is configured."
)
if self.enable_expert_distribution_metrics and (
self.expert_distribution_recorder_mode is None
):
self.expert_distribution_recorder_mode = "stat"
if self.expert_distribution_recorder_buffer_size is None:
# TODO pr-chain: enable this later
# if (x := self.eplb_rebalance_num_iterations) is not None:
# self.expert_distribution_recorder_buffer_size = x
if False:
pass
if (x := self.eplb_rebalance_num_iterations) is not None:
self.expert_distribution_recorder_buffer_size = x
elif self.expert_distribution_recorder_mode is not None:
self.expert_distribution_recorder_buffer_size = 1000