2024-04-22 09:36:19 +03:00
|
|
|
FROM nvcr.io/nvidia/pytorch:24.03-py3
|
|
|
|
|
|
|
|
# OS:
|
|
|
|
# - Ubuntu: 22.04
|
|
|
|
# - OpenMPI: 4.1.4+
|
|
|
|
# - Docker Client: 20.10.8
|
|
|
|
# NVIDIA:
|
|
|
|
# - CUDA: 12.4.0
|
|
|
|
# - cuDNN: 9.0.0.306
|
|
|
|
# - cuBLAS: 12.4.2.65
|
2024-10-10 04:59:47 +03:00
|
|
|
# - NCCL: v2.23.4-1
|
2024-04-22 09:36:19 +03:00
|
|
|
# - TransformerEngine 1.4
|
|
|
|
# Mellanox:
|
|
|
|
# - OFED: 23.07-0.5.1.2
|
|
|
|
# - HPC-X: v2.18.0-CUDA12.x
|
|
|
|
# Intel:
|
|
|
|
# - mlc: v3.11
|
|
|
|
|
|
|
|
LABEL maintainer="SuperBench"
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2024-11-07 02:16:12 +03:00
|
|
|
|
2024-04-22 09:36:19 +03:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
bc \
|
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
dmidecode \
|
|
|
|
ffmpeg \
|
|
|
|
git \
|
|
|
|
iproute2 \
|
|
|
|
jq \
|
|
|
|
libaio-dev \
|
|
|
|
libavcodec-dev \
|
|
|
|
libavformat-dev \
|
|
|
|
libavutil-dev \
|
|
|
|
libboost-program-options-dev \
|
|
|
|
libcap2 \
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libnuma-dev \
|
|
|
|
libpci-dev \
|
|
|
|
libswresample-dev \
|
|
|
|
libtinfo5 \
|
|
|
|
libtool \
|
|
|
|
lshw \
|
|
|
|
python3-mpi4py \
|
|
|
|
net-tools \
|
|
|
|
nlohmann-json3-dev \
|
|
|
|
openssh-client \
|
|
|
|
openssh-server \
|
|
|
|
pciutils \
|
|
|
|
sudo \
|
|
|
|
util-linux \
|
|
|
|
vim \
|
|
|
|
wget \
|
|
|
|
&& \
|
|
|
|
apt-get autoremove && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/*
|
|
|
|
|
|
|
|
ARG NUM_MAKE_JOBS=
|
2024-11-07 02:16:12 +03:00
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG TARGETARCH
|
2024-04-22 09:36:19 +03:00
|
|
|
|
|
|
|
# Install Docker
|
|
|
|
ENV DOCKER_VERSION=20.10.8
|
2024-11-07 02:16:12 +03:00
|
|
|
RUN TARGETARCH_HW=$(uname -m) && \
|
|
|
|
wget -q https://download.docker.com/linux/static/stable/${TARGETARCH_HW}/docker-${DOCKER_VERSION}.tgz -O docker.tgz && \
|
2024-04-22 09:36:19 +03:00
|
|
|
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
|
|
|
|
rm docker.tgz
|
|
|
|
|
|
|
|
# Update system config
|
|
|
|
RUN mkdir -p /root/.ssh && \
|
|
|
|
touch /root/.ssh/authorized_keys && \
|
|
|
|
mkdir -p /var/run/sshd && \
|
|
|
|
sed -i "s/[# ]*PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config && \
|
|
|
|
sed -i "s/[# ]*PermitUserEnvironment no/PermitUserEnvironment yes/" /etc/ssh/sshd_config && \
|
|
|
|
sed -i "s/[# ]*Port.*/Port 22/" /etc/ssh/sshd_config && \
|
|
|
|
echo "* soft nofile 1048576\n* hard nofile 1048576" >> /etc/security/limits.conf && \
|
|
|
|
echo "root soft nofile 1048576\nroot hard nofile 1048576" >> /etc/security/limits.conf
|
|
|
|
|
|
|
|
# Install OFED
|
|
|
|
ENV OFED_VERSION=23.07-0.5.1.2
|
2024-11-07 02:16:12 +03:00
|
|
|
RUN TARGETARCH_HW=$(uname -m) && \
|
|
|
|
cd /tmp && \
|
|
|
|
wget -q https://content.mellanox.com/ofed/MLNX_OFED-${OFED_VERSION}/MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu22.04-${TARGETARCH_HW}.tgz && \
|
|
|
|
tar xzf MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu22.04-${TARGETARCH_HW}.tgz && \
|
|
|
|
MLNX_OFED_LINUX-${OFED_VERSION}-ubuntu22.04-${TARGETARCH_HW}/mlnxofedinstall --user-space-only --without-fw-update --without-ucx-cuda --force --all && \
|
2024-04-22 09:36:19 +03:00
|
|
|
rm -rf /tmp/MLNX_OFED_LINUX-${OFED_VERSION}*
|
|
|
|
|
|
|
|
# Install HPC-X
|
|
|
|
ENV HPCX_VERSION=v2.18
|
2024-11-07 02:16:12 +03:00
|
|
|
RUN TARGETARCH_HW=$(uname -m) && \
|
|
|
|
cd /opt && \
|
2024-04-22 09:36:19 +03:00
|
|
|
rm -rf hpcx && \
|
2024-11-07 02:16:12 +03:00
|
|
|
wget https://content.mellanox.com/hpc/hpc-x/${HPCX_VERSION}/hpcx-${HPCX_VERSION}-gcc-mlnx_ofed-ubuntu22.04-cuda12-${TARGETARCH_HW}.tbz -O hpcx.tbz && \
|
2024-04-22 09:36:19 +03:00
|
|
|
tar xf hpcx.tbz && \
|
2024-11-07 02:16:12 +03:00
|
|
|
mv hpcx-${HPCX_VERSION}-gcc-mlnx_ofed-ubuntu22.04-cuda12-${TARGETARCH_HW} hpcx && \
|
2024-04-22 09:36:19 +03:00
|
|
|
rm hpcx.tbz
|
|
|
|
|
2024-11-07 02:16:12 +03:00
|
|
|
# Installs specific to amd64 platform
|
|
|
|
RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
|
|
|
# Install Intel MLC
|
|
|
|
cd /tmp && \
|
2024-04-22 09:36:19 +03:00
|
|
|
wget -q https://downloadmirror.intel.com/793041/mlc_v3.11.tgz -O mlc.tgz && \
|
|
|
|
tar xzf mlc.tgz Linux/mlc && \
|
|
|
|
cp ./Linux/mlc /usr/local/bin/ && \
|
2024-11-07 02:16:12 +03:00
|
|
|
rm -rf ./Linux mlc.tgz && \
|
|
|
|
# Install AOCC compiler
|
2024-04-22 09:36:19 +03:00
|
|
|
wget https://download.amd.com/developer/eula/aocc-compiler/aocc-compiler-4.0.0_1_amd64.deb && \
|
|
|
|
apt install -y ./aocc-compiler-4.0.0_1_amd64.deb && \
|
2024-11-07 02:16:12 +03:00
|
|
|
rm -rf aocc-compiler-4.0.0_1_amd64.deb && \
|
|
|
|
# Install AMD BLIS
|
2024-04-22 09:36:19 +03:00
|
|
|
wget https://download.amd.com/developer/eula/blis/blis-4-0/aocl-blis-linux-aocc-4.0.tar.gz && \
|
|
|
|
tar xzf aocl-blis-linux-aocc-4.0.tar.gz && \
|
|
|
|
mv amd-blis /opt/AMD && \
|
2024-11-07 02:16:12 +03:00
|
|
|
rm -rf aocl-blis-linux-aocc-4.0.tar.gz; \
|
|
|
|
else \
|
|
|
|
echo "Skipping Intel MLC, AOCC and AMD Bliss installations for non-amd64 architecture: $TARGETARCH"; \
|
|
|
|
fi
|
2024-04-22 09:36:19 +03:00
|
|
|
|
2024-10-10 04:59:47 +03:00
|
|
|
# Install NCCL 2.23.4
|
|
|
|
RUN cd /tmp && \
|
|
|
|
git clone -b v2.23.4-1 https://github.com/NVIDIA/nccl.git && \
|
|
|
|
cd nccl && \
|
|
|
|
make -j ${NUM_MAKE_JOBS} src.build && \
|
|
|
|
make install && \
|
|
|
|
rm -rf /tmp/nccl
|
|
|
|
|
|
|
|
# Install UCX v1.16.0 with multi-threading support
|
|
|
|
RUN cd /tmp && \
|
|
|
|
wget https://github.com/openucx/ucx/releases/download/v1.16.0/ucx-1.16.0.tar.gz && \
|
|
|
|
tar xzf ucx-1.16.0.tar.gz && \
|
|
|
|
cd ucx-1.16.0 && \
|
|
|
|
./contrib/configure-release-mt --prefix=/usr/local && \
|
|
|
|
make -j ${NUM_MAKE_JOBS} && \
|
|
|
|
make install
|
|
|
|
|
2024-04-22 09:36:19 +03:00
|
|
|
ENV PATH="${PATH}" \
|
|
|
|
LD_LIBRARY_PATH="/usr/local/lib:/usr/local/mpi/lib:${LD_LIBRARY_PATH}" \
|
|
|
|
SB_HOME=/opt/superbench \
|
|
|
|
SB_MICRO_PATH=/opt/superbench \
|
|
|
|
ANSIBLE_DEPRECATION_WARNINGS=FALSE \
|
|
|
|
ANSIBLE_COLLECTIONS_PATH=/usr/share/ansible/collections
|
|
|
|
|
|
|
|
RUN echo PATH="$PATH" > /etc/environment && \
|
|
|
|
echo LD_LIBRARY_PATH="$LD_LIBRARY_PATH" >> /etc/environment && \
|
|
|
|
echo SB_MICRO_PATH="$SB_MICRO_PATH" >> /etc/environment && \
|
2024-08-13 19:35:01 +03:00
|
|
|
echo "source /opt/hpcx/hpcx-init.sh && hpcx_load" | tee -a /etc/bash.bashrc >> /etc/profile.d/10-hpcx.sh
|
2024-04-22 09:36:19 +03:00
|
|
|
|
|
|
|
# Add config files
|
|
|
|
ADD dockerfile/etc /opt/microsoft/
|
|
|
|
|
|
|
|
WORKDIR ${SB_HOME}
|
|
|
|
|
|
|
|
ADD third_party third_party
|
|
|
|
RUN make -C third_party cuda_with_msccl
|
|
|
|
|
|
|
|
ADD . .
|
|
|
|
RUN python3 -m pip install --upgrade setuptools==65.7 && \
|
|
|
|
python3 -m pip install --no-cache-dir .[nvworker] && \
|
|
|
|
make cppbuild && \
|
|
|
|
make postinstall && \
|
|
|
|
rm -rf .git
|