Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfiles for Neuron DLC with SDK 2.20.0 #21

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docker/pytorch/inference/1.13.1/Dockerfile.neuron
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM public.ecr.aws/docker/library/ubuntu:20.04

LABEL dlc_major_version="1"

Check failure on line 3 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3048 style: Invalid label key.
LABEL maintainer="Amazon AI"
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true

# Neuron SDK components version numbers
ARG NEURON_FRAMEWORK_VERSION=1.13.1.2.10.12.0
ARG NEURON_CC_VERSION=1.23.5.0
ARG NEURONX_TOOLS_VERSION=2.18.3.0
ARG NEURON_FRAMEWORK_VERSION=1.13.1.2.11.7.0
ARG NEURON_CC_VERSION=1.24.0.0
ARG NEURONX_TOOLS_VERSION=2.19.0.0

ARG PYTHON=python3.10
ARG PYTHON_VERSION=3.10.12
Expand All @@ -22,7 +22,7 @@
ENV SAGEMAKER_SERVING_MODULE=sagemaker_pytorch_serving_container.serving:main
ENV TEMP=/home/model-server/tmp

RUN apt-get update \

Check failure on line 25 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:openjdk-r/ppa \
Expand Down Expand Up @@ -53,9 +53,9 @@
&& apt-get clean

RUN echo "deb https://apt.repos.neuron.amazonaws.com focal main" > /etc/apt/sources.list.d/neuron.list
RUN wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | apt-key add -

Check failure on line 56 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check

RUN apt-get update \

Check failure on line 58 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3015 info: Avoid additional packages by specifying `--no-install-recommends`
&& apt-get install -y aws-neuronx-tools=$NEURONX_TOOLS_VERSION \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/tmp* \
Expand All @@ -66,7 +66,7 @@
mv /etc/ssl/certs/java/cacerts.jks /etc/ssl/certs/java/cacerts; \
/var/lib/dpkg/info/ca-certificates-java.postinst configure;

RUN curl -L -o ~/mambaforge.sh https://github.com/conda-forge/miniforge/releases/download/${MAMBA_VERSION}/Mambaforge-${MAMBA_VERSION}-Linux-x86_64.sh \

Check failure on line 69 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL4001 warning: Either use Wget or Curl but not both
&& chmod +x ~/mambaforge.sh \
&& ~/mambaforge.sh -b -p /opt/conda \
&& rm ~/mambaforge.sh \
Expand All @@ -85,7 +85,7 @@

&& /opt/conda/bin/conda clean -ya

RUN conda install -c conda-forge \

Check failure on line 88 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`

Check failure on line 88 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
scikit-learn \
h5py \
requests \
Expand All @@ -96,7 +96,7 @@
enum-compat \
ipython

RUN pip install --no-cache-dir -U \

Check failure on line 99 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`
opencv-python>=4.8.1.78 \
"numpy<1.24,>1.21" \
"scipy>=1.8.0" \
Expand All @@ -107,7 +107,7 @@
boto3 \
cryptography

RUN pip install neuron-cc==$NEURON_CC_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com \

Check failure on line 110 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
torch-neuron==$NEURON_FRAMEWORK_VERSION \
&& pip install -U protobuf==3.19.5 \
torchserve==${TORCHSERVE_VERSION} \
Expand All @@ -131,7 +131,7 @@

RUN chmod +x /usr/local/bin/deep_learning_container.py

RUN pip install --no-cache-dir "sagemaker-pytorch-inference==${SM_TOOLKIT_VERSION}"

Check failure on line 134 in docker/pytorch/inference/1.13.1/Dockerfile.neuron

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

RUN HOME_DIR=/root \
&& curl -o ${HOME_DIR}/oss_compliance.zip https://aws-dlinfra-utilities.s3.amazonaws.com/oss_compliance.zip \
Expand Down
275 changes: 266 additions & 9 deletions docker/pytorch/inference/1.13.1/Dockerfile.neuron.cve_allowlist.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docker/pytorch/inference/1.13.1/Dockerfile.neuronx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM public.ecr.aws/docker/library/ubuntu:20.04

LABEL dlc_major_version="1"

Check failure on line 3 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3048 style: Invalid label key.
LABEL maintainer="Amazon AI"
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true

# Neuron SDK components version numbers
ARG NEURONX_FRAMEWORK_VERSION=1.13.1.1.15.0
ARG NEURONX_DISTRIBUTED_VERSION=0.8.0
ARG NEURONX_CC_VERSION=2.14.227.0
ARG NEURONX_TRANSFORMERS_VERSION=0.11.351
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.21.46.0-69b77134b
ARG NEURONX_RUNTIME_LIB_VERSION=2.21.41.0-fb1705f5f
ARG NEURONX_TOOLS_VERSION=2.18.3.0
ARG NEURONX_FRAMEWORK_VERSION=1.13.1.1.16.0
ARG NEURONX_DISTRIBUTED_VERSION=0.9.0
ARG NEURONX_CC_VERSION=2.15.128.0
ARG NEURONX_TRANSFORMERS_VERSION=0.12.313
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.22.26.0-17a033bc8
ARG NEURONX_RUNTIME_LIB_VERSION=2.22.14.0-6e27b8d5b
ARG NEURONX_TOOLS_VERSION=2.19.0.0

