- Build the image
apptainer build --fakeroot uccl.sif uccl.def- Adjust the build.sh to not use docker anymore. Diff below on what to remove
--- a/build.sh
+++ b/build.sh
@@ -243,31 +243,8 @@ BUILD_ARGS="--build-arg PY_VER=${PY_VER}"
if [[ -n "${BASE_IMAGE:-}" ]]; then
BUILD_ARGS+=" --build-arg BASE_IMAGE=${BASE_IMAGE}"
fi
-if [[ "$ARCH" == "aarch64" ]]; then
- docker build --platform=linux/arm64 $BUILD_ARGS -t "$IMAGE_NAME" -f "$DOCKERFILE" .
-else
- docker build $BUILD_ARGS -t "$IMAGE_NAME" -f "$DOCKERFILE" .
-fi
echo "[2/3] Running build inside container..."
-docker run --rm --user "$(id -u):$(id -g)" \
- -v /etc/passwd:/etc/passwd:ro \
- -v /etc/group:/etc/group:ro \
- -v $HOME:$HOME \
- -v "$(pwd)":/io \
- -e TARGET="${TARGET}" \
- -e PY_VER="${PY_VER}" \
- -e ARCH="${ARCH}" \
- -e ROCM_IDX_URL="${ROCM_IDX_URL}" \
- -e IS_EFA="${IS_EFA}" \
- -e WHEEL_DIR="${WHEEL_DIR}" \
- -e BUILD_TYPE="${BUILD_TYPE}" \
- -e USE_TCPX="${USE_TCPX:-0}" \
- -e MAKE_NORMAL_MODE="${MAKE_NORMAL_MODE:-}" \
- -e FUNCTION_DEF="$(declare -f build_rccl_nccl_h build_rdma build_efa build_p2p build_ep build_eccl)" \
- -w /io \
- "$IMAGE_NAME" /bin/bash -c '
- set -euo pipefail
if [[ "$TARGET" == "therock" ]]; then
@@ -374,8 +351,7 @@ def initialize():
fi
auditwheel show /io/${WHEEL_DIR}/*.whl
- '- Retrieve a shell in the apptainer
apptainer shell --fakeroot --writable-tmpfs --bind ./wheelhouse-cuda:/io/wheelhouse-cuda --nv uccl.sif- Run
./build.sh cuda rdma
Check all the options of
build.shfrom the main uccl docs, there are options as as p2p and more in place of rdma.
- You'll see an error, but that's all right. You still have the wheel and we'll install it now.
python3 -m pip install /io/wheelhouse-cuda/uccl-0.0.1.post4-py3-none-manylinux_2_35_x86_64.whl
- You can now use uccl
> python3
> import uccl