diff --git a/.circleci/config.yml b/.circleci/config.yml index ebfd4302..b1778fca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -195,10 +195,13 @@ workflows: - tf28-gpu - pt-gpu - pt2-gpu - - pytorch10-tf27-rocm50 + - pytorch13-tf210-rocm56 + - pytorch20-tf210-rocm56 exclude: - with-mpi: 1 - image-type: pytorch10-tf27-rocm50 + image-type: + - pytorch13-tf210-rocm56 + - pytorch20-tf210-rocm56 - build-and-publish-docker: name: build-and-publish-docker-<>-<> context: determined-production @@ -251,17 +254,20 @@ workflows: image-type: - tf2-cpu - tf28-cpu - - pt-cpu - - pt2-cpu + - pytorch-cpu + - pytorch2-cpu - tf2-gpu - tf28-gpu - - pt-gpu - - pt2-gpu - - pytorch10-tf27-rocm50 + - pytorch-gpu + - pytorch2-gpu + - pytorch13-tf210-rocm56 + - pytorch20-tf210-rocm56 exclude: - dev-mode: true with-mpi: 1 - image-type: pytorch10-tf27-rocm50 + image-type: + - pytorch13-tf210-rocm56 + - pytorch20-tf210-rocm56 - build-and-publish-docker: name: build-and-publish-docker-<>-<>-dev @@ -281,8 +287,8 @@ workflows: - gpu.nvidia.small.multi with-mpi: [0] image-type: - - deepspeed-gpu - - gpt-neox-deepspeed-gpu + - deepspeed + - gpt-neox-deepspeed - publish-cloud-images: name: publish-cloud-images-dev diff --git a/Dockerfile-default-rocm b/Dockerfile-default-rocm index 2e4071b8..3e6a0a94 100644 --- a/Dockerfile-default-rocm +++ b/Dockerfile-default-rocm @@ -1,40 +1,117 @@ ARG BASE_IMAGE FROM ${BASE_IMAGE} +RUN apt remove -y openmpi ucx +#Let's remove existing /opt/ompi; and, link to our version. +RUN rm -rf /opt/ompi +RUN ln -s /container/ompi /opt + RUN mkdir -p /var/run/sshd RUN rm /etc/apt/sources.list.d/rocm.list RUN apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - autoconf \ - automake \ - autotools-dev \ - build-essential \ - ca-certificates \ - curl \ - daemontools \ - libkrb5-dev \ - libssl-dev \ - libtool \ - git \ - krb5-user \ - cmake \ - g++-4.8 \ - make \ - openssh-client \ - openssh-server \ - pkg-config \ - wget \ - nfs-common \ - unattended-upgrades \ - && unattended-upgrade \ - && rm -rf /var/lib/apt/lists/* \ - && rm /etc/ssh/ssh_host_ecdsa_key \ - && rm /etc/ssh/ssh_host_ed25519_key \ - && rm /etc/ssh/ssh_host_rsa_key + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + autoconf \ + automake \ + autotools-dev \ + build-essential \ + ca-certificates \ + curl \ + daemontools \ + glibc-source \ + ibverbs-providers \ + libibverbs1 \ + libkrb5-dev \ + librdmacm1 \ + libssl-dev \ + libtool \ + git \ + krb5-user \ + cmake \ + g++ \ + make \ + openssh-client \ + openssh-server \ + pkg-config \ + wget \ + nfs-common \ + libnuma1 \ + libnuma-dev \ + libpmi2-0-dev \ + unattended-upgrades \ + && unattended-upgrade \ + && rm -rf /var/lib/apt/lists/* \ + && rm /etc/ssh/ssh_host_ecdsa_key \ + && rm /etc/ssh/ssh_host_ed25519_key \ + && rm /etc/ssh/ssh_host_rsa_key +RUN pip install pip install --upgrade pip COPY dockerfile_scripts /tmp/det_dockerfile_scripts +ENV PATH="/opt/conda/envs/py_3.8/bin:${PATH}" + +ARG CONDA="${PATH}" + +ENV PYTHONUNBUFFERED=1 PYTHONFAULTHANDLER=1 PYTHONHASHSEED=0 + +# Install fixed version of FFI package for Ubuntu 20.04. +# This is done after above stuff to make sure we get right version. +RUN /tmp/det_dockerfile_scripts/install_package_fixes.sh + +RUN apt install rocm-libs + +#USING OFI +ARG WITH_MPI=1 +ARG WITH_OFI=1 +ARG WITH_MPICH +ARG UCX_INSTALL_DIR=/container/ucx +ARG OMPI_INSTALL_DIR=/container/ompi +ARG MPICH_INSTALL_DIR=/container/mpich +ARG OFI_INSTALL_DIR=/container/ofi +ARG OMPI_WITH_CUDA=0 +ARG OMPI_WITH_ROCM=1 +RUN if [ "$WITH_MPI" = "1" ]; then /tmp/det_dockerfile_scripts/ompi_rocm.sh "$UBUNTU_VERSION" "$WITH_OFI" "$OMPI_WITH_ROCM" "$WITH_MPICH"; fi + +# Make sure OMPI/UCX show up in the right paths +ARG VERBS_LIB_DIR=/usr/lib/libibverbs +ARG UCX_LIB_DIR=${UCX_INSTALL_DIR}/lib:${UCX_INSTALL_DIR}/lib64 +ARG UCX_PATH_DIR=${UCX_INSTALL_DIR}/bin +ARG OFI_LIB_DIR=${OFI_INSTALL_DIR}/lib:${OFI_INSTALL_DIR}/lib64 +ARG OFI_PATH_DIR=${OFI_INSTALL_DIR}/bin +ARG OMPI_LIB_DIR=${OMPI_INSTALL_DIR}/lib +ARG OMPI_PATH_DIR=${OMPI_INSTALL_DIR}/bin +ARG MPICH_LIB_DIR=${MPICH_INSTALL_DIR}/lib +ARG MPICH_PATH_DIR=${MPICH_INSTALL_DIR}/bin + +# Set up UCX_LIBS and OFI_LIBS +ENV UCX_LIBS="${VERBS_LIB_DIR}:${UCX_LIB_DIR}:${OMPI_LIB_DIR}:" +ENV OFI_LIBS="${VERBS_LIB_DIR}:${OFI_LIB_DIR}:${MPICH_LIB_DIR}:" + +# If WITH_OFI is true, then set EXTRA_LIBS to OFI libs, else set to empty string +ENV EXTRA_LIBS="${WITH_OFI:+${OFI_LIBS}}" + +# If EXTRA_LIBS is empty, set to UCX libs, else leave as OFI libs +ENV EXTRA_LIBS="${EXTRA_LIBS:-${UCX_LIBS}}" + +# But, only add them if WITH_MPI +ENV LD_LIBRARY_PATH=${WITH_MPI:+$EXTRA_LIBS}$LD_LIBRARY_PATH + +#USING OFI +ENV PATH=${WITH_OFI:+$PATH:${WITH_MPI:+$OFI_PATH_DIR:$MPICH_PATH_DIR}} + +#USING UCX +ENV PATH=${PATH:-$CONDA:${WITH_MPI:+$UCX_PATH_DIR:$OMPI_PATH_DIR}} + +# Enable running OMPI as root +ENV OMPI_ALLOW_RUN_AS_ROOT ${WITH_MPI:+1} +ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM ${WITH_MPI:+1} + + + +RUN pip install cloudpickle RUN pip install determined && pip uninstall -y determined +RUN pip install google-auth-oauthlib + + RUN pip install -r /tmp/det_dockerfile_scripts/notebook-requirements.txt ENV JUPYTER_CONFIG_DIR=/run/determined/jupyter/config @@ -48,7 +125,6 @@ RUN /tmp/det_dockerfile_scripts/install_google_cloud_sdk.sh # google-api-python-client -> google-api-core -> googleapis-common-protos -> protobuf # Horovod cannot build with protobuf > 3.20.x # latest google-api-python-client requires protobuf >= 3.20.1 -RUN pip install protobuf==3.20.1 ARG TENSORFLOW_PIP RUN if [ "$TENSORFLOW_PIP" ]; then pip install $TENSORFLOW_PIP; fi @@ -69,13 +145,58 @@ ARG HOROVOD_WITH_TENSORFLOW=1 ARG HOROVOD_WITH_PYTORCH=1 ARG HOROVOD_WITHOUT_MXNET=1 ARG HOROVOD_GPU_OPERATIONS=NCCL -ARG HOROVOD_WITHOUT_MPI=1 +ARG HOROVOD_WITHOUT_MPI=0 +ARG HOROVOD_WITH_MPI=1 ARG HOROVOD_GPU=ROCM -ARG HOROVOD_WITHOUT_MPI=1 -ENV LD_LIBRARY_PATH=/opt/rocm/lib:/opt/rocm/hip/lib +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH;/opt/rocm/lib:/opt/rocm/hip/lib + +ENV HOROVOD_PIP $HOROVOD_PIP +ENV HOROVOD_WITH_TENSORFLOW $HOROVOD_WITH_TENSORFLOW +ENV HOROVOD_WITH_PYTORCH $HOROVOD_WITH_PYTORCH +ENV HOROVOD_WITHOUT_MXNET $HOROVOD_WITHOUT_MXNET +ENV HOROVOD_GPU_OPERATIONS $HOROVOD_GPU_OPERATIONS +ENV HOROVOD_WITHOUT_MPI $HOROVOD_WITHOUT_MPI +ENV HOROVOD_WITH_MPI $HOROVOD_WITH_MPI +ENV HOROVOD_GPU $HOROVOD_GPU +ENV HOROVOD_NCCL_HOME $HOROVOD_NCCL_HOME +ENV NCCL_LIB_DIR=${HOROVOD_NCCL_HOME}/lib +ENV HOROVOD_NCCL_LINK=${WITH_OFI:+SHARED} +ENV LD_LIBRARY_PATH=${WITH_OFI:+$NCCL_LIB_DIR:}$LD_LIBRARY_PATH + RUN if [ "$HOROVOD_PIP" != "0" ]; then pip install "${HOROVOD_PIP}" ; fi -RUN rm -r /tmp/* +RUN pip uninstall -y tb-nightly tensorboardX +RUN pip install -r /tmp/det_dockerfile_scripts/additional-requirements-rocm.txt + + +ENV HSA_FORCE_FINE_GRAIN_PCIE=1 + +ARG AWS_PLUGIN_INSTALL_DIR=/container/aws +ARG WITH_AWS_TRACE +ARG INTERNAL_AWS_DS +ARG INTERNAL_AWS_PATH +ARG ROCM_DIR=/opt/rocm +ENV ROCM_DIR $ROCM_DIR +RUN if [ "$WITH_OFI" = "1" ]; then /tmp/det_dockerfile_scripts/build_aws_rocm.sh "$WITH_OFI" "$WITH_AWS_TRACE" "$WITH_MPICH"; fi +ENV LD_LIBRARY_PATH=${WITH_OFI:+$AWS_PLUGIN_INSTALL_DIR:}$LD_LIBRARY_PATH +RUN ldconfig + +ENV PATH=$OMPI_PATH_DIR:$OFI_INSTALL_DIR:$PATH # Reset entrypoint. -ENTRYPOINT [] + +# Set an entrypoint that can scrape up the host libfabric.so and then +# run the user command. This is intended to enable performant execution +# on non-IB systems that have a proprietary libfabric. + +RUN mkdir -p /container/bin && cp /tmp/det_dockerfile_scripts/scrape_libs.sh /container/bin + +ARG WITH_RCCL=1 +ENV WITH_RCCL=$WITH_RCCL +ARG WITH_NFS_WORKAROUND=1 +ENV WITH_NFS_WORKAROUND=$WITH_NFS_WORKAROUND + +ENTRYPOINT ["/container/bin/scrape_libs.sh"] +CMD ["/bin/bash"] USER root + +RUN rm -r /tmp/* diff --git a/Makefile b/Makefile index 237869ba..a7ff5164 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,4 @@ SHELL := /bin/bash -o pipefail -VERSION := $(shell cat VERSION) -VERSION_DASHES := $(subst .,-,$(VERSION)) SHORT_GIT_HASH := $(shell git rev-parse --short HEAD) NGC_REGISTRY := nvcr.io/isv-ngc-partner/determined @@ -15,7 +13,7 @@ CUDA_111_PREFIX := $(REGISTRY_REPO):cuda-11.1- CUDA_112_PREFIX := $(REGISTRY_REPO):cuda-11.2- CUDA_113_PREFIX := $(REGISTRY_REPO):cuda-11.3- CUDA_118_PREFIX := $(REGISTRY_REPO):cuda-11.8- -ROCM_50_PREFIX := $(REGISTRY_REPO):rocm-5.0- +ROCM_56_PREFIX := $(REGISTRY_REPO):rocm-5.6- CPU_SUFFIX := -cpu GPU_SUFFIX := -gpu @@ -91,7 +89,6 @@ build-cpu-py-38-base: --build-arg "$(MPI_BUILD_ARG)" \ --build-arg "$(OFI_BUILD_ARG)" \ -t $(DOCKERHUB_REGISTRY)/$(CPU_PY_38_BASE_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(CPU_PY_38_BASE_NAME)-$(VERSION) \ --push \ . @@ -108,7 +105,6 @@ build-cpu-py-39-base: --build-arg "$(MPI_BUILD_ARG)" \ --build-arg "$(OFI_BUILD_ARG)" \ -t $(DOCKERHUB_REGISTRY)/$(CPU_PY_39_BASE_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(CPU_PY_39_BASE_NAME)-$(VERSION) \ --push \ . @@ -124,7 +120,6 @@ build-cpu-py-310-base: --build-arg "$(MPI_BUILD_ARG)" \ --build-arg "$(OFI_BUILD_ARG)" \ -t $(DOCKERHUB_REGISTRY)/$(CPU_PY_310_BASE_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(CPU_PY_310_BASE_NAME)-$(VERSION) \ --push \ . @@ -136,7 +131,6 @@ build-gpu-cuda-111-base: --build-arg UBUNTU_VERSION="$(UBUNTU_VERSION)" \ --build-arg "$(MPI_BUILD_ARG)" \ -t $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_111_BASE_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_111_BASE_NAME)-$(VERSION) \ . .PHONY: build-gpu-cuda-112-base @@ -147,7 +141,6 @@ build-gpu-cuda-112-base: --build-arg UBUNTU_VERSION="$(UBUNTU_VERSION)" \ --build-arg "$(MPI_BUILD_ARG)" \ -t $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_112_BASE_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_112_BASE_NAME)-$(VERSION) \ . .PHONY: build-gpu-cuda-113-base @@ -161,7 +154,6 @@ build-gpu-cuda-113-base: --build-arg "$(OFI_BUILD_ARG)" \ --build-arg "$(NCCL_BUILD_ARG)" \ -t $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_113_BASE_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_113_BASE_NAME)-$(VERSION) \ . .PHONY: build-gpu-cuda-118-base @@ -175,33 +167,50 @@ build-gpu-cuda-118-base: --build-arg "$(OFI_BUILD_ARG)" \ --build-arg "$(NCCL_BUILD_ARG)" \ -t $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_118_BASE_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_118_BASE_NAME)-$(VERSION) \ . -export ROCM50_TORCH_TF_ENVIRONMENT_NAME := $(ROCM_50_PREFIX)pytorch-1.10-tf-2.7-rocm -export TF_PROFILER_PIP := tensorboard-plugin-profile -export TORCH_TB_PROFILER_PIP := torch-tb-profiler==0.4.1 +ifeq ($(WITH_MPICH),1) +ROCM56_TORCH13_MPI :=pytorch-1.3-tf-2.10-rocm-mpich +else +ROCM56_TORCH13_MPI :=pytorch-1.3-tf-2.10-rocm-ompi +endif +export ROCM56_TORCH13_TF_ENVIRONMENT_NAME := $(ROCM_56_PREFIX)$(ROCM56_TORCH13_MPI) +.PHONY: build-pytorch13-tf210-rocm56 +build-pytorch13-tf210-rocm56: + docker build -f Dockerfile-default-rocm \ + --build-arg BASE_IMAGE="rocm/pytorch:rocm5.6_ubuntu20.04_py3.8_pytorch_1.13.1"\ + --build-arg TENSORFLOW_PIP="tensorflow-rocm==2.10.1.540" \ + --build-arg HOROVOD_PIP="horovod==0.28.1" \ + --build-arg WITH_MPICH=$(WITH_MPICH) \ + -t $(DOCKERHUB_REGISTRY)/$(ROCM56_TORCH13_TF_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ + -t $(DOCKERHUB_REGISTRY)/$(ROCM56_TORCH13_TF_ENVIRONMENT_NAME)-$(VERSION) \ + . -.PHONY: build-pytorch10-tf27-rocm50 -build-pytorch10-tf27-rocm50: +ifeq ($(WITH_MPICH),1) +ROCM56_TORCH_MPI :=pytorch-2.0-tf-2.10-rocm-mpich +else +ROCM56_TORCH_MPI :=pytorch-2.0-tf-2.10-rocm-ompi +endif +export ROCM56_TORCH_TF_ENVIRONMENT_NAME := $(ROCM_56_PREFIX)$(ROCM56_TORCH_MPI) +.PHONY: build-pytorch20-tf210-rocm56 +build-pytorch20-tf210-rocm56: docker build -f Dockerfile-default-rocm \ - --build-arg BASE_IMAGE="amdih/pytorch:rocm5.0_ubuntu18.04_py3.7_pytorch_1.10.0" \ - --build-arg TORCH_TB_PROFILER_PIP="$(TORCH_TB_PROFILER_PIP)" \ - --build-arg TENSORFLOW_PIP="tensorflow-rocm==2.7.1" \ - --build-arg TF_PROFILER_PIP="$(TF_PROFILER_PIP)" \ - --build-arg HOROVOD_PIP="horovod==0.25.0" \ - -t $(DOCKERHUB_REGISTRY)/$(ROCM50_TORCH_TF_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(ROCM50_TORCH_TF_ENVIRONMENT_NAME)-$(VERSION) \ + --build-arg BASE_IMAGE="rocm/pytorch:rocm5.6_ubuntu20.04_py3.8_pytorch_2.0.1" \ + --build-arg TENSORFLOW_PIP="tensorflow-rocm==2.10.1.540" \ + --build-arg HOROVOD_PIP="horovod==0.28.1" \ + --build-arg WITH_MPICH=$(WITH_MPICH) \ + -t $(DOCKERHUB_REGISTRY)/$(ROCM56_TORCH_TF_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ + -t $(DOCKERHUB_REGISTRY)/$(ROCM56_TORCH_TF_ENVIRONMENT_NAME)-$(VERSION) \ . DEEPSPEED_VERSION := 0.8.3 -export GPU_DEEPSPEED_ENVIRONMENT_NAME := $(CUDA_113_PREFIX)pytorch-1.10-deepspeed-$(DEEPSPEED_VERSION)$(GPU_SUFFIX) -export GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME := $(CUDA_113_PREFIX)pytorch-1.10-gpt-neox-deepspeed$(GPU_SUFFIX) +export GPU_DEEPSPEED_ENVIRONMENT_NAME := deepspeed +export GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME := gpt-neox-deepspeed export TORCH_PIP_DEEPSPEED_GPU := torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio==0.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html # This builds deepspeed environment off of upstream microsoft/DeepSpeed. -.PHONY: build-deepspeed-gpu -build-deepspeed-gpu: build-gpu-cuda-113-base +.PHONY: build-deepspeed +build-deepspeed: build-gpu-cuda-113-base docker build -f Dockerfile-default-gpu \ --build-arg BASE_IMAGE="$(DOCKERHUB_REGISTRY)/$(GPU_CUDA_113_BASE_NAME)-$(SHORT_GIT_HASH)" \ --build-arg TORCH_PIP="$(TORCH_PIP_DEEPSPEED_GPU)" \ @@ -211,15 +220,13 @@ build-deepspeed-gpu: build-gpu-cuda-113-base --build-arg "$(NCCL_BUILD_ARG)" \ --build-arg DEEPSPEED_PIP="deepspeed==$(DEEPSPEED_VERSION)" \ -t $(DOCKERHUB_REGISTRY)/$(GPU_DEEPSPEED_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_DEEPSPEED_ENVIRONMENT_NAME)-$(VERSION) \ -t $(NGC_REGISTRY)/$(GPU_DEEPSPEED_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(NGC_REGISTRY)/$(GPU_DEEPSPEED_ENVIRONMENT_NAME)-$(VERSION) \ . # This builds deepspeed environment off of a patched version of EleutherAI's fork of DeepSpeed # that we need for gpt-neox support. -.PHONY: build-gpt-neox-deepspeed-gpu -build-gpt-neox-deepspeed-gpu: build-gpu-cuda-113-base +.PHONY: build-gpt-neox-deepspeed +build-gpt-neox-deepspeed: build-gpu-cuda-113-base docker build -f Dockerfile-default-gpu \ --build-arg BASE_IMAGE="$(DOCKERHUB_REGISTRY)/$(GPU_CUDA_113_BASE_NAME)-$(SHORT_GIT_HASH)" \ --build-arg TORCH_PIP="$(TORCH_PIP_DEEPSPEED_GPU)" \ @@ -229,27 +236,22 @@ build-gpt-neox-deepspeed-gpu: build-gpu-cuda-113-base --build-arg "$(NCCL_BUILD_ARG)" \ --build-arg DEEPSPEED_PIP="git+https://github.com/determined-ai/deepspeed.git@eleuther_dai" \ -t $(DOCKERHUB_REGISTRY)/$(GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME)-$(VERSION) \ -t $(NGC_REGISTRY)/$(GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(NGC_REGISTRY)/$(GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME)-$(VERSION) \ . ifeq ($(NGC_PUBLISH),) define CPU_TF28_TAGS --t $(DOCKERHUB_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(DOCKERHUB_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME)-$(VERSION) +-t $(DOCKERHUB_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) endef else define CPU_TF28_TAGS -t $(DOCKERHUB_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(DOCKERHUB_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME)-$(VERSION) \ --t $(NGC_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(NGC_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME)-$(VERSION) +-t $(NGC_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) endef endif -export CPU_TF28_ENVIRONMENT_NAME := $(CPU_PREFIX_38)tf-2.8$(CPU_SUFFIX) -export GPU_TF28_ENVIRONMENT_NAME := $(CUDA_112_PREFIX)tf-2.8$(GPU_SUFFIX) +export CPU_TF28_ENVIRONMENT_NAME := tf28$(CPU_SUFFIX) +export GPU_TF28_ENVIRONMENT_NAME := tf28$(GPU_SUFFIX) .PHONY: build-tf28-cpu build-tf28-cpu: build-cpu-py-38-base @@ -276,9 +278,7 @@ build-tf28-gpu: build-gpu-cuda-112-base --build-arg HOROVOD_PIP="horovod==0.24.2" \ --build-arg HOROVOD_WITH_PYTORCH=0 \ -t $(DOCKERHUB_REGISTRY)/$(GPU_TF28_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_TF28_ENVIRONMENT_NAME)-$(VERSION) \ -t $(NGC_REGISTRY)/$(GPU_TF28_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(NGC_REGISTRY)/$(GPU_TF28_ENVIRONMENT_NAME)-$(VERSION) \ . TORCH_VERSION := 1.12 @@ -290,32 +290,26 @@ TORCH_PIP_CPU := torch==1.12.0+cpu torchvision==0.13.0+cpu torchaudio==0.12.0+cp TORCH_PIP_GPU := torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html HOROVOD_PIP_COMMAND := horovod==0.28.1 -export CPU_TF2_ENVIRONMENT_NAME := $(CPU_PREFIX_39)pytorch-$(TORCH_VERSION)-tf-$(TF2_VERSION_SHORT)$(CPU_SUFFIX) -export GPU_TF2_ENVIRONMENT_NAME := $(CUDA_113_PREFIX)pytorch-$(TORCH_VERSION)-tf-$(TF2_VERSION_SHORT)$(GPU_SUFFIX) -export CPU_PT_ENVIRONMENT_NAME := $(CPU_PREFIX_39)pytorch-$(TORCH_VERSION)$(CPU_SUFFIX) -export GPU_PT_ENVIRONMENT_NAME := $(CUDA_113_PREFIX)pytorch-$(TORCH_VERSION)$(GPU_SUFFIX) +export CPU_TF2_ENVIRONMENT_NAME := tf2$(CPU_SUFFIX) +export GPU_TF2_ENVIRONMENT_NAME := tf2$(GPU_SUFFIX) +export CPU_PT_ENVIRONMENT_NAME := pytorch$(CPU_SUFFIX) +export GPU_PT_ENVIRONMENT_NAME := pytorch$(GPU_SUFFIX) ifeq ($(NGC_PUBLISH),) define CPU_TF2_TAGS --t $(DOCKERHUB_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(DOCKERHUB_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME)-$(VERSION) +-t $(DOCKERHUB_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) endef define CPU_PT_TAGS --t $(DOCKERHUB_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(DOCKERHUB_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME)-$(VERSION) +-t $(DOCKERHUB_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) endef else define CPU_TF2_TAGS -t $(DOCKERHUB_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(DOCKERHUB_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME)-$(VERSION) \ --t $(NGC_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(NGC_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME)-$(VERSION) +-t $(NGC_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) endef define CPU_PT_TAGS -t $(DOCKERHUB_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(DOCKERHUB_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME)-$(VERSION) \ --t $(NGC_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(NGC_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME)-$(VERSION) +-t $(NGC_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) endef endif @@ -336,7 +330,7 @@ build-tf2-cpu: build-cpu-py-39-base --push \ . -.PHONY: build-pt-cpu +.PHONY: build-pytorch-cpu build-pt-cpu: build-cpu-py-39-base docker buildx build -f Dockerfile-default-cpu \ --platform "$(PLATFORMS)" \ @@ -373,13 +367,11 @@ build-tf2-gpu: build-gpu-cuda-113-base --build-arg HOROVOD_GPU_OPERATIONS="$(HOROVOD_GPU_OPERATIONS)" \ --build-arg HOROVOD_GPU_ALLREDUCE="$(HOROVOD_GPU_ALLREDUCE)" \ -t $(DOCKERHUB_REGISTRY)/$(GPU_TF2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_TF2_ENVIRONMENT_NAME)-$(VERSION) \ -t $(NGC_REGISTRY)/$(GPU_TF2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(NGC_REGISTRY)/$(GPU_TF2_ENVIRONMENT_NAME)-$(VERSION) \ . -.PHONY: build-pt-gpu -build-pt-gpu: build-gpu-cuda-113-base +.PHONY: build-pytorch-gpu +build-pytorch-gpu: build-gpu-cuda-113-base docker build -f Dockerfile-default-gpu \ --build-arg BASE_IMAGE="$(DOCKERHUB_REGISTRY)/$(GPU_CUDA_113_BASE_NAME)-$(SHORT_GIT_HASH)" \ --build-arg TORCH_PIP="$(TORCH_PIP_GPU)" \ @@ -392,9 +384,7 @@ build-pt-gpu: build-gpu-cuda-113-base --build-arg HOROVOD_WITHOUT_MPI="$(HOROVOD_WITHOUT_MPI)" \ --build-arg HOROVOD_CPU_OPERATIONS="$(HOROVOD_CPU_OPERATIONS)" \ -t $(DOCKERHUB_REGISTRY)/$(GPU_PT_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_PT_ENVIRONMENT_NAME)-$(VERSION) \ -t $(NGC_REGISTRY)/$(GPU_PT_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(NGC_REGISTRY)/$(GPU_PT_ENVIRONMENT_NAME)-$(VERSION) \ . # torch 2.0 recipes @@ -402,25 +392,22 @@ TORCH2_VERSION := 2.0 TORCH2_PIP_CPU := torch==2.0.1+cpu torchvision==0.15.2+cpu torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cpu TORCH2_PIP_GPU := torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2+cu118 --index-url https://download.pytorch.org/whl/cu118 TORCH2_APEX_GIT_URL := https://github.com/determined-ai/apex.git@50ac8425403b98147cbb66aea9a2a27dd3fe7673 -export CPU_PT2_ENVIRONMENT_NAME := $(CPU_PREFIX_310)pytorch-$(TORCH2_VERSION)$(CPU_SUFFIX) -export GPU_PT2_ENVIRONMENT_NAME := $(CUDA_118_PREFIX)pytorch-$(TORCH2_VERSION)$(GPU_SUFFIX) +export CPU_PT2_ENVIRONMENT_NAME := pytorch2$(CPU_SUFFIX) +export GPU_PT2_ENVIRONMENT_NAME := pytorch2$(GPU_SUFFIX) ifeq ($(NGC_PUBLISH),) define CPU_PT2_TAGS --t $(DOCKERHUB_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(DOCKERHUB_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME)-$(VERSION) +-t $(DOCKERHUB_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) endef else define CPU_PT2_TAGS -t $(DOCKERHUB_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(DOCKERHUB_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME)-$(VERSION) \ --t $(NGC_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ --t $(NGC_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME)-$(VERSION) +-t $(NGC_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) endef endif -.PHONY: build-pt2-cpu -build-pt2-cpu: build-cpu-py-310-base +.PHONY: build-pytorch2-cpu +build-pytorch2-cpu: build-cpu-py-310-base docker buildx build -f Dockerfile-default-cpu \ --platform "$(PLATFORMS)" \ --build-arg BASE_IMAGE="$(DOCKERHUB_REGISTRY)/$(CPU_PY_310_BASE_NAME)-$(SHORT_GIT_HASH)" \ @@ -434,8 +421,8 @@ build-pt2-cpu: build-cpu-py-310-base --push \ . -.PHONY: build-pt2-gpu -build-pt2-gpu: build-gpu-cuda-118-base +.PHONY: build-pytorch2-gpu +build-pytorch2-gpu: build-gpu-cuda-118-base docker build -f Dockerfile-default-gpu \ --build-arg BASE_IMAGE="$(DOCKERHUB_REGISTRY)/$(GPU_CUDA_118_BASE_NAME)-$(SHORT_GIT_HASH)" \ --build-arg TORCH_PIP="$(TORCH2_PIP_GPU)" \ @@ -448,81 +435,83 @@ build-pt2-gpu: build-gpu-cuda-118-base --build-arg HOROVOD_WITHOUT_MPI="$(HOROVOD_WITHOUT_MPI)" \ --build-arg HOROVOD_CPU_OPERATIONS="$(HOROVOD_CPU_OPERATIONS)" \ -t $(DOCKERHUB_REGISTRY)/$(GPU_PT2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(DOCKERHUB_REGISTRY)/$(GPU_PT2_ENVIRONMENT_NAME)-$(VERSION) \ -t $(NGC_REGISTRY)/$(GPU_PT2_ENVIRONMENT_NAME)-$(SHORT_GIT_HASH) \ - -t $(NGC_REGISTRY)/$(GPU_PT2_ENVIRONMENT_NAME)-$(VERSION) \ . # tf1 and tf2.4 images are not published to NGC due to vulnerabilities. .PHONY: publish-tf2-cpu publish-tf2-cpu: - scripts/publish-docker.sh tf2-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PY_38_BASE_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) --no-push - scripts/publish-docker.sh tf2-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) --no-push + scripts/publish-docker.sh tf2-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PY_38_BASE_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) --no-push + scripts/publish-docker.sh tf2-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_TF2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) --no-push .PHONY: publish-tf2-gpu publish-tf2-gpu: - scripts/publish-docker.sh tf2-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_113_BASE_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) - scripts/publish-docker.sh tf2-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_TF2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) + scripts/publish-docker.sh tf2-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_113_BASE_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) + scripts/publish-docker.sh tf2-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_TF2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) ifneq ($(NGC_PUBLISH),) - scripts/publish-docker.sh tf2-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_TF2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) + scripts/publish-docker.sh tf2-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_TF2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) endif -.PHONY: publish-pt-cpu -publish-pt-cpu: - scripts/publish-docker.sh pt-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PY_38_BASE_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) --no-push - scripts/publish-docker.sh pt-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) --no-push +.PHONY: publish-pytorch-cpu +publish-pytorch-cpu: + scripts/publish-docker.sh pytorch-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PY_38_BASE_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) --no-push + scripts/publish-docker.sh pytorch-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PT_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) --no-push -.PHONY: publish-pt-gpu -publish-pt-gpu: - scripts/publish-docker.sh pt-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_113_BASE_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) - scripts/publish-docker.sh pt-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_PT_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) +.PHONY: publish-pytorch-gpu +publish-pytorch-gpu: + scripts/publish-docker.sh pytorch-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_113_BASE_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) + scripts/publish-docker.sh pytorch-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_PT_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) ifneq ($(NGC_PUBLISH),) - scripts/publish-docker.sh pt-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_PT_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) + scripts/publish-docker.sh pytorch-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_PT_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) endif -.PHONY: publish-pt2-cpu -publish-pt2-cpu: - scripts/publish-docker.sh pt2-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PY_310_BASE_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) --no-push - scripts/publish-docker.sh pt2-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) --no-push +.PHONY: publish-pytorch2-cpu +publish-pytorch2-cpu: + scripts/publish-docker.sh pytorch2-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PY_310_BASE_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) --no-push + scripts/publish-docker.sh pytorch2-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PT2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) --no-push -.PHONY: publish-pt2-gpu -publish-pt2-gpu: - scripts/publish-docker.sh pt2-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_118_BASE_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) - scripts/publish-docker.sh pt2-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_PT2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) +.PHONY: publish-pytorch2-gpu +publish-pytorch2-gpu: + scripts/publish-docker.sh pytorch2-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_118_BASE_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) + scripts/publish-docker.sh pytorch2-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_PT2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) ifneq ($(NGC_PUBLISH),) - scripts/publish-docker.sh pt2-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_PT2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) + scripts/publish-docker.sh pytorch2-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_PT2_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) endif -.PHONY: publish-deepspeed-gpu -publish-deepspeed-gpu: - scripts/publish-docker.sh deepspeed-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_DEEPSPEED_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) +.PHONY: publish-deepspeed +publish-deepspeed: + scripts/publish-docker.sh deepspeed-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_DEEPSPEED_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) ifneq ($(NGC_PUBLISH),) - scripts/publish-docker.sh deepspeed-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_DEEPSPEED_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) + scripts/publish-docker.sh deepspeed-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_DEEPSPEED_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) endif -.PHONY: publish-gpt-neox-deepspeed-gpu -publish-gpt-neox-deepspeed-gpu: - scripts/publish-docker.sh gpt-neox-deepspeed-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) +.PHONY: publish-gpt-neox-deepspeed +publish-gpt-neox-deepspeed: + scripts/publish-docker.sh gpt-neox-deepspeed-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) ifneq ($(NGC_PUBLISH),) - scripts/publish-docker.sh gpt-neox-deepspeed-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) + scripts/publish-docker.sh gpt-neox-deepspeed-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_GPT_NEOX_DEEPSPEED_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) endif .PHONY: publish-tf28-cpu publish-tf28-cpu: - scripts/publish-docker.sh tf28-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PY_38_BASE_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) --no-push - scripts/publish-docker.sh tf28-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) --no-push + scripts/publish-docker.sh tf28-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_PY_38_BASE_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) --no-push + scripts/publish-docker.sh tf28-cpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(CPU_TF28_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) --no-push .PHONY: publish-tf28-gpu publish-tf28-gpu: - scripts/publish-docker.sh tf28-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_112_BASE_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) - scripts/publish-docker.sh tf28-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_TF28_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) + scripts/publish-docker.sh tf28-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_CUDA_112_BASE_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) + scripts/publish-docker.sh tf28-gpu-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(GPU_TF28_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(ARTIFACTS_DIR) ifneq ($(NGC_PUBLISH),) - scripts/publish-docker.sh tf28-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_TF28_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) + scripts/publish-docker.sh tf28-gpu-$(WITH_MPI) $(NGC_REGISTRY)/$(GPU_TF28_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) endif -.PHONY: publish-pytorch10-tf27-rocm50 -publish-pytorch10-tf27-rocm50: - scripts/publish-docker.sh pytorch10-tf27-rocm50-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(ROCM50_TORCH_TF_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) +.PHONY: publish-pytorch13-tf210-rocm56 +publish-pytorch13-tf210-rocm56: + scripts/publish-docker.sh pytorch13-tf210-rocm56-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(ROCM56_TORCH13_TF_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) + +.PHONY: publish-pytorch20-tf210-rocm56 +publish-pytorch20-tf210-rocm56: + scripts/publish-docker.sh pytorch20-tf210-rocm56-$(WITH_MPI) $(DOCKERHUB_REGISTRY)/$(ROCM56_TORCH_TF_ENVIRONMENT_NAME) $(SHORT_GIT_HASH) $(VERSION) $(ARTIFACTS_DIR) .PHONY: publish-cloud-images publish-cloud-images: diff --git a/VERSION b/VERSION index 12a91df0..83b47304 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.26.4 +0.27.1 diff --git a/dockerfile_scripts/additional-requirements-rocm.txt b/dockerfile_scripts/additional-requirements-rocm.txt new file mode 100644 index 00000000..27585b8e --- /dev/null +++ b/dockerfile_scripts/additional-requirements-rocm.txt @@ -0,0 +1,16 @@ +attrdict3 +pandas +matplotlib +tensorflow-datasets==1.3.2 +Keras-Preprocessing[image] +# TODO(DET-4259) Remove this when we fix the circular dependency with the main repo. +petname +azure-storage-blob +Pillow>=8.3.2,<=9.5.0 +analytics-python +nvidia-ml-py +protobuf<=3.20.3 +tensorboard==2.10.1 +pynvml +tokenizers==0.13.0 +huggingface-hub==0.16.4 diff --git a/dockerfile_scripts/build_aws_rocm.sh b/dockerfile_scripts/build_aws_rocm.sh new file mode 100755 index 00000000..10528ef8 --- /dev/null +++ b/dockerfile_scripts/build_aws_rocm.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +set -x + +WITH_AWS_TRACE="" +if [ $# -gt 1 ] ; then + if [ "$2" = "1" ] ; then + # Tell AWS to build with trace messages enabled + WITH_AWS_TRACE="--enable-trace" + fi + if [ $# -gt 2 ] ; then + if [ "$3" = "1" ] ; then + WITH_MPICH=1; + fi + fi +fi + +OFI=$1 + +if [ "$OFI" = "1" ]; then + apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + tcsh + + # Install AWS_OFI_NCCL + AWS_VER=v1.4.0 + AWS_VER_NUM=1.4.0 + AWS_NAME=aws-ofi-rccl-cxi + AWS_FILE="${AWS_NAME}-${AWS_VER_NUM}" + # cuda install dir likely dependent on BaseOS (i.e. ubuntu 20.02) + # in case this changes in the future + + cuda_ver_str=`echo $CUDA_VERSION | awk -F "." '{print $1"."$2}'` + CUDA_DIR="/usr/local/cuda-$cuda_ver_str/targets/x86_64-linux" + GDRCOPY_HOME="/usr" + OFI_INSTALL_DIR=/container/ofi + ls $OFI_INSTALL_DIR + [ "$WITH_MPICH" = "1" ]&&MPI_INSTALL_DIR=${MPICH_INSTALL_DIR}||MPI_INSTALL_DIR=${OMPI_INSTALL_DIR} + AWS_CONFIG_OPTIONS="--prefix ${AWS_PLUGIN_INSTALL_DIR} \ + --with-libfabric=${OFI_INSTALL_DIR} \ + --with-rccl=${HOROVOD_NCCL_HOME} \ + --with-mpi=${MPI_INSTALL_DIR} \ + --with-hip=${ROCM_DIR} ${WITH_AWS_TRACE}" + + AWS_SRC_DIR=/tmp/aws-ofi-rccl + #AWS_BASE_URL="https://github.com/aws/aws-ofi-nccl/archive/refs/tags" + AWS_BASE_URL="https://github.com/ROCmSoftwarePlatform/aws-ofi-rccl/archive/refs/heads/" + #AWS_URL="${AWS_BASE_URL}/${AWS_VER}.tar.gz" + AWS_URL="${AWS_BASE_URL}/cxi.zip" + # The INTERNAL_AWS_DS variable must exist in the env + ## INTERNAL_AWS_DS="http://set.to.your.server.name" + ## INTERNAL_AWS_PATH="/set/to/aws/tarball/path" + #if [ -z "$INTERNAL_AWS_DS" ] + #then + # echo "Using EXTERNAL AWS $AWS_URL" + # aws-ofi-nccl-1.4.0 + # AWS_NAME="${AWS_NAME}-${AWS_VER_NUM}" + #else + # AWS_BASE_URL="http://${INTERNAL_AWS_DS}${INTERNAL_AWS_PATH}" + # AWS_URL="${AWS_BASE_URL}/${AWS_NAME}.tar.gz" + # echo "Using INTERNAL AWS $AWS_URL" + #fi + + mkdir -p ${AWS_SRC_DIR} && \ + cd ${AWS_SRC_DIR} && \ + git clone https://github.com/ROCmSoftwarePlatform/aws-ofi-rccl && \ + cd aws-ofi-rccl && \ + ./autogen.sh && \ + CC=hipcc ./configure ${AWS_CONFIG_OPTIONS} && \ + make && \ + make install && \ + cd /tmp && \ + rm -rf ${AWS_SRC_DIR} +fi diff --git a/dockerfile_scripts/ompi_rocm.sh b/dockerfile_scripts/ompi_rocm.sh new file mode 100755 index 00000000..6bff7005 --- /dev/null +++ b/dockerfile_scripts/ompi_rocm.sh @@ -0,0 +1,121 @@ +#!/bin/bash + +set -x + +# See if we should add ROCM to the OMPI build +OMPI_WITH_ROCM="" +if [ $# -gt 2 ] ; then + if [ "$3" = "1" ] ; then + # Tell OMPI to look for rocm in the default location + OMPI_WITH_ROCM="--with-rocm" + fi +fi + +if [ "$4" = "1" ];then WITH_MPICH=1;fi + +OS_VER=$1 +OFI=$2 +if [ "$OFI" = "1" ]; then + # Install OFI + OFI_VER=1.19.0 + OFI_CONFIG_OPTIONS="--prefix ${OFI_INSTALL_DIR}" + OFI_SRC_DIR=/tmp/ofi-src + OFI_BASE_URL="https://github.com/ofiwg/libfabric/releases/download" + OFI_URL="${OFI_BASE_URL}/v${OFI_VER}/libfabric-${OFI_VER}.tar.bz2" + + mkdir -p ${OFI_SRC_DIR} && \ + mkdir -p ${OFI_INSTALL_DIR} && \ + cd ${OFI_SRC_DIR} && \ + wget ${OFI_URL} && \ + tar -xf libfabric-${OFI_VER}.tar.bz2 && \ + cd libfabric-${OFI_VER} && \ + ./configure ${OFI_CONFIG_OPTIONS} && \ + make install && \ + cd /tmp && \ + rm -rf ${OFI_SRC_DIR} + + #OMPI CONFIG ARGS FOR OFI + OMPI_CONFIG_OPTIONS_VAR="--prefix ${OMPI_INSTALL_DIR} --enable-orterun-prefix-by-default --enable-shared --with-cma --with-pic --enable-mpi-cxx --enable-mpi-thread-multiple --with-libfabric=${OFI_INSTALL_DIR} --without-ucx --with-pmi --with-pmix=internal ${OMPI_WITH_ROCM}" + +#echo OMPI_CONFIG_OPTIONS_VAR $OMPI_CONFIG_OPTIONS_VAR= + +#exit 99 + +else + # Install the Mellanox OFED stack. Note that this is dependent on + # what the base OS is (ie, Ubuntu 20.04) so if that changes then + # this needs updated. MOFED_VER=5.0-2.1.8.0 MOFED_VER=5.5-1.0.3.2 + MOFED_VER=5.4-3.4.0.0 + PLATFORM=x86_64 + MOFED_TAR_URL="http://content.mellanox.com/ofed/MLNX_OFED-${MOFED_VER}" + MOFED_TAR="MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}.tgz" + TMP_INSTALL_DIR=/tmp/ofed + + mkdir -p ${TMP_INSTALL_DIR} && \ + cd ${TMP_INSTALL_DIR} && \ + wget --quiet "${MOFED_TAR_URL}/${MOFED_TAR}" && \ + tar -xvf ${MOFED_TAR} && \ + MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}/mlnxofedinstall \ + --user-space-only --without-fw-update --all --force \ + --skip-unsupported-devices-check && \ + rm -rf MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}.tgz \ + MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM} \ + MLNX_OFED_LINUX.*.logs && \ + rm -rf ${TMP_INSTALL_DIR} + + # Install UCX + UCX_VER=1.10.1 + UCX_CONFIG_OPTIONS="--prefix ${UCX_INSTALL_DIR} --enable-mt" + UCX_SRC_DIR=/tmp/ucx-src + UCX_BASE_URL="https://github.com/openucx/ucx/releases/download" + UCX_URL="${UCX_BASE_URL}/v${UCX_VER}/ucx-${UCX_VER}.tar.gz" + + mkdir -p ${UCX_SRC_DIR} && \ + cd ${UCX_SRC_DIR} && \ + wget ${UCX_URL} && \ + tar -xzf ucx-${UCX_VER}.tar.gz && \ + cd ucx-${UCX_VER} && \ + ./contrib/configure-release ${UCX_CONFIG_OPTIONS} && \ + make -j8 install && \ + cd /tmp && \ + rm -rf ${UCX_SRC_DIR} + + #OMPI CONFIG ARGS FOR UCX + OMPI_CONFIG_OPTIONS_VAR="--prefix ${OMPI_INSTALL_DIR} --enable-shared --with-verbs --with-cma --with-pic --enable-mpi-cxx --enable-mpi-thread-multiple --with-pmi --with-pmix=internal --with-platform=contrib/platform/mellanox/optimized --with-ucx=/container/ucx ${OMPI_WITH_ROCM}" + +fi + +if [ "$WITH_MPICH" != "1" ]; then +# Install OMPI +OMPI_VER=v4.1 + OMPI_VER_NUM=4.1.0 + OMPI_CONFIG_OPTIONS=${OMPI_CONFIG_OPTIONS_VAR} + OMPI_SRC_DIR=/tmp/openmpi-src + OMPI_BASE_URL="https://download.open-mpi.org/release/open-mpi" + OMPI_URL="${OMPI_BASE_URL}/${OMPI_VER}/openmpi-${OMPI_VER_NUM}.tar.gz" + + mkdir -p ${OMPI_SRC_DIR} && \ + cd ${OMPI_SRC_DIR} && \ + wget ${OMPI_URL} && \ + tar -xzf openmpi-${OMPI_VER_NUM}.tar.gz && \ + cd openmpi-${OMPI_VER_NUM} && \ + ./configure ${OMPI_CONFIG_OPTIONS} && \ + make && \ + make install && \ + cd /tmp && \ + rm -rf ${OMPI_SRC_DIR} +else +MPICH_VER=4.1.2 +MPICH_CONFIG_OPTIONS="--with-device=ch4:ofi --with-libfabric=/container/ofi --prefix=${MPICH_INSTALL_DIR} --disable-fortran" +MPICH_URL="http://www.mpich.org/static/downloads/${MPICH_VER}/mpich-${MPICH_VER}.tar.gz" +MPICH_SRC_DIR=/tmp/mpich-src + +mkdir -p ${MPICH_SRC_DIR} &&\ + cd ${MPICH_SRC_DIR} &&\ + curl -fSsL --retry 3 "${MPICH_URL}" | tar -xz --strip 1 &&\ + ./configure ${MPICH_CONFIG_OPTIONS} &&\ + make &&\ + make install &&\ + rm -rf "${MPICH_SRC_DIR}" + +fi diff --git a/dockerfile_scripts/scrape_libs.sh b/dockerfile_scripts/scrape_libs.sh index 1c2c47ad..0ed1d2b6 100755 --- a/dockerfile_scripts/scrape_libs.sh +++ b/dockerfile_scripts/scrape_libs.sh @@ -1,12 +1,18 @@ #!/bin/bash +WHOAMI=$(whoami) # Only scrape host libs if AWS/NCCL/OFI was built for this image if [ -d /container/aws/lib ] then - # See if we mounted in host libs in the expected location - host_dir="/host" + host_dir="/det_libfabric" + if [ ! -d "$host_dir" ]; then + host_dir="/det_host" + if [ ! -d "$host_dir" ]; then + host_dir="/host" + fi + fi if [ -d "$host_dir" ]; then - libfabric=`find /host -name libfabric.so 2>/dev/null` + libfabric=`find $host_dir -name libfabric.so 2>/dev/null` libfabric_dir="$(dirname "$libfabric")" if [[ ! -z "$libfabric" ]] ; then # Need libfabric to be first in the LD_LIBRARY_PATH to @@ -15,9 +21,9 @@ then # after the container ones so we append the rest of the # host libs. tmp_dir="`pwd`/tmp" tmp_dir="/var/tmp" - tmp_lib_dir="$tmp_dir/$(whoami)/detAI/lib" + tmp_lib_dir="$tmp_dir/${WHOAMI}/detAI/lib" mkdir -p $tmp_lib_dir - for lib in `/bin/ls $libfabric_dir/ | grep libfabric` ; do + for lib in `/bin/ls $libfabric_dir/ | grep -elibfabric -ecxi` ; do ln -s $libfabric_dir/$lib $tmp_lib_dir 2>/dev/null done # Prepend the tmp dir for the host libfabric @@ -27,13 +33,26 @@ then # to set these paths based on where we find the libs that # libfabric is dependent upon. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$libfabric_dir - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/host/usr/lib64 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/host/usr/local/lib64 + else + echo "libfabric not found within $host_dir." >&2 fi # end if found libfabric.so - fi # end if /host exists + else echo "no suitable mounts available." >&2 + fi # end if /det_libfabric exists + # See if we mounted in host libs in the expected location + + host_dir="/det_host" + if [ ! -d "$host_dir" ]; then + host_dir="/host" + fi + if [ -d "$host_dir" ]; then + # to set these paths based on where we find the libs that + # libfabric is dependent upon. + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$host_dir/usr/lib64 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$host_dir/usr/local/lib64 + fi # end if /det_host exists export LD_LIBRARY_PATH=/container/aws/lib:$LD_LIBRARY_PATH - tmp_nvcache_dir=$(mktemp -d -p /var/tmp $(whoami)-nvcache-XXXXXXXX) + tmp_nvcache_dir=$(mktemp -d -p /var/tmp ${WHOAMI}-nvcache-XXXXXXXX) # The following env variables are only set if they are curretly unset,empty or null # To override one or more of these variales, simply set them prior to the enrtrypoint @@ -55,7 +74,51 @@ then then export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libffi.so.7:$LD_PRELOAD fi +# Execute what we were told to execute + + if [ "$WITH_RCCL" = "1" ]; then + #export LD_LIBRARY_PATH=/scratch2/${WHOAMI}/lib/libfabric-1.21.1:/scratch2/${WHOAMI}/lib:/container/aws/lib:$LD_LIBRARY_PATH + #export LD_LIBRARY_PATH=/scratch2/${WHOAMI}/lib/libfabric-1.21.1:/scratch2/${WHOAMI}/lib:$LD_LIBRARY_PATH + export TF_FORCE_GPU_ALLOW_GROWTH=true + export CUDA_CACHE_PATH=/tmp/${WHOAMI}.nvcache + export FI_CXI_COMPAT=0 + export NCCL_SOCKET_IFNAME="hsn0" + #export FI_CXI_DISABLE_HOST_REGISTER=1 + export CUDA_VISIBLE_DEVICES="0,1,2,3" + + export FI_CXI_DEFAULT_TX_SIZE=1024 + export FI_CXI_DISABLE_CQ_HUGETLB=1 + export FI_CXI_DEFAULT_CQ_SIZE=131072 + export FI_CXI_DISABLE_HOST_REGISTER=1 + export FI_CXI_RX_MATCH_MODE=software + export FI_CXI_RDZV_PROTO=alt_read + export FI_PROVIDER=^ofi_rxm,efa,ofi_rxd + export FI_HMEM_CUDA_USE_GDRCOPY=1 + export FI_CXI_REQ_BUF_SIZE=8338608 + export FI_LOG_PROV=cxi + export FI_LOG_LEVEL=info + export FI_LOG_SUBSYS=domain + export FI_CXI_TELEMENTRY=pct_no_mst_nacks,pct_mst_hit_on_som,pct_sct_timeouts,pct_spt_timeouts,pct_tct_timeouts + + export CXI_FORK_SAFE=1 + export FI_EFA_FORK_SAFE=${CXI_FORK_SAFE} + # Avoid hang with NCCL/RCCL and libfabric + export FI_MR_CACHE_MONITOR=userfaultfd + + export NCCL_DEBUG=TRACE + export RCCL_DEBUG=${NCCL_DEBUG} + + if [ "$WITH_NFS_WORKAROUND" = "1" ]; then + export MIOPEN_USER_DB_PATH="/tmp/${WHOAMI}_${SLURM_LOCALID}" + export MIOPEN_USER_CACHE_PATH="$MIOPEN_USER_DB_PATH/.cache" + export MIOPEN_CACHE_DIR=${MIOPEN_USER_CACHE_PATH} + echo "MIOPEN_USER_DB_PATH: $MIOPEN_USER_DB_PATH, cache dir: $MIOPEN_USER_CACHE_PATH" + mkdir -p $MIOPEN_USER_DB_PATH + mkdir -p $MIOPEN_USER_CACHE_PATH/miopen + export HOME=${MIOPEN_USER_DB_PATH} + + fi + fi fi -# Execute what we were told to execute exec "${@}" diff --git a/scripts/publish-docker.sh b/scripts/publish-docker.sh index cf91f1b0..a5b0423e 100755 --- a/scripts/publish-docker.sh +++ b/scripts/publish-docker.sh @@ -3,22 +3,20 @@ set -e set -x -if [ "$#" -lt 4 ] || [ "$#" -gt 6 ] || [ "$#" -eq 6 ] && [ "$6" != "--no-push" ]; then - echo "usage: $0 LOG_NAME BASE_TAG HASH VERSION ARTIFACTS_DIR [--no-push]" >&2 +if [ "$#" -gt 5 ] || [ "$#" -eq 5 ] && [ "$5" != "--no-push" ]; then + echo "usage: $0 LOG_NAME BASE_TAG HASH ARTIFACTS_DIR [--no-push]" >&2 exit 1 fi log_name="$1" base_tag="$2" hash="$3" -version="$4" -artifacts="$5" +artifacts="$4" underscore_name="$(echo -n "$log_name" | tr - _)" -if [ "$#" -lt 6 ] ; then +if [ "$#" -lt 5 ] ; then docker push "$base_tag-$hash" - docker push "$base_tag-$version" fi if [ -n "$artifacts" ]; then @@ -27,6 +25,5 @@ if [ -n "$artifacts" ]; then log_file="$artifacts/publish-$log_name" ( echo "${underscore_name}_hashed: $base_tag-$hash" - echo "${underscore_name}_versioned: $base_tag-$version" ) > "$log_file" fi diff --git a/version_matrix.yaml b/version_matrix.yaml new file mode 100644 index 00000000..4b2f8102 --- /dev/null +++ b/version_matrix.yaml @@ -0,0 +1,57 @@ +git_hash: +images: + - pytorch-deepspeed: + pytorch_version: 1.10.2 + deepspeed_version: 0.8.3 + python_version: 3.9.16 + ubuntu_version: 20.04 + - gpt-neox-deepspeed: + pytorch_version: 1.10.2 + deepspeed_version: 0.8.3+https://github.com/determined-ai/deepspeed.git@eleuther_dai + python_version: 3.9.16 + ubuntu_version: 20.04 + - tf28-cpu: + tensorflow_version: 2.8.4 + horovod_version: 0.24.2 + - tf28-gpu: + tensorflow_version: 2.8.3 + horovod_version: 0.24.2 + ubuntu_version: 20.04 + - tf2-cpu: + tensorflow_version: 2.11.1 + horovod_version: 0.28.1 + ubuntu_version: 20.04 + - tf2-gpu: + tensorflow_version: 2.11.1 + horovod_version: 0.28.1 + ubuntu_version: 20.04 + - pytorch-cpu: + pytorch_version: 1.12 + horovod_version: 0.28.1 + ubuntu_version: 20.04 + - pytorch-gpu: + pytorch_version: 1.12 + horovod_version: 0.28.1 + ubuntu_version: 20.04 + - pytorch2-cpu: + pytorch_version: 2.0 + horovod_version: 0.28.1 + ubuntu_version: 20.04 + - pytorch2-gpu: + pytorch_version: 2.0 + horovod_version: 0.28.1 + ubuntu_version: 20.04 + - pytorch13-tf210-rocm56: + pytorch_version: 1.13.1 + tensorflow_version: 2.10.1.540 + horovod_version: 0.28.1 + python_version: 3.8 + ubuntu_version: 20.04 + rocm_version: 5.6 + - pytorch20-tf210-rocm56: + pytorch_version: 2.0.1 + tensorflow_version: 2.10.1.540 + horovod_version: 0.28.1 + python_version: 3.8 + ubuntu_version: 20.04 + rocm_version: 5.6