From 8797e311011b0ddd825337ab6a3634b1e3f77b84 Mon Sep 17 00:00:00 2001 From: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com> Date: Tue, 26 May 2026 09:50:53 +0000 Subject: [PATCH 1/2] fix _agent_py.py import when meta `nixl` package is absent The trtllm dev environment used to install the meta `nixl` package, which provides a top-level `nixl/__init__.py` shim that redirects to `nixl_cu13` / `nixl_cu12`. After https://github.com/NVIDIA/TensorRT-LLM/pull/14436 switched the dependency to `nixl-cu13` directly, the meta shim is no longer present, so `from nixl import nixl_agent, ...` in `tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py` raises `ModuleNotFoundError: No module named 'nixl'` at import time, which in turn breaks `test_agent_multi_backends::test_run_with_different_env[1]` during collection of the spawned subprocess pytest. Resolve the symbols from `nixl_cu13` (or `nixl_cu12`) first and fall back to the meta-package only when neither CUDA-specific package is installed. Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com> --- .../_torch/disaggregation/nixl/_agent_py.py | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py b/tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py index dcfa28210f81..0b6a52d93de0 100644 --- a/tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py +++ b/tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py @@ -1,14 +1,33 @@ +import importlib import time from enum import Enum -from nixl import nixl_agent, nixl_agent_config, nixl_xfer_handle - from tensorrt_llm._utils import nvtx_range from tensorrt_llm.logger import logger # Import base classes for type compatibility from ..base.agent import BaseTransferAgent, RegMemoryDescs, TransferRequest, TransferStatus +# The PyPI ``nixl`` meta-package provides a top-level ``nixl`` shim that +# redirects to ``nixl_cu13`` or ``nixl_cu12``. When only ``nixl-cu13`` (or +# ``nixl-cu12``) is installed without the meta-package, ``import nixl`` fails. +# Try the CUDA-specific packages first, then fall back to the meta-package. +_nixl_mod = None +for _candidate in ("nixl_cu13", "nixl_cu12", "nixl"): + try: + _nixl_mod = importlib.import_module(_candidate) + break + except ImportError: + continue +if _nixl_mod is None: + raise ImportError( + "Could not find a NIXL Python package. " + "Install ``nixl-cu13`` (CUDA 13) or ``nixl-cu12`` (CUDA 12)." + ) +nixl_agent = _nixl_mod.nixl_agent +nixl_agent_config = _nixl_mod.nixl_agent_config +nixl_xfer_handle = _nixl_mod.nixl_xfer_handle + class TransferState(Enum): PENDING = "PENDING" From a1625b18d58316d7a5be2016e203c6e8db6d54f9 Mon Sep 17 00:00:00 2001 From: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com> Date: Wed, 27 May 2026 01:31:28 +0000 Subject: [PATCH 2/2] unwaive test_agent_multi_backends.py::test_run_with_different_env[1] This case (TRTLLM_USE_PY_NIXL_KVCACHE=1) was waived under nvbugs/5979673 because the meta `nixl` package pulled the latest `nixl-cu12` wheel, whose `_bindings.so` referenced symbols absent from the source-built 0.9.0 `libnixl.so`. With `nixl-cu13==0.9.0` directly pinned in requirements-dev.txt, the bindings and the libnixl in the container are ABI-consistent again, so the test is expected to pass. Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com> --- tests/integration/test_lists/waives.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration/test_lists/waives.txt b/tests/integration/test_lists/waives.txt index 1c7cd90dc257..a2f897f2e29a 100644 --- a/tests/integration/test_lists/waives.txt +++ b/tests/integration/test_lists/waives.txt @@ -351,7 +351,6 @@ unittest/auto_deploy/singlegpu/models/test_qwen3_5_moe.py::test_vlm_wrapper_delt unittest/auto_deploy/singlegpu/smoke/test_ad_build_small_single.py::test_build_ad[deepseek-ai/DeepSeek-V3-llm_extra_args10] SKIP (https://nvbugs/5888827) unittest/auto_deploy/standalone/test_standalone_package.py::TestStandalonePackage::test_run_unit_tests SKIP (https://nvbugs/6160629) unittest/bindings/test_transfer_agent_bindings.py::TestNixlFunctionalTransfer::test_nixl_wait_in_progress_on_zero_timeout SKIP (https://nvbugs/6260897) -unittest/disaggregated/test_agent_multi_backends.py::test_run_with_different_env[1] SKIP (https://nvbugs/5979673) unittest/executor/test_rpc.py::TestRpcCorrectness::test_incremental_task_async SKIP (https://nvbugs/5741476) unittest/executor/test_rpc_proxy.py SKIP (https://nvbugs/5605741) unittest/executor/test_rpc_worker.py SKIP (https://nvbugs/5605741)