ARG PYTHON=python3.10
ARG PYTHON_VERSION=3.10.12
Expand All @@ -26,7 +26,7 @@
ENV SAGEMAKER_SERVING_MODULE=sagemaker_pytorch_serving_container.serving:main
ENV TEMP=/home/model-server/tmp

RUN apt-get update \

Check failure on line 29 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:openjdk-r/ppa \
Expand Down Expand Up @@ -57,9 +57,9 @@
&& apt-get clean

RUN echo "deb https://apt.repos.neuron.amazonaws.com focal main" > /etc/apt/sources.list.d/neuron.list
RUN wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | apt-key add -

Check failure on line 60 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check

RUN apt-get update \

Check failure on line 62 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3015 info: Avoid additional packages by specifying `--no-install-recommends`
&& apt-get install -y \
aws-neuronx-tools=$NEURONX_TOOLS_VERSION \
aws-neuronx-collectives=$NEURONX_COLLECTIVES_LIB_VERSION \
Expand All @@ -73,7 +73,7 @@
mv /etc/ssl/certs/java/cacerts.jks /etc/ssl/certs/java/cacerts; \
/var/lib/dpkg/info/ca-certificates-java.postinst configure;

RUN curl -L -o ~/mambaforge.sh https://github.com/conda-forge/miniforge/releases/download/${MAMBA_VERSION}/Mambaforge-${MAMBA_VERSION}-Linux-x86_64.sh \

Check failure on line 76 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL4001 warning: Either use Wget or Curl but not both
&& chmod +x ~/mambaforge.sh \
&& ~/mambaforge.sh -b -p /opt/conda \
&& rm ~/mambaforge.sh \
Expand All @@ -92,7 +92,7 @@

&& /opt/conda/bin/conda clean -ya

RUN conda install -c conda-forge \

Check failure on line 95 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`

Check failure on line 95 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
scikit-learn \
h5py \
requests \
Expand All @@ -103,7 +103,7 @@
enum-compat \
ipython

RUN pip install --no-cache-dir -U \

Check failure on line 106 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`
opencv-python>=4.8.1.78 \
"numpy<1.24,>1.21" \
"scipy>=1.8.0" \
Expand All @@ -114,7 +114,7 @@
boto3 \
cryptography

RUN pip install -U --extra-index-url https://pip.repos.neuron.amazonaws.com \

Check failure on line 117 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
neuronx-cc==$NEURONX_CC_VERSION \
torch-neuronx==$NEURONX_FRAMEWORK_VERSION \
transformers-neuronx==$NEURONX_TRANSFORMERS_VERSION \
Expand All @@ -141,7 +141,7 @@

RUN chmod +x /usr/local/bin/deep_learning_container.py

RUN pip install --no-cache-dir "sagemaker-pytorch-inference==${SM_TOOLKIT_VERSION}"

Check failure on line 144 in docker/pytorch/inference/1.13.1/Dockerfile.neuronx

View workflow job for this annotation

GitHub Actions / dockerfile-linter

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

# patch default_pytorch_inference_handler.py to import torch_neuronx
RUN DEST_DIR=$(python -c "import os.path, sagemaker_pytorch_serving_container; print(os.path.dirname(sagemaker_pytorch_serving_container.__file__))") \
Expand Down
275 changes: 266 additions & 9 deletions docker/pytorch/inference/1.13.1/Dockerfile.neuronx.cve_allowlist.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docker/pytorch/inference/2.1.2/Dockerfile.neuronx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ LABEL maintainer="Amazon AI"
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true

# Neuron SDK components version numbers
ARG NEURONX_DISTRIBUTED_VERSION=0.8.0
ARG NEURONX_CC_VERSION=2.14.227.0
ARG NEURONX_FRAMEWORK_VERSION=2.1.2.2.2.0
ARG NEURONX_TRANSFORMERS_VERSION=0.11.351
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.21.46.0-69b77134b
ARG NEURONX_RUNTIME_LIB_VERSION=2.21.41.0-fb1705f5f
ARG NEURONX_TOOLS_VERSION=2.18.3.0
ARG NEURONX_DISTRIBUTED_VERSION=0.9.0
ARG NEURONX_CC_VERSION=2.15.128.0
ARG NEURONX_FRAMEWORK_VERSION=2.1.2.2.3.0
ARG NEURONX_TRANSFORMERS_VERSION=0.12.313
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.22.26.0-17a033bc8
ARG NEURONX_RUNTIME_LIB_VERSION=2.22.14.0-6e27b8d5b
ARG NEURONX_TOOLS_VERSION=2.19.0.0

