Skip to content

Commit 3fb4c6a

Browse files
Merge branch 'main' into rust_test_sync_manager
2 parents 5d9544c + 60a12a4 commit 3fb4c6a

File tree

25 files changed

+474
-119
lines changed

25 files changed

+474
-119
lines changed

CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ CODEOWNERS @ai-dynamo/Devops @ai-dynamo/nixl-maintainers
3131
/benchmark @aranadive @ovidiusm @brminich
3232

3333
# Libfabric Plugins
34-
/src/plugins/libfabric* @yexiang-aws @akkart-aws @fengjica
35-
/src/utils/libfabric @yexiang-aws @akkart-aws @fengjica
36-
/test/unit/utils/libfabric @yexiang-aws @akkart-aws @fengjica
34+
/src/plugins/libfabric* @amitrad-aws @yexiang-aws @akkart-aws @fengjica
35+
/src/utils/libfabric @amitrad-aws @yexiang-aws @akkart-aws @fengjica
36+
/test/unit/utils/libfabric @amitrad-aws @yexiang-aws @akkart-aws @fengjica

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ Common build options:
144144
- `disable_gds_backend`: Disable GDS backend (default: false)
145145
- `cudapath_inc`, `cudapath_lib`: Custom CUDA paths
146146
- `static_plugins`: Comma-separated list of plugins to build statically
147+
- `enable_plugins`: Comma-separated list of plugins to build (e.g. `-Denable_plugins=UCX,POSIX`). Cannot be used with `disable_plugins`.
148+
- `disable_plugins`: Comma-separated list of plugins to exclude (e.g. `-Ddisable_plugins=GDS`). Cannot be used with `enable_plugins`.
147149

148150
### Building Documentation
149151

benchmark/kvbench/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name = "NIXLKVBench"
1818
version = "0.2.0"
1919
description = "Benchmarking utility for testing KVCache transfers in large language models (LLMs) using the NIXL runtime."
2020
readme = "README.md"
21-
requires-python = ">=3.9"
21+
requires-python = ">=3.10"
2222
dependencies = [
2323
"click==8.1.7",
2424
"pytest==7.4.4",

benchmark/nixlbench/contrib/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ RUN uv pip install --upgrade meson meson-python pybind11 patchelf pyYAML click t
189189
RUN CUDA_SHORT_VERSION=cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d .) && \
190190
FLAGS="--index-url https://download.pytorch.org/whl/$CUDA_SHORT_VERSION" && \
191191
uv pip install $FLAGS torch torchvision torchaudio
192+
# Upgrade setuptools to latest version for compatibility with PEP 639 (license format)
193+
RUN uv pip install --upgrade 'setuptools>=80.9.0'
192194

193195
COPY --from=nixl . /workspace/nixl
194196
COPY --from=nixlbench . /workspace/nixlbench

contrib/Dockerfile

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ ARG OS=${OS:-ubuntu24}
2424
ARG ARCH="x86_64"
2525
ARG DEFAULT_PYTHON_VERSION="3.12"
2626
ARG UCX_REF="v1.20.x"
27+
ARG BUILD_NIXL_EP="false"
28+
ARG RDMA_CORE_PREFIX="/usr"
2729
ARG UCX_PREFIX="/usr"
2830
ARG UCX_PLUGIN_DIR="$UCX_PREFIX/lib/ucx"
31+
ARG DOCA_PREFIX="/opt/mellanox/doca"
2932
ARG NIXL_PREFIX="/usr/local/nixl"
3033
ARG NIXL_PLUGIN_DIR="$NIXL_PREFIX/lib/$ARCH-linux-gnu/plugins"
3134
ARG NPROC
@@ -122,8 +125,17 @@ RUN rm -rf /opt/hpcx/ucx
122125

