-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docker] upgrade cuda 12.1 support for DJLServing (#1370)
- Loading branch information
Qing Lan
authored
Dec 9, 2023
1 parent
c7986f2
commit 6acb80a
Showing
9 changed files
with
28 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,15 @@ | |
# or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" | ||
# BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for | ||
# the specific language governing permissions and limitations under the License. | ||
ARG version=11.8.0-cudnn8-devel-ubuntu20.04 | ||
ARG version=12.1.1-cudnn8-devel-ubuntu22.04 | ||
|
||
FROM nvidia/cuda:$version as base | ||
|
||
ARG djl_version=0.24.0~SNAPSHOT | ||
ARG cuda_version=cu118 | ||
ARG torch_version=2.0.1 | ||
ARG torch_vision_version=0.15.2 | ||
ARG python_version=3.9 | ||
ARG djl_version=0.26.0~SNAPSHOT | ||
ARG cuda_version=cu121 | ||
ARG torch_version=2.1.1 | ||
ARG torch_vision_version=0.16.1 | ||
ARG python_version=3.10 | ||
|
||
RUN mkdir -p /opt/djl/conf && \ | ||
mkdir -p /opt/ml/model | ||
|
@@ -31,10 +31,10 @@ ENV MODEL_SERVER_HOME=/opt/djl | |
ENV DJL_CACHE_DIR=/tmp/.djl.ai | ||
ENV HUGGINGFACE_HUB_CACHE=/tmp | ||
ENV TRANSFORMERS_CACHE=/tmp | ||
ENV PYTORCH_LIBRARY_PATH=/usr/local/lib/python3.9/dist-packages/torch/lib | ||
ENV PYTORCH_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages/torch/lib | ||
ENV PYTORCH_PRECXX11=true | ||
ENV PYTORCH_VERSION=${torch_version} | ||
ENV PYTORCH_FLAVOR=cu118-precxx11 | ||
ENV PYTORCH_FLAVOR=cu121-precxx11 | ||
# TODO: remove TORCH_CUDNN_V8_API_DISABLED once PyTorch bug is fixed | ||
ENV TORCH_CUDNN_V8_API_DISABLED=1 | ||
ENV JAVA_OPTS="-Xmx1g -Xms1g -XX:+ExitOnOutOfMemoryError -Dai.djl.default_engine=PyTorch" | ||
|
@@ -53,9 +53,9 @@ RUN chmod +x /usr/local/bin/dockerd-entrypoint.sh && \ | |
scripts/install_djl_serving.sh $djl_version ${torch_version} && \ | ||
scripts/install_python.sh ${python_version} && \ | ||
scripts/install_s5cmd.sh x64 && \ | ||
pip3 install numpy && pip3 install torch==${torch_version} torchvision==${torch_vision_version} --extra-index-url https://download.pytorch.org/whl/cu118 && \ | ||
pip3 install numpy && pip3 install torch==${torch_version} torchvision==${torch_vision_version} --extra-index-url https://download.pytorch.org/whl/cu121 && \ | ||
scripts/patch_oss_dlc.sh python && \ | ||
scripts/security_patch.sh pytorch-cu118 && \ | ||
scripts/security_patch.sh pytorch-gpu && \ | ||
useradd -m -d /home/djl djl && \ | ||
chown -R djl:djl /opt/djl && \ | ||
rm -rf scripts && pip3 cache purge && \ | ||
|
@@ -69,8 +69,8 @@ CMD ["serve"] | |
|
||
LABEL maintainer="[email protected]" | ||
LABEL dlc_major_version="1" | ||
LABEL com.amazonaws.ml.engines.sagemaker.dlc.framework.djl.pytorch-cu118="true" | ||
LABEL com.amazonaws.ml.engines.sagemaker.dlc.framework.djl.v0-25-0.pytorch-cu118="true" | ||
LABEL com.amazonaws.ml.engines.sagemaker.dlc.framework.djl.pytorch-gpu="true" | ||
LABEL com.amazonaws.ml.engines.sagemaker.dlc.framework.djl.v0-26-0.pytorch-cu121="true" | ||
LABEL com.amazonaws.sagemaker.capabilities.multi-models="true" | ||
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port="true" | ||
LABEL djl-version=$djl_version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters