From 9d6500b89d12f4d62ef9f2ab7292823b4255217c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Lucchesi?= Date: Thu, 7 May 2026 18:43:07 +0200 Subject: [PATCH] [Misc] Delay EPLB Nixl import until needed (#41805) Signed-off-by: NickLucche --- vllm/distributed/eplb/eplb_communicator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vllm/distributed/eplb/eplb_communicator.py b/vllm/distributed/eplb/eplb_communicator.py index ffd0406f76..95a5ae5ff4 100644 --- a/vllm/distributed/eplb/eplb_communicator.py +++ b/vllm/distributed/eplb/eplb_communicator.py @@ -23,10 +23,6 @@ from vllm.distributed.device_communicators.pynccl import PyNcclCommunicator from vllm.distributed.device_communicators.pynccl_wrapper import ( ncclDataTypeEnum, ) -from vllm.distributed.nixl_utils import ( - NixlWrapper, - nixl_agent_config, -) from vllm.distributed.parallel_state import ( GroupCoordinator, get_pp_group, @@ -41,6 +37,8 @@ logger = init_logger(__name__) def has_nixl() -> bool: """Whether the optional NIXL / RIXL package is available.""" + from vllm.distributed.nixl_utils import NixlWrapper + return NixlWrapper is not None @@ -235,6 +233,8 @@ class NixlEplbCommunicator(EplbCommunicator): expert_weights: Sequence[torch.Tensor], cuda_stream: torch.cuda.Stream | None = None, ) -> None: + from vllm.distributed.nixl_utils import NixlWrapper, nixl_agent_config + assert expert_weights, "NixlEplbCommunicator requires non-empty expert_weights." if NixlWrapper is None: raise RuntimeError("NIXL/ RIXL is unavailable.")