123126
RUN cd /usr/local/src && \
124127
git clone https://github.com/openucx/ucx.git && \
125-
cd ucx && \
126-
git checkout $UCX_REF && \
128+
cd ucx && \
129+
if [ "$BUILD_NIXL_EP" = "true" ]; then \
130+
echo "=== BUILD_NIXL_EP=true: Using latest UCX master branch (ignoring UCX_REF=$UCX_REF) ===" && \
131+
UCX_COMMIT=$(git rev-parse --short HEAD) && \
132+
echo "Using UCX commit: $UCX_COMMIT" && \
133+
EXPERIMENTAL_API_PARAM="--enable-experimental-api"; \
134+
else \
135+
echo "=== Using UCX_REF=$UCX_REF ===" && \
136+
git checkout $UCX_REF && \
137+
EXPERIMENTAL_API_PARAM=""; \
138+
fi && \
127139
./autogen.sh && \
128140
./contrib/configure-release-mt \
129141
--prefix=$UCX_PREFIX \
@@ -133,6 +145,7 @@ RUN cd /usr/local/src && \
133145
--enable-optimizations \
134146
--enable-cma \
135147
--enable-devel-headers \
148+
$EXPERIMENTAL_API_PARAM \
136149
--with-cuda=/usr/local/cuda \
137150
--with-verbs \
138151
--with-dm \
@@ -191,19 +204,30 @@ RUN uv pip install --upgrade meson meson-python pybind11 patchelf pyYAML click t
191204
# Install PyTorch
192205
RUN export UV_INDEX="https://download.pytorch.org/whl/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d .)" && \
193206
uv pip install torch torchvision torchaudio
207+
# Upgrade setuptools to latest version for compatibility with PEP 639 (license format)
208+
RUN uv pip install --upgrade 'setuptools>=80.9.0'
194209

195210
WORKDIR /workspace/nixl
196211
COPY . /workspace/nixl
197212

198-
ENV LD_LIBRARY_PATH=/usr/local/lib:$LIBFABRIC_INSTALL_PATH/lib:$LD_LIBRARY_PATH
213+
ENV LD_LIBRARY_PATH=/usr/local/lib:$LIBFABRIC_INSTALL_PATH/lib:$RDMA_CORE_PREFIX/lib:$LD_LIBRARY_PATH
199214

200215
# Install pybind11 via apt
201216
RUN apt-get update && apt-get install -y --no-install-recommends pybind11-dev
202217

218+
# Set PKG_CONFIG_PATH for NIXL EP dependencies (rdma-core, UCX, DOCA)
219+
ENV PKG_CONFIG_PATH=$RDMA_CORE_PREFIX/lib/$ARCH-linux-gnu/pkgconfig:$UCX_PREFIX/lib/pkgconfig:$DOCA_PREFIX/lib/$ARCH-linux-gnu/pkgconfig:$PKG_CONFIG_PATH
220+
203221
ENV NIXL_PREFIX=$NIXL_PREFIX
204222
RUN rm -rf build && \
205223
mkdir build && \
206-
meson setup -Dlibfabric_path=$LIBFABRIC_INSTALL_PATH build/ --prefix=$NIXL_PREFIX --buildtype=$BUILD_TYPE && \
224+
if [ "$BUILD_NIXL_EP" = "true" ]; then \
225+
echo "=== BUILD_NIXL_EP=true: Building NIXL with NIXL EP support ===" && \
226+
NIXL_EP_FLAG="-Dbuild_nixl_ep=true"; \
227+
else \
228+
NIXL_EP_FLAG=""; \
229+
fi && \
230+
meson setup -Ducx_path=$UCX_PREFIX -Dlibfabric_path=$LIBFABRIC_INSTALL_PATH $NIXL_EP_FLAG build/ --prefix=$NIXL_PREFIX --buildtype=$BUILD_TYPE && \
207231
cd build && \
208232
ninja && \
209233
ninja install
@@ -212,6 +236,10 @@ RUN echo "$NIXL_PREFIX/lib/$ARCH-linux-gnu" > /etc/ld.so.conf.d/nixl.conf && \
212236
echo "$NIXL_PLUGIN_DIR" >> /etc/ld.so.conf.d/nixl.conf && \
213237
ldconfig
214238

