Python Bindings for the Unified Communication X library (UCX)
Actively maintained. Last release 8 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
pip install ucxx-cu13UCXX
UCXX is an object-oriented C++ interface for UCX, with native support for Python bindings.
Building
Environment setup
Before starting it is necessary to have the necessary dependencies installed. The simplest way to get started is to install Miniforge and then to create and activate an environment with the provided development file, for CUDA 13.x:
$ conda env create -n ucxx -f conda/environments/all_cuda-133_arch-$(uname -m).yaml
And then activate the newly created environment:
$ conda activate ucxx
Faster conda dependency resolution
The procedure aforementioned should complete without issues, but it may be slower than necessary. One alternative to speed up dependency resolution is to install mamba before creating the new environment. After installing Miniforge, mamba can be installed with:
$ conda install -c conda-forge mamba
After that, one can proceed as before, but simply replacing conda with mamba in the environment creation command:
$ mamba env create -n ucxx -f conda/environments/all_cuda-133_arch-$(uname -m).yaml
$ conda activate ucxx
Convenience Script
For convenience, we provide the ./build.sh script. By default, it will build and install both C++ and Python libraries. For a detailed description on available options please check ./build.sh --help.
Building C++ and Python libraries manually is also possible, see instructions on building C++ and Python.
Additionally, there is a ./build_and_run.sh script that will call ./build.sh to build everything as well as running C++ and Python tests and a few benchmarks. Similarly, details on existing options can be queried with ./build_and_run.sh.
C++
To build and install the C++ library to ${CONDA_PREFIX}, with Python support and CCCL CUDA buffer support, as well as building all tests and benchmarks with CUDA/CCCL support, run:
mkdir cpp/build
cd cpp/build
cmake .. -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
-DBUILD_TESTS=ON \
-DBUILD_BENCHMARKS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DUCXX_ENABLE_PYTHON=ON \
-DUCXX_ENABLE_CCCL=ON \
-DUCXX_BENCHMARKS_ENABLE_CUDA=ON \
-DUCXX_BENCHMARKS_ENABLE_CCCL=ON
make -j install