[Feature] Add External LB Mode Support for Elastic EP Scaling (#43202)
Signed-off-by: lqh-hh <liuqihang6@huawei.com> Signed-off-by: Tyler Michael Smith <tlrmchlsmth@gmail.com> Co-authored-by: lqh-hh <liuqihang6@huawei.com> Co-authored-by: Tyler Michael Smith <tlrmchlsmth@gmail.com> Co-authored-by: OpenAI Codex <codex@openai.com> Co-authored-by: 2017403603 <705328646@qq.com> Co-authored-by: Julien Mancuso <jmancuso@nvidia.com> Co-authored-by: Itay Alroy <75032521+itayalroy@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
lqh-hh
Tyler Michael Smith
OpenAI Codex
2017403603
Julien Mancuso
Itay Alroy
Codex
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
fb3fec970e
commit
dd9e07a25f
@@ -11,6 +11,9 @@ from vllm.config import ParallelConfig
|
||||
from vllm.distributed import (
|
||||
stateless_destroy_torch_distributed_process_group,
|
||||
)
|
||||
from vllm.distributed.elastic_ep.external_elastic_ep import (
|
||||
ExternalElasticEPScaleCoordinator,
|
||||
)
|
||||
from vllm.distributed.utils import get_cached_tcp_store_client
|
||||
from vllm.logger import init_logger
|
||||
from vllm.v1.engine import (
|
||||
@@ -256,10 +259,23 @@ class ElasticEPScalingState:
|
||||
if state == ScaleDownRemovingEngineState.PREPARE:
|
||||
assert self.old_dp_group.rank() > 0
|
||||
self._commit_scale_down(removing=True)
|
||||
self.state = ScaleDownRemovingEngineState.COMPLETE
|
||||
external_lb = self.vllm_config.parallel_config.data_parallel_external_lb
|
||||
if external_lb:
|
||||
# Preserve completion delivery: client cleanup on exit must not
|
||||
# cancel the receiver before it records the notification.
|
||||
parallel_config = self.new_parallel_config
|
||||
store = get_cached_tcp_store_client(
|
||||
parallel_config.data_parallel_master_ip,
|
||||
parallel_config._coord_store_port,
|
||||
)
|
||||
key = ExternalElasticEPScaleCoordinator.key
|
||||
epoch = store.get(key("current_epoch")).decode()
|
||||
self.engine_core._eep_send_engine_core_notification(
|
||||
EEPNotificationType.SHUTDOWN_COMPLETE
|
||||
)
|
||||
if external_lb:
|
||||
store.wait([key(epoch, "shutdown_complete", self.engine_core.dp_rank)])
|
||||
self.state = ScaleDownRemovingEngineState.COMPLETE
|
||||
return True
|
||||
|
||||
else:
|
||||
@@ -384,7 +400,10 @@ class ElasticEPScalingState:
|
||||
|
||||
def _send_reconfigure_finished(self):
|
||||
assert self.new_dp_group is not None
|
||||
if self.new_dp_group.rank() == 0:
|
||||
if (
|
||||
self.new_dp_group.rank() == 0
|
||||
or self.vllm_config.parallel_config.data_parallel_external_lb
|
||||
):
|
||||
self.engine_core._eep_send_engine_core_notification(
|
||||
EEPNotificationType.RECONFIGURE_FINISHED
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user