Skip to content

Commit

Permalink
Update CUDA & MOFED ver
Browse files Browse the repository at this point in the history
  • Loading branch information
B-a-S committed Jan 3, 2024
1 parent 885bf53 commit 03f1ca3
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 16 deletions.
21 changes: 21 additions & 0 deletions .ci/Dockerfile.ngc_pytorch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG CUDA_VER='11.4.2'
FROM harbor.mellanox.com/torch-ucc/ucc/1.0.0/x86_64/centos8/cuda${CUDA_VER}:base
#FROM nvcr.io/nvidia/pytorch:23.10-py3
RUN rm -rf ${SRC_DIR}/ucc
COPY . ${SRC_DIR}/ucc

RUN apt update && apt install -y sudo && \
echo "swx-jenkins ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN pip install 'protobuf<=3.19.0'
#==============================================================================
# Build UCC
RUN ${SRC_DIR}/ucc/.ci/scripts/build_ucc.sh
#==============================================================================
# Install torch_ucc (UCC version) python module and build a wheel package
RUN chown -R 6213:11429 /opt/nvidia
#==============================================================================
RUN groupadd -g 11429 swx-jenkins
RUN adduser --no-create-home --uid 6213 --gid 11429 --home /labhome/swx-jenkins swx-jenkins
#==============================================================================
USER swx-jenkins

71 changes: 71 additions & 0 deletions .ci/build_base_docker/Dockerfile.ngc_pytorch.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
ARG CUDA_VER='12.1.1'
FROM nvcr.io/nvidia/pytorch:23.11-py3
#==============================================================================
ARG NVIDIA_ROOT_DIR=/opt/nvidia
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV SRC_DIR=${NVIDIA_ROOT_DIR}/src
ENV PKG_DIR=${NVIDIA_ROOT_DIR}/pkg
ENV BIN_DIR=${NVIDIA_ROOT_DIR}/bin
ENV WORKLOADS_DIR=${NVIDIA_ROOT_DIR}/workloads
ENV TORCH_UCC_GITHUB_URL=https://github.com/facebookresearch/torch_ucc.git
ENV TORCH_UCC_BRANCH=main
ENV CUDA_HOME=/usr/local/cuda
ENV UCX_GITHUB_URL=https://github.com/openucx/ucx.git
ENV UCX_BRANCH=master
ENV UCX_BUILD_TYPE=release-mt
ENV UCX_INSTALL_DIR=${BIN_DIR}/ucx/build-${UCX_BUILD_TYPE}
ENV UCC_INSTALL_DIR=${BIN_DIR}/ucc/build
ENV OFED_PKG='lsof kmod udev swig libelf1 libfuse2 pciutils tk gfortran libpci3 libusb-1.0-0 libltdl-dev libmnl0 bison tcl flex chrpath debhelper ethtool graphviz'
ENV PACKAGES='numactl openssh-server protobuf-compiler rdma-core vim libevent-dev build-essential git make autoconf libtool'
ENV OS_VERSION=ubuntu22.04
ENV PLATFORM=x86_64
ENV MOFED_VERSION=23.10-0.5.5.0
ENV MOFED_URL="https://content.mellanox.com/ofed/MLNX_OFED-${MOFED_VERSION}/MLNX_OFED_LINUX-${MOFED_VERSION}-${OS_VERSION}-${PLATFORM}.tgz"
ENV OMPI_PATH="/opt/hpcx/ompi"
#==============================================================================
RUN apt update && apt install -y ${OFED_PKG} && \
mkdir -p /tmp/ofed && wget --quiet -O /tmp/ofed/ofed.tgz ${MOFED_URL} && \
tar -xvf /tmp/ofed/ofed.tgz --strip-components=2 -C /tmp/ofed && \
/tmp/ofed/mlnxofedinstall --user-space-only --without-fw-update -q --distro ${OS_VERSION} --basic && \
rm -rf /tmp/ofed

RUN apt install -y ${PACKAGES}

# Remove old UCX
RUN rm -rf /opt/hpcx/uc?
ENV PATH=${OMPI_PATH}/bin:$PATH
RUN echo "export PATH=\"\$OMPI_PATH:\$PATH\"" >> /etc/bashrc && \
export LD_LIBRARY_PATH=\"\$OMPI_PATH/lib64:\${LD_LIBRARY_PATH}\" >> /etc/bashrc
#==============================================================================
# Configure SSH
RUN mkdir -p /var/run/sshd && \
cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new && \
echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new && \
mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config && \
ssh-keygen -A && \
rm -f /run/nologin
#==============================================================================

#==============================================================================
RUN mkdir -p ${SRC_DIR} ${PKG_DIR} ${BIN_DIR} ${WORKLOADS_DIR} && \
cd ${SRC_DIR} && \
mkdir -p ${SRC_DIR}/ucx && \
git clone --recursive ${UCX_GITHUB_URL} ${SRC_DIR}/ucx && \
cd ${SRC_DIR}/ucx && \
git checkout ${UCX_BRANCH}

COPY . ${SRC_DIR}/ucc
#==============================================================================
# Build UCX
RUN ${SRC_DIR}/ucc/.ci/scripts/build_ucx.sh
ENV PATH=${UCX_INSTALL_DIR}/bin:${PATH}
#==============================================================================
# Install workloads
WORKDIR ${WORKLOADS_DIR}
RUN git clone https://github.com/facebookresearch/dlrm.git && \
cd ${WORKLOADS_DIR}/dlrm && \
pip3 install -r ${WORKLOADS_DIR}/dlrm/requirements.txt && \
pip3 install tensorboard
RUN git clone https://github.com/facebookresearch/param.git && \
pip3 install -r ${WORKLOADS_DIR}/param/requirements.txt
14 changes: 7 additions & 7 deletions .ci/job_matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ volumes:
}