239+
# Set environment variables for NIXL EP
240+
ENV NIXL_PLUGIN_DIR=$NIXL_PLUGIN_DIR
241+
ENV PYTHONPATH=/workspace/nixl/build/examples/device/ep
242+
215243
RUN cd src/bindings/rust && cargo build --release --locked
216244

217245
# Build wheel using the build-wheel.sh script for better UCX plugin bundling and library management

contrib/Dockerfile.manylinux

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ARG BASE_IMAGE
1818
ARG BASE_IMAGE_TAG
1919
FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG}
2020

21-
ARG DEFAULT_PYTHON_VERSION="3.12"
21+
ARG DEFAULT_PYTHON_VERSION="3.14"
2222
ARG ARCH="x86_64"
2323
ARG UCX_REF="v1.20.x"
2424
ARG LIBFABRIC_VERSION="v1.21.0"
@@ -244,6 +244,8 @@ RUN uv pip install --upgrade meson meson-python pybind11 patchelf pyYAML click s
244244
# Install PyTorch
245245
RUN export UV_INDEX="https://download.pytorch.org/whl/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d .)" && \
246246
uv pip install torch torchvision torchaudio
247+
# Upgrade setuptools to latest version for compatibility with PEP 639 (license format)
248+
RUN uv pip install --upgrade 'setuptools>=80.9.0'
247249

248250
COPY . /workspace/nixl
249251
WORKDIR /workspace/nixl
@@ -267,10 +269,11 @@ RUN echo "/usr/local/nixl/lib/$ARCH-linux-gnu" > /etc/ld.so.conf.d/nixl.conf &&
267269

268270
# Create the wheel
269271
# No need to specifically add path to libcuda.so here, meson finds the stubs and links them
270-
ARG WHL_PYTHON_VERSIONS="3.9,3.10,3.11,3.12,3.13"
272+
ARG WHL_PYTHON_VERSIONS="3.10,3.11,3.12,3.13,3.14"
271273
ARG WHL_PLATFORM="manylinux_2_28_$ARCH"
272274
RUN IFS=',' read -ra PYTHON_VERSIONS <<< "$WHL_PYTHON_VERSIONS" && \
273275
export UV_INDEX="https://download.pytorch.org/whl/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d .)" && \
276+
export UV_INDEX_STRATEGY=unsafe-best-match && \
274277
mkdir -p dist && \
275278
for PYTHON_VERSION in "${PYTHON_VERSIONS[@]}"; do \
276279
export PATH=$VIRTUAL_ENV/bin:$PATH && \

contrib/build-container.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ WHL_BASE=manylinux_2_39
3636
WHL_PLATFORM=${WHL_BASE}_${ARCH}
3737
WHL_PYTHON_VERSIONS="3.12"
3838
UCX_REF=${UCX_REF:-v1.20.x}
39+
BUILD_NIXL_EP="false"
3940
OS="ubuntu24"
4041
NPROC=${NPROC:-$(nproc)}
4142
if [ "$CI" = "true" ]; then
@@ -122,6 +123,9 @@ get_options() {
122123
# Master branch (v1.20) also containing EFA SRD support
123124
UCX_REF=9d2b88a1f67faf9876f267658bd077b379b8bb76
124125
;;
126+
--build-nixl-ep)
127+
BUILD_NIXL_EP=true
128+
;;
125129
--arch)
126130
if [ "$2" ]; then
127131
ARCH=$2
@@ -169,7 +173,13 @@ show_build_options() {
169173
echo "Container arch: ${ARCH}"
170174
echo "Python Versions for wheel build: ${WHL_PYTHON_VERSIONS}"
171175
echo "Wheel Platform: ${WHL_PLATFORM}"
172-
echo "UCX Ref: ${UCX_REF}"
176+
if [ "$BUILD_NIXL_EP" = "true" ]; then
177+
echo "UCX Ref: master (latest) - BUILD_NIXL_EP enabled"
178+
echo "NIXL EP: Enabled"
179+
else
180+
echo "UCX Ref: ${UCX_REF}"
181+
echo "NIXL EP: Disabled"
182+
fi
173183
echo "Build Type: ${BUILD_TYPE}"
174184
}
175185

