Skip to content

Commit

Permalink
Merge pull request #786 from rapidsai/branch-0.22
Browse files Browse the repository at this point in the history
[RELEASE] ucx-py v0.22
  • Loading branch information
ajschmidt8 authored Oct 6, 2021
2 parents 0bfe21d + de30c95 commit 4830333
Show file tree
Hide file tree
Showing 14 changed files with 646 additions and 225 deletions.
2 changes: 1 addition & 1 deletion ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export HOME=$WORKSPACE
cd $WORKSPACE
export GIT_DESCRIBE_TAG=`git describe --tags`
export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'`
export RAPIDS_VERSION="21.08"
export RAPIDS_VERSION="21.10"
export UCX_PATH=$CONDA_PREFIX

################################################################################
Expand Down
24 changes: 24 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM python:3

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata && \
apt-get install -y \
automake \
dh-make \
g++ \
git \
libcap2 \
libhwloc-dev \
libnuma-dev \
libtool \
make \
udev \
wget \
&& apt-get remove -y openjdk-11-* || apt-get autoremove -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

COPY run.sh /root

WORKDIR /root

CMD [ "/root/run.sh" ]
24 changes: 24 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Docker container

## Summary

Contains reference dockerfile and build script to run UCX-Py tests and benchmarks. This is a minimal setup, without support for CUDA, MOFED or rdma-core.

## Building Docker image

To begin, it's necessary to build the image, this is done as follows:

```bash
cd docker
docker build -t ucx-py -f Dockerfile .
```

## Running

Once building the Docker image is complete, the container can be started with the following command:

```bash
docker run ucx-py
```

The container above will run UCX-Py tests and benchmarks.
70 changes: 70 additions & 0 deletions docker/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash
# Copyright (c) 2021, NVIDIA CORPORATION.
set -e

function logger {
echo -e "\n$@\n"
}

PYTHON_PREFIX=$(python -c "import distutils.sysconfig; print(distutils.sysconfig.PREFIX)")

################################################################################
# SETUP - Install python packages and check environment
################################################################################

pip install \
"pytest" "pytest-asyncio" \
"dask" "distributed" \
"cython"

logger "Check versions"
python --version
pip list

################################################################################
# BUILD - Build UCX master, UCX-Py and run tests
################################################################################
logger "Build UCX master"
cd $HOME
git clone https://github.com/openucx/ucx
cd ucx
./autogen.sh
./contrib/configure-devel \
--prefix=$PYTHON_PREFIX \
--enable-gtest=no \
--with-valgrind=no
make -j install

echo $PYTHON_PREFIX >> /etc/ld.so.conf.d/python.conf
ldconfig

logger "UCX Version and Build Information"
ucx_info -v


################################################################################
# TEST - Run pytests for ucx-py
################################################################################
logger "Clone and Build UCX-Py"
cd $HOME
git clone https://github.com/rapidsai/ucx-py
cd ucx-py
python setup.py build_ext --inplace
python -m pip install -e .

for tls in "tcp" "all"; do
export UCX_TLS=$tls

logger "Python pytest for ucx-py"

# Test with TCP/Sockets
logger "Tests (UCX_TLS=$UCX_TLS)"
pytest --cache-clear -vs ucp/_libs/tests
pytest --cache-clear -vs tests/

logger "Benchmarks (UCX_TLS=$UCX_TLS)"
python benchmarks/send-recv.py -o numpy \
--server-dev 0 --client-dev 0 --reuse-alloc
python benchmarks/send-recv-core.py -o numpy \
--server-dev 0 --client-dev 0 --reuse-alloc
done
21 changes: 14 additions & 7 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ Build Dependencies

conda create -n ucx -c conda-forge \
automake make libtool pkg-config \
libhwloc psutil \
psutil \
"python=3.7" setuptools "cython>=0.29.14,<3.0.0a0"


If you are using UCX 1.9 and older and using both CUDA and InfiniBand support, ensure ``libhwloc`` is also on the list above.

Test Dependencies
~~~~~~~~~~~~~~~~~

Expand All @@ -70,17 +72,17 @@ Test Dependencies
distributed


UCX-1.11 (Development)
~~~~~~~~~~~~~~~~~~~~~~
UCX-1.11.1
~~~~~~~~~~

Instructions for building UCX 1.11 (current development version):
Instructions for building UCX 1.11.1:

::

conda activate ucx
git clone https://github.com/openucx/ucx
cd ucx
git checkout v1.11.x
git checkout v1.11.1
./autogen.sh
mkdir build
cd build
Expand Down Expand Up @@ -153,7 +155,12 @@ UCX-Py
conda activate ucx
git clone https://github.com/rapidsai/ucx-py.git
cd ucx-py
python setup.py build_ext --inplace
pip install .
pip install -v .
# or for develop build
pip install -v -e .

In UCX 1.10 and above, or for builds that don't need CUDA and InfiniBand support, users can disable building with hwloc support:

::

UCXPY_DISABLE_HWLOC=1 pip install -v .
43 changes: 26 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,33 @@

include_dirs = [os.path.dirname(get_python_inc())]
library_dirs = [get_config_var("LIBDIR")]
libraries = ["ucp", "uct", "ucm", "ucs", "hwloc"]
libraries = ["ucp", "uct", "ucm", "ucs"]
extra_compile_args = ["-std=c99", "-Werror"]


DISABLE_HWLOC = int(os.environ.get("UCXPY_DISABLE_HWLOC", "0"))
topological_distance_ext = []
if DISABLE_HWLOC == 0:
libraries.append("hwloc")
topological_distance_ext = [
Extension(
"ucp._libs.topological_distance",
sources=[
"ucp/_libs/topological_distance.pyx",
"ucp/_libs/src/topological_distance.c",
],
depends=[
"ucp/_libs/src/topological_distance.h",
"ucp/_libs/topological_distance_dep.pxd",
],
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=libraries,
extra_compile_args=extra_compile_args,
),
]


def get_ucp_version():
with open(include_dirs[0] + "/ucp/api/ucp_version.h") as f:
ftext = f.read()
Expand Down Expand Up @@ -59,22 +82,8 @@ def get_ucp_version():
libraries=libraries,
extra_compile_args=extra_compile_args,
),
Extension(
"ucp._libs.topological_distance",
sources=[
"ucp/_libs/topological_distance.pyx",
"ucp/_libs/src/topological_distance.c",
],
depends=[
"ucp/_libs/src/topological_distance.h",
"ucp/_libs/topological_distance_dep.pxd",
],
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=libraries,
extra_compile_args=extra_compile_args,
),
],
]
+ topological_distance_ext,
compile_time_env={"CY_UCP_AM_SUPPORTED": _am_supported},
)

Expand Down
Loading

0 comments on commit 4830333

Please sign in to comment.