Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ option('etcd_inc_path', type: 'string', value: '', description: 'Path to ETCD He
option('etcd_lib_path', type: 'string', value: '', description: 'Path to ETCD Libraries')
option('disable_gds_backend', type : 'boolean', value : false, description : 'disable gds backend')
option('disable_mooncake_backend', type : 'boolean', value : false, description : 'disable mooncake backend')
option('disable_uccl_backend', type : 'boolean', value : false, description : 'disable uccl backend')
option('install_headers', type : 'boolean', value : true, description : 'install headers')
option('gds_path', type: 'string', value: '/usr/local/cuda/', description: 'Path to GDS CuFile install')
option('cudapath_inc', type: 'string', value: '', description: 'Include path for CUDA')
Expand Down
2 changes: 2 additions & 0 deletions src/api/python/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ def __init__(
init["num_threads"] = str(nixl_conf.num_threads)
elif bknd == "GDS_MT":
init["thread_count"] = str(nixl_conf.num_threads)
elif bknd == "Uccl":
init["num_cpus"] = str(nixl_conf.num_threads)
self.create_backend(bknd, init)

self.nixl_mems = {
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ if libtransfer_engine.found() and not get_option('disable_mooncake_backend')
subdir('mooncake')
endif

libuccl_engine = cc.find_library('uccl_engine', required: false)
if libuccl_engine.found() and not get_option('disable_uccl_backend')
subdir('uccl')
endif

hf3fs_lib_path = '/usr/lib/'
hf3fs_lib_file = 'hf3fs_api_shared'
hf3fs_lib_found = cc.find_library(hf3fs_lib_file, dirs: [hf3fs_lib_path], required: false)
Expand Down
53 changes: 53 additions & 0 deletions src/plugins/uccl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## UCCL Backend Plugin [Preview]

[UCCL](https://github.com/uccl-project/uccl) is an efficient communication library to perform GPU memory transfers, with a focus on flexibility (evolving ML workloads) and portability (heteregenous GPUs). UCCL provides a software transport stack which runs on the CPUs and are easily extensible to support different techniques like congestion control, multipathing, efficient loss recovery, etc.
UCCL supports collectives, p2p communication and gpu-driven communication for expert parallelism.

## Capabilities

Currently, the UCCL backend supports internode communication over RDMA. Intranode communication will be added soon.

## Installation Guide

1. Install UCCL's p2p engine manually. You can refer to the [installation guide here](https://https://github.com/uccl-project/uccl).

```cpp
git clone https://github.com/uccl-project/uccl.git
cd uccl/p2p
make -j
sudo make install
```

2. Build NIXL using regular method as in [README](https://github.com/ai-dynamo/nixl/blob/main/README.md) ensuring `disable_uccl_backend` is set to `false`.

## Usage Guide

Example Usage to create a NIXL agent with uccl engine:

```python
config = nixl_agent_config(backends=["UCCL"])
agent = nixl_agent("agent-name", config)
```
UCCL engine would auto discover the right NIC to be used for the GPU based on the PCIe distance during memory registration based on the data locality.

### Environment Variables

Refer to [README](https://github.com/uccl-project/uccl/tree/main/collective/rdma#environment-variables-in-uccl) for the complete list of environment variables that can be set to customize UCCL.

**Important**: For `NIXL_READ` operations set `UCCL_RCMODE=1`. By default, UCCL uses RDMA UC (Unreliable Connection). However, `READ` operations need to operate on RDMA RC (Reliable Connection).

### Usage References

1) [NIXL Benchmark](https://github.com/uccl-project/uccl/blob/main/p2p/benchmarks/benchmark_nixl.py) in UCCL: Refer to this [README](https://github.com/uccl-project/uccl/tree/main/p2p) on how to run the script.

2) [NIXL connector](https://github.com/praveingk/vllm/commit/fa67cd7edff076fee4914cc316a9833c2311a65d) in vLLM. vLLM's NIXL connector uses `NIXL_READ` operations, hence set env `UCCL_RCMODE` to 1.

### Road Map

- [ ] Add Intra-node communication support

- [ ] Add Progress Thread support

- [ ] Add asynchronous posting of reads over multiple workers to mitigate latency increase upon fragmentation

- [ ] Add support for other transport (TCP, TCP-X, etc.)
48 changes: 48 additions & 0 deletions src/plugins/uccl/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cpp = meson.get_compiler('cpp')
uccl_lib = cpp.find_library('uccl_engine')

compile_flags = []


if 'UCCL' in static_plugins
uccl_backend_lib = static_library('UCCL',
'uccl_backend.cpp', 'uccl_backend.h', 'uccl_plugin.cpp',
dependencies: [nixl_infra, serdes_interface, cuda_dep, uccl_lib, nixl_common_dep],
include_directories: nixl_inc_dirs,
install: false,
cpp_args : compile_flags,
name_prefix: 'libplugin_') # Custom prefix for plugin libraries
else
uccl_backend_lib = shared_library('UCCL',
'uccl_backend.cpp', 'uccl_backend.h', 'uccl_plugin.cpp',
dependencies: [nixl_infra, serdes_interface, cuda_dep, uccl_lib, nixl_common_dep],
include_directories: [nixl_inc_dirs, utils_inc_dirs],
install: true,
cpp_args : compile_flags + ['-fPIC'],
name_prefix: 'libplugin_', # Custom prefix for plugin libraries
install_dir: plugin_install_dir)

if get_option('buildtype') == 'debug'
run_command('sh', '-c',
'echo "UCCL=' + uccl_backend_lib.full_path() + '" >> ' + plugin_build_dir + '/pluginlist',
check: true
)
endif
endif

uccl_backend_interface = declare_dependency(link_with: uccl_backend_lib)
Loading