Skip to content

Commit 18d767d

Browse files
authored
[GITHUB ACTION][NIXL]update install_nixl.py script (#543)
Follow upstream fix to fix our install_nixl script to work with nixl 0.7.0 Signed-off-by: Chendi Xue <chendi.xue@intel.com>
1 parent 3c3a7a9 commit 18d767d

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

.github/workflows/create-release-branch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ jobs:
315315
-e HF_HOME=/workspace/hf_cache \
316316
-e HF_TOKEN=${{ secrets.HF_TOKEN }} \
317317
-v /mnt/hf_cache:/workspace/hf_cache \
318-
-v /mnt/wheels_cache:/workspace/wheels_cache \
318+
-v /mnt/wheels_cache:/tmp/wheels_cache \
319319
hpu-plugin-v1-${{ needs.prepare-release-branch.outputs.tag_name }} \
320320
/bin/bash -c "
321321
pip install lm-eval[api] &&

.github/workflows/hourly-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ jobs:
258258
-e HF_HOME=/workspace/hf_cache \
259259
-e HF_TOKEN=${{ secrets.HF_TOKEN }} \
260260
-v /mnt/hf_cache:/workspace/hf_cache \
261-
-v /mnt/wheels_cache:/workspace/wheels_cache \
261+
-v /mnt/wheels_cache:/tmp/wheels_cache \
262262
hpu-plugin-v1-test-env-hourly-ci \
263263
/bin/bash -c "
264264
pip install lm-eval[api] &&

.github/workflows/pre-merge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ jobs:
379379
-e HF_HOME=/workspace/hf_cache \
380380
-e HF_TOKEN=${{ secrets.HF_TOKEN }} \
381381
-v /mnt/hf_cache:/workspace/hf_cache \
382-
-v /mnt/wheels_cache:/workspace/wheels_cache \
382+
-v /mnt/wheels_cache:/tmp/wheels_cache \
383383
hpu-plugin-v1-test-env-pre-merge-${{ github.event.pull_request.head.sha }} \
384384
/bin/bash -c "
385385
pip install lm-eval[api] &&

install_nixl.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
import sys
55
import argparse
66
import glob
7+
import json
8+
import urllib
79

810
# --- Configuration ---
9-
WHEELS_CACHE_HOME = os.environ.get("WHEELS_CACHE_HOME", "/workspace/wheels_cache")
11+
WHEELS_CACHE_HOME = os.environ.get("WHEELS_CACHE_HOME", "/tmp/wheels_cache")
1012
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
1113
UCX_DIR = os.path.join('/tmp', 'ucx_source')
1214
NIXL_DIR = os.path.join('/tmp', 'nixl_source')
@@ -16,6 +18,20 @@
1618

1719

1820
# --- Helper Functions ---
21+
def get_latest_nixl_version():
22+
"""Helper function to get latest release version of NIXL"""
23+
try:
24+
nixl_release_url = "https://api.github.com/repos/ai-dynamo/nixl/releases/latest"
25+
with urllib.request.urlopen(nixl_release_url) as response:
26+
data = json.load(response)
27+
return data.get("tag_name", "0.7.0")
28+
except Exception:
29+
return "0.7.0"
30+
31+
32+
NIXL_VERSION = os.environ.get("NIXL_VERSION", get_latest_nixl_version())
33+
34+
1935
def run_command(command, cwd='.', env=None):
2036
"""Helper function to run a shell command and check for errors."""
2137
print(f"--> Running command: {' '.join(command)} in '{cwd}'", flush=True)
@@ -33,7 +49,7 @@ def is_pip_package_installed(package_name):
3349
def find_nixl_wheel_in_cache(cache_dir):
3450
"""Finds a nixl wheel file in the specified cache directory."""
3551
# The repaired wheel will have a 'manylinux' tag, but this glob still works.
36-
search_pattern = os.path.join(cache_dir, "nixl-*.whl")
52+
search_pattern = os.path.join(cache_dir, f"nixl*{NIXL_VERSION}*.whl")
3753
wheels = glob.glob(search_pattern)
3854
if wheels:
3955
# Sort to get the most recent/highest version if multiple exist
@@ -125,6 +141,10 @@ def build_and_install_prerequisites(args):
125141
print("\n[2/3] Building NIXL wheel from source...", flush=True)
126142
if not os.path.exists(NIXL_DIR):
127143
run_command(['git', 'clone', NIXL_REPO_URL, NIXL_DIR])
144+
else:
145+
run_command(["git", "fetch", "--tags"], cwd=NIXL_DIR)
146+
run_command(["git", "checkout", NIXL_VERSION], cwd=NIXL_DIR)
147+
print(f"--> Checked out NIXL version: {NIXL_VERSION}", flush=True)
128148

129149
build_env = os.environ.copy()
130150
build_env['PKG_CONFIG_PATH'] = os.path.join(ucx_install_path, 'lib', 'pkgconfig')
@@ -169,7 +189,14 @@ def build_and_install_prerequisites(args):
169189

170190
print(f"--> Successfully built self-contained wheel: {os.path.basename(newly_built_wheel)}. Now installing...",
171191
flush=True)
172-
install_command = [sys.executable, '-m', 'pip', 'install', newly_built_wheel]
192+
install_command = [
193+
sys.executable,
194+
"-m",
195+
"pip",
196+
"install",
197+
"--no-deps", # w/o "no-deps", it will install cuda-torch
198+
newly_built_wheel,
199+
]
173200
if args.force_reinstall:
174201
install_command.insert(-1, '--force-reinstall')
175202

0 commit comments

Comments
 (0)