-
Notifications
You must be signed in to change notification settings - Fork 200
/
Copy pathDockerfile.inference
94 lines (86 loc) · 3.57 KB
/
Dockerfile.inference
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG TRITON_VERSION=21.04-py3
FROM nvcr.io/nvidia/tritonserver:${TRITON_VERSION} AS devel
ARG CMAKE_VERSION=3.19.6
ARG PYTHON_VERSION=3.8
ARG RAPIDS_VERSION=21.06
ARG TRITON_BRANCH=r21.04
ARG SM="70;75;80"
ARG RELEASE=false
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
gdb \
make \
wget \
clang-format \
libboost-all-dev \
libboost-regex-dev \
libboost-system-dev \
libboost-filesystem-dev \
curl && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://repo.anaconda.com/miniconda/Miniconda3-4.7.12-Linux-x86_64.sh && \
bash /var/tmp/Miniconda3-4.7.12-Linux-x86_64.sh -b -p /opt/conda && \
/opt/conda/bin/conda init && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
/opt/conda/bin/conda clean -afy && \
rm -rf /var/tmp/Miniconda3-4.7.12-Linux-x86_64.sh
ENV CPATH=/opt/conda/include:$CPATH \
LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH \
LIBRARY_PATH=/opt/conda/lib:$LIBRARY_PATH \
PATH=/opt/conda/bin:$PATH \
CONDA_PREFIX=/opt/conda \
NCCL_LAUNCH_MODE=PARALLEL
RUN conda update -n base -c defaults conda && \
conda install -c rapidsai -c nvidia -c numba -c conda-forge \
cudf=${RAPIDS_VERSION} \
python=${PYTHON_VERSION} \
cupy \
cudatoolkit \
rapidjson \
cmake=${CMAKE_VERSION} \
pip \
pandas \
sklearn-pandas && \
conda clean -afy
COPY clean_conda.sh .
RUN chmod +x ./clean_conda.sh && \
./clean_conda.sh cudnn nccl && \
rm -rfv ./clean_conda.sh
# HugeCTR Inference
RUN if [ "$RELEASE" = "true" ]; \
then \
mkdir -p /var/tmp && cd /var/tmp && git clone --depth=1 --branch master https://github.com/NVIDIA/HugeCTR.git HugeCTR && cd - && \
cd /var/tmp/HugeCTR && \
git submodule update --init --recursive && \
mkdir -p build && cd build &&\
cmake -DCMAKE_BUILD_TYPE=Release -DSM=$SM -DENABLE_INFERENCE=ON .. && make -j$(nproc) && make install && \
export CPATH=/usr/local/hugectr/include:$CPATH && \
export LIBRARY_PATH=/usr/local/hugectr/lib:$LIBRARY_PATH && \
cd /var/tmp && git clone https://github.com/triton-inference-server/hugectr_backend.git hugectr_inference_backend && \
cd /var/tmp/hugectr_inference_backend && \
mkdir build && cd build &&\
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hugectr -DTRITON_COMMON_REPO_TAG=$TRITON_BRANCH -DTRITON_CORE_REPO_TAG=$TRITON_BRANCH -DTRITON_BACKEND_REPO_TAG=$TRITON_BRANCH .. && \
make -j &&\
make install &&\
rm -rf /var/tmp/HugeCTR /var/tmp/hugectr_inference_backend; \
else \
echo "Build container for development successfully"; \
fi
ENV CPATH=/usr/local/hugectr/include:$CPATH \
LIBRARY_PATH=/usr/local/hugectr/lib:$LIBRARY_PATH \
LD_LIBRARY_PATH=/usr/local/hugectr/lib:$LD_LIBRARY_PATH \
PATH=/usr/local/hugectr/bin:$PATH