@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 5522fb274b
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 01:45 UTC

[Chore] Optimize P2PNCCLEngine `http_address` (#27488)

Signed-off-by: yewentao256 <zhyanwentao@126.com>

Wentao Ye committed Oct 29, 2025 at 12:05 UTC 5522fb274bf384f838c015798be891f9fbf7172f
1 file changed +17 -5
vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_engine.py
+17 -5
@@ -1,6 +1,7 @@
1 # SPDX-License-Identifier: Apache-2.0
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4 +import json
5 import logging
6 import os
7 import threading
@@ -96,19 +97,30 @@ class P2pNcclEngine:
97 # Each card corresponds to a ZMQ address.
98 self.zmq_address = f"{self._hostname}:{self._port}"
99
99 - # The `http_port` must be consistent with the port of OpenAI.
100 - self.http_address = (
101 - f"{self._hostname}:{self.config.kv_connector_extra_config['http_port']}"
102 - )
103 -
100 # If `proxy_ip` or `proxy_port` is `""`,
101 # then the ping thread will not be enabled.
102 proxy_ip = self.config.get_from_extra_config("proxy_ip", "")
103 proxy_port = self.config.get_from_extra_config("proxy_port", "")
104 if proxy_ip == "" or proxy_port == "":
105 self.proxy_address = ""
106 + self.http_address = ""
107 else:
108 self.proxy_address = proxy_ip + ":" + proxy_port
109 + # the `http_port` must be consistent with the port of OpenAI.
110 + http_port = self.config.get_from_extra_config("http_port", None)
111 + if http_port is None:
112 + example_cfg = {
113 + "kv_connector": "P2pNcclConnector",
114 + "kv_connector_extra_config": {"http_port": 8000},
115 + }
116 + example = (
117 + f"--port=8000 --kv-transfer-config='{json.dumps(example_cfg)}'"
118 + )
119 + raise ValueError(
120 + "kv_connector_extra_config.http_port is required. "
121 + f"Example: {example}"
122 + )
123 + self.http_address = f"{self._hostname}:{http_port}"
124
125 self.context = zmq.Context()
126 self.router_socket = self.context.socket(zmq.ROUTER)