Skip to content

Commit 73acdcf

Browse files
authored
[PD] Correct the ip and port env (#2450)
1. rename `VLLM_LLMDD_RPC_PORT` to `VLLM_ASCEND_LLMDD_RPC_PORT` to make the prefix the same in vllm-ascend 2. enable `VLLM_ASCEND_LLMDD_RPC_IP` env for PD feature. Signed-off-by: wangxiyuan <[email protected]>
1 parent 7bec1a9 commit 73acdcf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

vllm_ascend/distributed/llmdatadist_c_mgr_connector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def __init__(self, vllm_config: VllmConfig, engine_id: Optional[str]):
181181
dp_rank_local = self.vllm_config.parallel_config.data_parallel_rank_local
182182
tp_size = self.vllm_config.parallel_config.tensor_parallel_size
183183

184-
self.port = dp_rank_local * tp_size + envs_ascend.VLLM_LLMDD_RPC_PORT if dp_rank_local is not None else tp_size + envs_ascend.VLLM_LLMDD_RPC_PORT
184+
self.port = dp_rank_local * tp_size + envs_ascend.VLLM_ASCEND_LLMDD_RPC_PORT if dp_rank_local is not None else tp_size + envs_ascend.VLLM_ASCEND_LLMDD_RPC_PORT
185185

186186
self._reqs_need_recv: dict[str, tuple[Request, list[int]]] = {}
187187

@@ -344,8 +344,8 @@ def __init__(self, vllm_config: VllmConfig):
344344

345345
def listen_for_agent_metadata_req(self, event: threading.Event):
346346
assert self.local_agent_metadata is not None
347-
port = envs_ascend.VLLM_LLMDD_RPC_PORT + self.local_dp_rank * self.tp_size + self.tp_rank if self.local_dp_rank is not None else envs_ascend.VLLM_LLMDD_RPC_PORT + self.tp_size + self.tp_rank
348-
url = f"tcp://0.0.0.0:{port}"
347+
port = envs_ascend.VLLM_ASCEND_LLMDD_RPC_PORT + self.local_dp_rank * self.tp_size + self.tp_rank if self.local_dp_rank is not None else envs_ascend.VLLM_ASCEND_LLMDD_RPC_PORT + self.tp_size + self.tp_rank
348+
url = f"tcp://{envs_ascend.VLLM_ASCEND_LLMDD_RPC_IP}:{port}"
349349
msg_encoder = msgspec.msgpack.Encoder()
350350
msg_decoder = msgspec.msgpack.Decoder()
351351
msg_to_send = msg_encoder.encode(self.local_agent_metadata)

vllm_ascend/envs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@
123123
# remote worker.
124124
"VLLM_ASCEND_LLMDD_RPC_IP":
125125
lambda: os.getenv("VLLM_ASCEND_LLMDD_RPC_IP", "0.0.0.0"),
126-
# `LLMDataDistCMgrConnector` required variable. `VLLM_LLMDD_RPC_PORT` is used as the
126+
# `LLMDataDistCMgrConnector` required variable. `VLLM_ASCEND_LLMDD_RPC_PORT` is used as the
127127
# rpc communication listening port, which will be used to receive the agent metadata from the
128128
# remote worker.
129-
"VLLM_LLMDD_RPC_PORT":
130-
lambda: int(os.getenv("VLLM_LLMDD_RPC_PORT", 5557)),
129+
"VLLM_ASCEND_LLMDD_RPC_PORT":
130+
lambda: int(os.getenv("VLLM_ASCEND_LLMDD_RPC_PORT", 5557)),
131131
# Whether to enable mla_pa for deepseek mla decode, this flag will be removed after its available torch_npu is public accessible
132132
# and the mla_pa will be the default path of deepseek decode path.
133133
"VLLM_ASCEND_MLA_PA":

0 commit comments

Comments
 (0)