fix nixl side-channel host selection (#41806)

Signed-off-by: Shahar Mor <smor@nvidia.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
shaharmor98
2026-05-11 07:40:37 +00:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 5cba6839e6
commit f9f770ca0b
8 changed files with 179 additions and 2 deletions
@@ -209,6 +209,7 @@ class NixlConnectorScheduler:
encoded_data,
ready_event,
self._stop_event,
self.side_channel_host,
self.side_channel_port,
),
daemon=True,
@@ -222,6 +223,7 @@ class NixlConnectorScheduler:
encoded_data: dict[int, Any],
ready_event: threading.Event,
stop_event: threading.Event,
host: str,
port: int,
):
"""Background thread for getting new NIXL handshakes."""
@@ -229,7 +231,6 @@ class NixlConnectorScheduler:
# to a better approach via HTTP endpoint soon.
# Listen for new requests for metadata.
host = envs.VLLM_NIXL_SIDE_CHANNEL_HOST
path = make_zmq_path("tcp", host, port)
logger.debug("Starting listening on path: %s", path)
with zmq_ctx(zmq.ROUTER, path) as sock:
+1
View File
@@ -1884,6 +1884,7 @@ def compile_factors() -> dict[str, object]:
"VLLM_SERVER_DEV_MODE",
"VLLM_DP_MASTER_IP",
"VLLM_DP_MASTER_PORT",
"VLLM_NIXL_SIDE_CHANNEL_HOST",
"VLLM_RANDOMIZE_DP_DUMMY_INPUTS",
"VLLM_CI_USE_S3",
"VLLM_MODEL_REDIRECT_PATH",
+12
View File
@@ -2005,6 +2005,8 @@ class EngineCoreActorMixin:
vllm_config.parallel_config.data_parallel_index = dp_rank
vllm_config.parallel_config.data_parallel_rank_local = local_dp_rank
self._set_nixl_side_channel_host()
# Set CUDA_VISIBLE_DEVICES as early as possible in actor life cycle
# NOTE: in MP we set CUDA_VISIBLE_DEVICES at process creation time,
# and this cannot be done in the same way for Ray because:
@@ -2024,6 +2026,16 @@ class EngineCoreActorMixin:
# of ray.
self._set_visible_devices(vllm_config, local_dp_rank)
@staticmethod
def _set_nixl_side_channel_host():
import ray
# The driver-side value is excluded from Ray actor env propagation.
# Fill in an actor-local default while preserving explicit overrides.
os.environ.setdefault(
"VLLM_NIXL_SIDE_CHANNEL_HOST", ray.util.get_node_ip_address()
)
def _set_visible_devices(self, vllm_config: VllmConfig, local_dp_rank: int):
from vllm.platforms import current_platform
+5 -1
View File
@@ -27,6 +27,7 @@ from vllm.utils.network_utils import get_open_zmq_ipc_path, zmq_socket_ctx
from vllm.utils.system_utils import get_mp_context
from vllm.v1.engine.coordinator import DPCoordinator
from vllm.v1.executor import Executor
from vllm.v1.executor.ray_utils import WORKER_SPECIFIC_ENV_VARS
from vllm.v1.utils import get_engine_client_zmq_addr, shutdown
if TYPE_CHECKING:
@@ -356,7 +357,10 @@ class CoreEngineActorManager:
self.local_engine_actors: list[ray.ActorHandle] = []
self.remote_engine_actors: list[ray.ActorHandle] = []
env_vars_list = get_env_vars_to_copy(destination=actor_class.__name__)
env_vars_list = get_env_vars_to_copy(
destination=actor_class.__name__,
exclude_vars=WORKER_SPECIFIC_ENV_VARS,
)
self.env_vars_dict = {
name: os.environ[name] for name in env_vars_list if name in os.environ
}
+1
View File
@@ -33,6 +33,7 @@ PG_WAIT_TIMEOUT = 1800
WORKER_SPECIFIC_ENV_VARS: set[str] = {
"VLLM_HOST_IP",
"VLLM_HOST_PORT",
"VLLM_NIXL_SIDE_CHANNEL_HOST",
"LOCAL_RANK",
"CUDA_VISIBLE_DEVICES",
"HIP_VISIBLE_DEVICES",