@@ -184,6 +194,7 @@ show_help() {
184194
echo " [--tag tag for image]"
185195
echo " [--python-versions python versions to build for, comma separated]"
186196
echo " [--ucx-upstream use ucx master branch]"
197+
echo " [--build-nixl-ep build NIXL with NIXL EP support (uses latest UCX master)]"
187198
echo " [--arch [x86_64|aarch64] to select target architecture]"
188199
echo " [--dockerfile path to a dockerfile to use]"
189200
exit 0
@@ -210,6 +221,7 @@ BUILD_ARGS+=" --build-arg WHL_PYTHON_VERSIONS=$WHL_PYTHON_VERSIONS"
210221
BUILD_ARGS+=" --build-arg WHL_PLATFORM=$WHL_PLATFORM"
211222
BUILD_ARGS+=" --build-arg ARCH=$ARCH"
212223
BUILD_ARGS+=" --build-arg UCX_REF=$UCX_REF"
224+
BUILD_ARGS+=" --build-arg BUILD_NIXL_EP=$BUILD_NIXL_EP"
213225
BUILD_ARGS+=" --build-arg NPROC=$NPROC"
214226
BUILD_ARGS+=" --build-arg OS=$OS"
215227
BUILD_ARGS+=" --build-arg BUILD_TYPE=$BUILD_TYPE"

meson.build

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,56 @@ project('nixl', 'CPP', version: '0.8.0',
2121
meson_version: '>= 0.64.0'
2222
)
2323

24+
enable_plugins_opt = get_option('enable_plugins')
25+
disable_plugins_opt = get_option('disable_plugins')
26+
is_explicit_enable = enable_plugins_opt != ''
27+
28+
if enable_plugins_opt != '' and disable_plugins_opt != ''
29+
error('Cannot specify both enable_plugins and disable_plugins options')
30+
endif
31+
32+
all_plugins = ['UCX', 'LIBFABRIC', 'POSIX', 'OBJ', 'GDS', 'GDS_MT', 'MOONCAKE', 'HF3FS', 'GUSLI', 'GPUNETIO', 'UCCL']
33+
34+
enabled_plugins = {}
35+
36+
if enable_plugins_opt != ''
37+
enabled_plugins_list = []
38+
foreach p : enable_plugins_opt.split(',')
39+
p_stripped = p.strip()
40+
if p_stripped not in all_plugins
41+
error('Requested plugin "' + p_stripped + '" is not available. Available plugins are: ' + ', '.join(all_plugins))
42+
endif
43+
enabled_plugins_list += [p_stripped]
44+
endforeach
45+
46+
foreach plugin : all_plugins
47+
enabled_plugins += {plugin: plugin in enabled_plugins_list}
48+
endforeach
49+
50+
message('Building only selected plugins: ' + enable_plugins_opt)
51+
elif disable_plugins_opt != ''
52+
disabled_plugins_list = []
53+
foreach p : disable_plugins_opt.split(',')
54+
p_stripped = p.strip()
55+
if p_stripped not in all_plugins
56+
error('Cannot exclude unknown plugin "' + p_stripped + '". Available plugins are: ' + ', '.join(all_plugins))
57+
endif
58+
disabled_plugins_list += [p_stripped]
59+
endforeach
60+
61+
foreach plugin : all_plugins
62+
enabled_plugins += {plugin: plugin not in disabled_plugins_list}
63+
endforeach
64+
65+
message('Building all plugins except: ' + disable_plugins_opt)
66+
else
67+
foreach plugin : all_plugins
68+
enabled_plugins += {plugin: true}
69+
endforeach
70+
71+
message('Building all available plugins')
72+
endif
73+
2474
# set up some global vars for compiler, platform, configuration, etc.
2575
cpp = meson.get_compiler('cpp')
2676
fs = import('fs')
@@ -110,7 +160,7 @@ if cuda_dep.found()
110160
nvcc_flags_link += ['-gencode=arch=compute_90,code=sm_90']
111161
add_project_link_arguments(nvcc_flags_link, language: 'cuda')
112162
message('nvcc version: ' + nvcc.version())
113-
if nvcc.version().version_compare('>=12.8') and nvcc.version().version_compare('<13.0')
163+
if nvcc.version().version_compare('>=12.8')
114164
doca_gpunetio_dep = dependency('doca-gpunetio', required : false)
115165
else
116166
warning('GPUNETIO plugin not supported in CUDA version: ' + nvcc.version())
@@ -262,7 +312,7 @@ if get_option('buildtype') == 'debug'
262312
run_command('truncate', '-s 0', plugfile, check: true)
263313
endif
264314

265-
nixl_inc_dirs = include_directories('src/api/cpp', 'src/api/cpp/backend', 'src/infra', 'src/core')
315+
nixl_inc_dirs = include_directories('src/api/cpp', 'src/api/cpp/backend', 'src/infra', 'src/core', 'src/core/telemetry')
266316
nixl_gpu_inc_dirs = include_directories('src/api/gpu/ucx')
267317
plugins_inc_dirs = include_directories('src/plugins')
268318
utils_inc_dirs = include_directories('src/utils')

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ option('cudapath_inc', type: 'string', value: '', description: 'Include path for
2525
option('cudapath_lib', type: 'string', value: '', description: 'Library path for CUDA')
2626
option('cudapath_stub', type: 'string', value: '', description: 'Extra Stub path for CUDA')
2727
option('static_plugins', type: 'string', value: '', description: 'Plugins to be built-in, comma-separated')
28+
option('enable_plugins', type: 'string', value: '', description: 'Comma-separated list of plugins to build. Default (empty) builds all available plugins.')
29+
option('disable_plugins', type: 'string', value: '', description: 'Comma-separated list of plugins to exclude from build. Cannot be used with enable_plugins.')
2830
option('build_docs', type: 'boolean', value: false, description: 'Build Doxygen documentation')
2931
option('log_level', type: 'combo', choices: ['trace', 'debug', 'info', 'warning', 'error', 'fatal', 'auto'], value: 'auto', description: 'Log Level (auto: auto-detect based on build type: trace for debug builds, info for release builds)')
3032
option('rust', type: 'boolean', value: false, description: 'Build Rust bindings')

pyproject.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@
1414
# limitations under the License.
1515

1616
[build-system]
17-
requires = ["meson-python", "pybind11", "patchelf", "pyyaml", "types-PyYAML", "pytest", "build", "setuptools"]
17+
requires = ["meson-python", "pybind11", "patchelf", "pyyaml", "types-PyYAML", "pytest", "build", "setuptools>=80.9.0"]
1818
build-backend = "mesonpy"
1919

2020
[project]
21-
name = 'nixl-cu12'
22-
version = '0.8.0'
23-
description = 'NIXL Python API'
24-
readme = 'README.md'
25-
license = {file = 'LICENSE'}
26-
requires-python = '>=3.9'
21+
name = "nixl-cu12"
22+
version = "0.8.0"
23+
description = "NIXL Python API"
24+
readme = "README.md"
25+
license = "Apache-2.0"
26+
license-files = ["LICENSE"]
27+
requires-python = ">=3.10"
2728
authors = [
28-
{name = 'NIXL Developers', email = 'nixl-developers@nvidia.com'}
29+
{name = "NIXL Developers", email = "nixl-developers@nvidia.com"}
2930
]
3031

3132
dependencies = ["torch", "numpy"]
@@ -34,4 +35,4 @@ dependencies = ["torch", "numpy"]
3435
profile = "black"
3536

3637
[tool.meson-python.args]
37-
setup = ['-Dinstall_headers=false']
38+
setup = ["-Dinstall_headers=false"]

0 commit comments

Comments
 (0)