ARG PYTHON=python3.10
ARG PYTHON_VERSION=3.10.12
Expand Down
275 changes: 266 additions & 9 deletions docker/pytorch/inference/2.1.2/Dockerfile.neuronx.cve_allowlist.json

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions docker/pytorch/training/1.13.1/Dockerfile.neuronx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ LABEL maintainer="Amazon AI"
LABEL dlc_major_version="1"

# Neuron SDK components version numbers
ARG NEURONX_FRAMEWORK_VERSION=1.13.1.1.15.0
ARG NEURONX_DISTRIBUTED_VERSION=0.8.0
ARG NEURONX_CC_VERSION=2.14.227.0
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.21.46.0-69b77134b
ARG NEURONX_RUNTIME_LIB_VERSION=2.21.41.0-fb1705f5f
ARG NEURONX_TOOLS_VERSION=2.18.3.0
ARG NEURONX_FRAMEWORK_VERSION=1.13.1.1.16.0
ARG NEURONX_DISTRIBUTED_VERSION=0.9.0
ARG NEURONX_DISTRIBUTED_TRAINING_VERSION=1.0.0
ARG NEURONX_CC_VERSION=2.15.128.0
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.22.26.0-17a033bc8
ARG NEURONX_RUNTIME_LIB_VERSION=2.22.14.0-6e27b8d5b
ARG NEURONX_TOOLS_VERSION=2.19.0.0

ARG PYTHON=python3.10
ARG PYTHON_VERSION=3.10.12
Expand Down Expand Up @@ -142,7 +143,8 @@ RUN mkdir -p /etc/pki/tls/certs && cp /etc/ssl/certs/ca-certificates.crt /etc/pk
RUN ${PIP} config set global.extra-index-url https://pip.repos.neuron.amazonaws.com \
&& ${PIP} install --force-reinstall torch-neuronx==$NEURONX_FRAMEWORK_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com \
&& ${PIP} install --force-reinstall neuronx-cc==$NEURONX_CC_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com \
&& ${PIP} install --force-reinstall --no-deps neuronx_distributed==$NEURONX_DISTRIBUTED_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com
&& ${PIP} install --force-reinstall --no-deps neuronx_distributed==$NEURONX_DISTRIBUTED_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com \
&& ${PIP} install --force-reinstall --no-deps neuronx_distributed_training==$NEURONX_DISTRIBUTED_TRAINING_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com

# attrs, neuronx-cc required: >=19.2.0, sagemaker <24,>=23.1.0
# protobuf neuronx-cc<4, sagemaker-training >=3.9.2,<=3.20.3
Expand Down
309 changes: 270 additions & 39 deletions docker/pytorch/training/1.13.1/Dockerfile.neuronx.cve_allowlist.json

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions docker/pytorch/training/2.1.2/Dockerfile.neuronx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ LABEL maintainer="Amazon AI"
LABEL dlc_major_version="1"

# Neuron SDK components version numbers
ARG NEURONX_DISTRIBUTED_VERSION=0.8.0
ARG NEURONX_CC_VERSION=2.14.227.0
ARG NEURONX_FRAMEWORK_VERSION=2.1.2.2.2.0
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.21.46.0-69b77134b
ARG NEURONX_RUNTIME_LIB_VERSION=2.21.41.0-fb1705f5f
ARG NEURONX_TOOLS_VERSION=2.18.3.0
ARG NEURONX_DISTRIBUTED_VERSION=0.9.0
ARG NEURONX_DISTRIBUTED_TRAINING_VERSION=1.0.0
ARG NEURONX_CC_VERSION=2.15.128.0
ARG NEURONX_FRAMEWORK_VERSION=2.1.2.2.3.0
ARG NEURONX_COLLECTIVES_LIB_VERSION=2.22.26.0-17a033bc8
ARG NEURONX_RUNTIME_LIB_VERSION=2.22.14.0-6e27b8d5b
ARG NEURONX_TOOLS_VERSION=2.19.0.0

ARG PYTHON=python3.10
ARG PYTHON_VERSION=3.10.12
Expand Down Expand Up @@ -142,7 +143,8 @@ RUN mkdir -p /etc/pki/tls/certs && cp /etc/ssl/certs/ca-certificates.crt /etc/pk
RUN ${PIP} config set global.extra-index-url https://pip.repos.neuron.amazonaws.com \
&& ${PIP} install --force-reinstall torch-neuronx==$NEURONX_FRAMEWORK_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com \
&& ${PIP} install --force-reinstall neuronx-cc==$NEURONX_CC_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com \
&& ${PIP} install --force-reinstall --no-deps neuronx_distributed==$NEURONX_DISTRIBUTED_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com
&& ${PIP} install --force-reinstall --no-deps neuronx_distributed==$NEURONX_DISTRIBUTED_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com \
&& ${PIP} install --force-reinstall --no-deps neuronx_distributed_training==$NEURONX_DISTRIBUTED_TRAINING_VERSION --extra-index-url https://pip.repos.neuron.amazonaws.com

# attrs, neuronx-cc required: >=19.2.0, sagemaker <24,>=23.1.0
# protobuf neuronx-cc<4, sagemaker-training >=3.9.2,<=3.20.3
Expand Down
Loading