@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 107210442d
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 3, 11:45 UTC

[CI] Add NIXL EP import canary (#42567)

Signed-off-by: Alec Flowers <aflowers@nvidia.com> Co-authored-by: OpenAI Codex <codex@openai.com>

Alec committed May 17, 2026 at 19:11 UTC 107210442da1bc6985bfa615b55e1e5c2dd98958
2 files changed +66
tests/v1/kv_connector/nixl_integration/config_sweep_accuracy_test.sh
+4
@@ -3,6 +3,10 @@ set -euo pipefail
3
4 # Utility to run integration tests sequentially with varying TP configurations.
5 SCRIPT="v1/kv_connector/nixl_integration/run_accuracy_test.sh"
6 +IMPORT_CANARY="v1/kv_connector/nixl_integration/test_nixl_imports.py"
7 +
8 +echo "=== Running NIXL import canary ==="
9 +python3 -m pytest -s -x "${IMPORT_CANARY}"
10
11 # Define test configurations
12 tp_configs=(
tests/v1/kv_connector/nixl_integration/test_nixl_imports.py new
+62
@@ -0,0 +1,62 @@
1 +# SPDX-License-Identifier: Apache-2.0
2 +# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +"""NIXL import canaries for CUDA wheel selection."""
4 +
5 +import importlib
6 +import importlib.metadata as metadata
7 +import pathlib
8 +import subprocess
9 +import sys
10 +
11 +import pytest
12 +import torch
13 +
14 +
15 +def _print_distribution_version(package_name: str) -> None:
16 + try:
17 + version = metadata.version(package_name)
18 + except metadata.PackageNotFoundError:
19 + version = "not installed"
20 + print(f"{package_name}: {version}")
21 +
22 +
23 +@pytest.mark.skipif(torch.version.cuda is None, reason="CUDA NIXL EP canary")
24 +def test_nixl_and_nixl_ep_imports() -> None:
25 + """Verify both core NIXL and the NIXL EP extension import successfully."""
26 + print(f"torch cuda: {torch.version.cuda}")
27 + for package_name in ("nixl", "nixl-cu12", "nixl-cu13"):
28 + _print_distribution_version(package_name)
29 +
30 + nixl = importlib.import_module("nixl")
31 + print(f"nixl: {nixl.__file__}")
32 +
33 + # Exercise the core NIXL bindings used by NixlConnector.
34 + importlib.import_module("nixl._api")
35 + importlib.import_module("nixl._bindings")
36 +
37 + # Exercise the NIXL EP extension used by fused MoE expert parallelism.
38 + nixl_ep = importlib.import_module("nixl_ep")
39 + print(f"nixl_ep: {nixl_ep.__file__}")
40 +
41 + assert nixl_ep.__file__ is not None
42 + extension_dir = pathlib.Path(nixl_ep.__file__).parent
43 + extension_files = sorted(extension_dir.glob("nixl_ep_cpp*.so"))
44 + assert extension_files, f"No nixl_ep_cpp extension found in {extension_dir}"
45 +
46 + extension_file = extension_files[0]
47 + completed = subprocess.run(
48 + ["ldd", str(extension_file)],
49 + capture_output=True,
50 + check=False,
51 + text=True,
52 + )
53 + print(completed.stdout)
54 + if completed.stderr:
55 + print(completed.stderr, file=sys.stderr)
56 +
57 + assert completed.returncode == 0
58 + if torch.version.cuda is not None:
59 + cuda_major = torch.version.cuda.split(".", maxsplit=1)[0]
60 + expected_cudart = f"libcudart.so.{cuda_major}"
61 + assert expected_cudart in completed.stdout
62 + assert f"{expected_cudart} => not found" not in completed.stdout