env:
CUDA_VER: '11.4.2'
CUDA_VER: '12.1.1'
UCC_URI_SUFFIX: "ucc/${UCC_VERSION}/x86_64/centos8/cuda${CUDA_VER}"
UCC_DOCKER_IMAGE_NAME: "${registry_host}${registry_path}/${UCC_URI_SUFFIX}"
NVIDIA_ROOT_DIR: "/opt/nvidia"
Expand All @@ -42,8 +42,8 @@ credentials:

runs_on_dockers:
- {
file: ".ci/Dockerfile.centos8",
name: "centos8",
file: ".ci/Dockerfile.ngc_pytorch",
name: "ngc_pytorch",
tag: "${BUILD_NUMBER}",
arch: "x86_64",
uri: "${UCC_URI_SUFFIX}",
Expand Down Expand Up @@ -77,7 +77,8 @@ steps:
run: |
export UCC_PASSWORD=$UCC_PASSWORD
export UCC_USERNAME=$UCC_USERNAME
echo "Running coverity"
echo "Running coverity "
env
${WORKSPACE}/.ci/scripts/coverity.sh
archiveArtifacts: .ci/scripts/cov-build/*

Expand All @@ -87,12 +88,11 @@ steps:
run: |
echo "INFO: Run UCC tests"
hostname
docker exec $(cat ${WORKSPACE}/ucc_docker.id) bash -c "\${SRC_DIR}/ucc/.ci/scripts/run_tests_ucc.sh"
echo "INFO: Run Torch-UCC tests (UCC)"
docker exec $(cat ${WORKSPACE}/ucc_docker.id) bash -c "\${SRC_DIR}/ucc/.ci/scripts/run_tests_torch_ucc.sh"
docker exec $(cat ${WORKSPACE}/ucc_docker.id) bash -c "\${SRC_DIR}/ucc/.ci/scripts/run_tests_ucc.sh"
always: |
docker rm --force $(cat ${WORKSPACE}/ucc_docker.id)
#============================================================================
- name: Run docker containers
agentSelector: "{nodeLabel: 'swx-clx01'}"
Expand Down
4 changes: 4 additions & 0 deletions .ci/scripts/env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash -eEx

export PATH="/opt/hpcx/ompi/bin:$PATH"
export LD_LIBRARY_PATH="/opt/hpcx/ompi/lib:${LD_LIBRARY_PATH}"
export OPAL_PREFIX=/opt/hpcx/ompi

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"

# shellcheck disable=SC2034
Expand Down
2 changes: 1 addition & 1 deletion .ci/scripts/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ DOCKER_RUN_ARGS="\
-d \
--rm \
--name=${DOCKER_CONTAINER_NAME} \
-v /labhome:/labhome \
-v /labhome/swx-jenkins:/labhome/swx-jenkins \
"

# shellcheck disable=SC2013
Expand Down
3 changes: 0 additions & 3 deletions .ci/scripts/run_tests_ucc_mpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ if [ -z "$HOSTFILE" ]; then
exit 1
fi

export PATH="/usr/lib64/openmpi/bin:$PATH"
export LD_LIBRARY_PATH="/usr/lib64/openmpi/lib:${LD_LIBRARY_PATH}"

HEAD_NODE=$(head -1 "$HOSTFILE")
export HEAD_NODE
export MASTER_ADDR=${HEAD_NODE}
Expand Down
17 changes: 12 additions & 5 deletions test/gtest/core/test_mc_reduce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class test_mc_reduce : public testing::Test {
std::cerr << "failed to destory cuda stream" << std::endl;
return UCC_ERR_NO_MESSAGE;
}
ee_context = NULL;
}
#endif
return status;
Expand All @@ -110,11 +111,11 @@ class test_mc_reduce : public testing::Test {
{
ucc_status_t status;

status = alloc_executor(mtype);
status = alloc_bufs(mtype, n);
if (UCC_OK != status) {
return status;
}
return alloc_bufs(mtype, n);
return alloc_executor(mtype);
}

ucc_status_t alloc_bufs(ucc_memory_type_t mtype, size_t n)
Expand Down Expand Up @@ -192,9 +193,6 @@ class test_mc_reduce : public testing::Test {
virtual void TearDown() override
{
free_bufs(mem_type);
if (executor) {
free_executor();
}
ucc_mc_finalize();
}

Expand Down Expand Up @@ -246,6 +244,9 @@ class test_mc_reduce : public testing::Test {
GTEST_SKIP();
}
ASSERT_EQ(status, UCC_OK);
if (executor) {
free_executor();
}

if (mt != UCC_MEMORY_TYPE_HOST) {
ucc_mc_memcpy(this->res_h, this->res_d, this->COUNT * sizeof(*this->res_d),
Expand All @@ -272,6 +273,9 @@ class test_mc_reduce : public testing::Test {
GTEST_SKIP();
}
ASSERT_EQ(status, UCC_OK);
if (executor) {
free_executor();
}

if (mt != UCC_MEMORY_TYPE_HOST) {
ucc_mc_memcpy(this->res_h, this->res_d, this->COUNT * sizeof(*this->res_d),
Expand Down Expand Up @@ -305,6 +309,9 @@ class test_mc_reduce : public testing::Test {
GTEST_SKIP();
}
ASSERT_EQ(status, UCC_OK);
if (executor) {
free_executor();
}

if (mt != UCC_MEMORY_TYPE_HOST) {
ucc_mc_memcpy(this->res_h, this->res_d, this->COUNT * sizeof(*this->res_d),
Expand Down

0 comments on commit 03f1ca3

Please sign in to comment.