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

Fix inference container #135

Merged
merged 25 commits into from
Mar 17, 2022
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
19 changes: 12 additions & 7 deletions ci/dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ ARG IMAGE=nvcr.io/nvidia/tritonserver:${TRITON_VERSION}-py3
FROM ${IMAGE}

# Args
ARG CORE_VER=main
ARG RMM_VER=v21.12.00
ARG CUDF_VER=v21.12.02
ARG NVTAB_VER=main
ARG NVTAB_BACKEND_VER=main
ARG MODELS_VER=main
ARG HWLOC_VER=2.4.1
ARG RMM_VER=v21.12.00
ARG CORE_VER=main
ARG HUGECTR_VER=master
ARG HUGECTR_BACKEND_VER=main
ARG MODELS_VER=main
ARG NVTAB_VER=main
ARG NVTAB_BACKEND_VER=main
ARG SYSTEMS_VER=main
ARG TF4REC_VER=main
ARG HWLOC_VER=2.4.1


# Envs
ENV CUDA_SHORT_VERSION=11.6
Expand Down Expand Up @@ -153,6 +153,11 @@ RUN git clone https://github.com/NVIDIA-Merlin/core.git /core/ && \
cd /core/ && git checkout ${CORE_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/core:$PYTHONPATH

# Install Merlin Systems
RUN git clone https://github.com/NVIDIA-Merlin/systems.git /systems/ && \
cd /systems/ && git checkout ${SYSTEMS_VER} && pip install --no-deps -e .
ENV PYTHONPATH=/systems:$PYTHONPATH

# Install NVTabular
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python'
RUN git clone https://github.com/NVIDIA-Merlin/NVTabular.git /nvtabular/ && \
Expand Down
46 changes: 13 additions & 33 deletions ci/test_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,23 @@ devices=$2
# Unit tests #
##############

## Test NVTabular
pytest /nvtabular/tests/unit
## Test Core
/core/ci/test_unit.sh $container $devices

## Test HugeCTR
### Training container
if [ "$container" == "merlin-training" ]; then
# layers_test && \ Running oom in blossom
checker_test && \
# data_reader_test && \ Need Multi-GPU
device_map_test && \
loss_test && \
optimizer_test && \
regularizers_test # && \
# parser_test && \ Needs Multi-GPU
# auc_test Needs Multi-GPU
### Inference container
# elif [ "$container" == "merlin-inference" ]; then
# HugeCTR - Deactivated until it is self-contained and it runs
# inference_test
fi
## Test NVTabular
/nvtabular/ci/test_unit.sh $container $devices

## Test Transformers4Rec
if [ "$container" != "merlin-training" ]; then
/transformers4rec/ci/test_unit.sh $container $devices
fi
/transformers4rec/ci/test_unit.sh $container $devices

## Test Models
if [ "$container" != "merlin-training" ]; then
pip install coverage
chmod +x /models/ci/test_unit.sh
/models/ci/test_unit.sh $container $devices
fi
pip install coverage
/models/ci/test_unit.sh $container $devices

## Test HugeCTR
if [ "$container" == "merlin-training" ]; then
/hugectr/ci/test_unit.sh $container $devices
fi

#####################
# Integration tests #
Expand All @@ -48,13 +32,9 @@ fi
# Test NVTabular
## Not shared storage in blossom yet
regex="merlin(.)*-inference"
if [[ "$container" =~ $regex ]]; then
if [[ ! "$container" =~ $regex ]]; then
/nvtabular/ci/test_integration.sh $container $devices --report 1
fi
# Test HugeCTR
# Waiting to sync integration tests with them

# Test Transformers4Rec
if [ "$container" != "merlin-training" ]; then
/transformers4rec/ci/test_integration.sh $container $devices
fi
/transformers4rec/ci/test_integration.sh $container $devices
66 changes: 51 additions & 15 deletions docker/inference/dockerfile.ctr
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# syntax=docker/dockerfile:1.2
ARG TRITON_VERSION=22.02
ARG IMAGE=nvcr.io/nvidia/tritonserver:${TRITON_VERSION}-py3-min
FROM ${IMAGE}
ARG FULL_IMAGE=nvcr.io/nvidia/tritonserver:${TRITON_VERSION}-py3
ARG BASE_IMAGE=${FULL_IMAGE}-min
FROM ${FULL_IMAGE} as full
FROM ${BASE_IMAGE} as base


# Args
ARG CORE_VER=main
ARG RMM_VER=v21.12.00
ARG CUDF_VER=v21.12.02
ARG RMM_VER=v21.12.00
ARG CORE_VER=main
ARG HUGECTR_VER=master
ARG HUGECTR_BACKEND_VER=main
ARG NVTAB_VER=main
ARG NVTAB_BACKEND_VER=main
ARG MODELS_VER=main
ARG HUGECTR_VER=master
ARG HUGECTR_BACKEND_VER=main
ARG SYSTEMS_VER=main
ARG TF4REC_VER=main
#

# Envs
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/lib:/repos/dist/lib
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -23,33 +27,61 @@ ENV CUDA_CUDA_LIBRARY=${CUDA_HOME}/lib64/stubs
ENV PATH=${CUDA_HOME}/lib64/:${PATH}:${CUDA_HOME}/bin
ENV PYTHONPATH=/usr/lib/python3.8/site-packages:$PYTHONPATH

# Install packages
# Install system packages
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update -y --fix-missing && \
apt install -y --no-install-recommends software-properties-common && \
apt-get install -y --no-install-recommends \
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin && \
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub && \
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"

RUN apt update -y --fix-missing && \
apt install -y --no-install-recommends \
clang-format \
datacenter-gpu-manager \
libb64-dev \
libboost-serialization-dev \
libcurl4-openssl-dev \
libre2-dev \
libssl-dev \
libtbb-dev \
openssl \
pkg-config \
protobuf-compiler \
python3-dev \
python3-pip \
rapidjson-dev &&\
apt-get autoremove -y && \
apt-get clean && \
rapidjson-dev && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/python3 /usr/bin/python

# Install multiple packages
RUN pip install numba==0.55.1 numpy==1.21.5 --no-deps
RUN pip install cupy-cuda115 nvidia-pyindex pybind11 pytest protobuf transformers==4.12 tensorflow-metadata
RUN pip install betterproto cachetools graphviz nvtx scipy sklearn
RUN pip install pandas numba==0.55.1 numpy==1.21.5
RUN pip install betterproto cachetools graphviz nvtx scipy sklearn pandas
RUN pip install tritonclient[all] grpcio-channelz
RUN pip install dask==2021.11.2 distributed==2021.11.2 dask[dataframe]==2021.11.2 dask-cuda
RUN pip install git+https://github.com/rapidsai/asvdb.git@main
RUN pip install numba==0.55.1 numpy==1.21.5 --no-deps


# Triton Server
WORKDIR /opt/tritonserver
COPY --chown=1000:1000 --from=full /opt/tritonserver/LICENSE .
COPY --chown=1000:1000 --from=full /opt/tritonserver/TRITON_VERSION .
COPY --chown=1000:1000 --from=full /opt/tritonserver/NVIDIA_Deep_Learning_Container_License.pdf .
COPY --chown=1000:1000 --from=full /opt/tritonserver/bin bin/
COPY --chown=1000:1000 --from=full /opt/tritonserver/lib lib/
COPY --chown=1000:1000 --from=full /opt/tritonserver/include include/
COPY --chown=1000:1000 --from=full /opt/tritonserver/repoagents/ repoagents/
COPY --chown=1000:1000 --from=full /opt/tritonserver/backends/python backends/python
COPY --chown=1000:1000 --from=full /usr/bin/serve /usr/bin/.
ENV PATH=/opt/tritonserver/bin:${PATH}:
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/tritonserver/lib

# Install cmake
RUN apt remove --purge cmake -y && wget http://www.cmake.org/files/v3.21/cmake-3.21.1.tar.gz && \
Expand Down Expand Up @@ -138,14 +170,18 @@ RUN git clone https://github.com/NVIDIA-Merlin/core.git /core/ && \
cd /core/ && git checkout ${CORE_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/core:$PYTHONPATH

# Install Merlin Systems
RUN git clone https://github.com/NVIDIA-Merlin/systems.git /systems/ && \
cd /systems/ && git checkout ${SYSTEMS_VER} && pip install --no-deps -e .
ENV PYTHONPATH=/systems:$PYTHONPATH

# Install NVTabular
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python'
RUN git clone https://github.com/NVIDIA-Merlin/NVTabular.git /nvtabular/ && \
cd /nvtabular/ && git checkout ${NVTAB_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/nvtabular:$PYTHONPATH

# Install Transformers4Rec
RUN pip install transformers==4.12
RUN git clone https://github.com/NVIDIA-Merlin/Transformers4Rec.git /transformers4rec && \
cd /transformers4rec/ && git checkout ${TF4REC_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/transformers4rec:$PYTHONPATH
Expand Down
38 changes: 25 additions & 13 deletions docker/inference/dockerfile.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# syntax=docker/dockerfile:1.2
ARG TRITON_VERSION=22.02
ARG IMAGE=nvcr.io/nvidia/tritonserver:${TRITON_VERSION}-tf2-python-py3
FROM ${IMAGE}
ARG FULL_IMAGE=nvcr.io/nvidia/tritonserver:${TRITON_VERSION}-py3
ARG BASE_IMAGE=nvcr.io/nvidia/tritonserver:${TRITON_VERSION}-tf2-python-py3
FROM ${FULL_IMAGE} as full
FROM ${BASE_IMAGE} as bas

# Args
ARG CORE_VER=main
ARG RMM_VER=v21.12.00
ARG CUDF_VER=v21.12.02
ARG NVTAB_VER=main
ARG NVTAB_BACKEND_VER=main
ARG MODELS_VER=main
ARG RMM_VER=v21.12.00
ARG CORE_VER=main
ARG HUGECTR_VER=master
ARG HUGECTR_BACKEND_VER=main
ARG MODELS_VER=main
ARG NVTAB_VER=main
ARG NVTAB_BACKEND_VER=main
ARG SYSTEMS_VER=main
ARG TF4REC_VER=main
#

# Envs
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/lib:/repos/dist/lib
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -26,20 +29,21 @@ ENV PYTHONPATH=/usr/lib/python3.8/site-packages:$PYTHONPATH
# Install packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y --fix-missing && \
apt install -y --no-install-recommends software-properties-common && \
apt-get install -y --no-install-recommends \
apt install -y --no-install-recommends \
clang-format \
libboost-serialization-dev \
libexpat1-dev \
libsasl2-2 \
libssl-dev \
libtbb-dev \
openssl \
policykit-1 \
protobuf-compiler \
rapidjson-dev \
software-properties-common \
zlib1g-dev && \
apt-get autoremove -y && \
apt-get clean && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/python3 /usr/bin/python
Expand All @@ -52,6 +56,10 @@ RUN pip install tritonclient[all] grpcio-channelz
RUN pip install dask==2021.11.2 distributed==2021.11.2 dask[dataframe]==2021.11.2 dask-cuda
RUN pip install git+https://github.com/rapidsai/asvdb.git@main

# Triton Server
WORKDIR /opt/tritonserver
COPY --chown=1000:1000 --from=full /opt/tritonserver/backends/fil backends/fil/

# Install cmake
RUN apt remove --purge cmake -y && wget http://www.cmake.org/files/v3.21/cmake-3.21.1.tar.gz && \
tar xf cmake-3.21.1.tar.gz && cd cmake-3.21.1 && ./configure && make && make install
Expand Down Expand Up @@ -139,14 +147,18 @@ RUN git clone https://github.com/NVIDIA-Merlin/core.git /core/ && \
cd /core/ && git checkout ${CORE_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/core:$PYTHONPATH

# Install Merlin Systems
RUN git clone https://github.com/NVIDIA-Merlin/systems.git /systems/ && \
cd /systems/ && git checkout ${SYSTEMS_VER} && pip install --no-deps -e .
ENV PYTHONPATH=/systems:$PYTHONPATH

# Install NVTabular
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python'
RUN git clone https://github.com/NVIDIA-Merlin/NVTabular.git /nvtabular/ && \
cd /nvtabular/ && git checkout ${NVTAB_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/nvtabular:$PYTHONPATH

# Install Transformers4Rec
RUN pip install transformers==4.12
RUN git clone https://github.com/NVIDIA-Merlin/Transformers4Rec.git /transformers4rec && \
cd /transformers4rec/ && git checkout ${TF4REC_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/transformers4rec:$PYTHONPATH
Expand Down
28 changes: 17 additions & 11 deletions docker/inference/dockerfile.torch
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ ARG IMAGE=nvcr.io/nvidia/tritonserver:${TRITON_VERSION}-pyt-python-py3
FROM ${IMAGE}

# Args
ARG CORE_VER=main
ARG RMM_VER=v21.12.00
ARG CUDF_VER=v21.12.02
ARG NVTAB_VER=main
ARG NVTAB_BACKEND_VER=main
ARG MODELS_VER=main
ARG RMM_VER=v21.12.00
ARG CORE_VER=main
ARG HUGECTR_VER=master
ARG HUGECTR_BACKEND_VER=main
ARG MODELS_VER=main
ARG NVTAB_VER=main
ARG NVTAB_BACKEND_VER=main
ARG SYSTEMS_VER=main
ARG TF4REC_VER=main
#

# Envs
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/lib:/repos/dist/lib
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -26,20 +27,21 @@ ENV PYTHONPATH=/usr/lib/python3.8/site-packages:$PYTHONPATH
# Install packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y --fix-missing && \
apt install -y --no-install-recommends software-properties-common && \
apt-get install -y --no-install-recommends \
apt install -y --no-install-recommends \
clang-format \
libboost-serialization-dev \
libexpat1-dev \
libsasl2-2 \
libssl-dev \
libtbb-dev \
openssl \
policykit-1 \
protobuf-compiler \
rapidjson-dev \
software-properties-common \
zlib1g-dev && \
apt-get autoremove -y && \
apt-get clean && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/python3 /usr/bin/python
Expand Down Expand Up @@ -139,14 +141,18 @@ RUN git clone https://github.com/NVIDIA-Merlin/core.git /core/ && \
cd /core/ && git checkout ${CORE_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/core:$PYTHONPATH

# Install Merlin Systems
RUN git clone https://github.com/NVIDIA-Merlin/systems.git /systems/ && \
cd /systems/ && git checkout ${SYSTEMS_VER} && pip install --no-deps -e .
ENV PYTHONPATH=/systems:$PYTHONPATH

# Install NVTabular
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python'
RUN git clone https://github.com/NVIDIA-Merlin/NVTabular.git /nvtabular/ && \
cd /nvtabular/ && git checkout ${NVTAB_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/nvtabular:$PYTHONPATH

# Install Transformers4Rec
RUN pip install transformers==4.12
RUN git clone https://github.com/NVIDIA-Merlin/Transformers4Rec.git /transformers4rec && \
cd /transformers4rec/ && git checkout ${TF4REC_VER} && pip install -e . --no-deps
ENV PYTHONPATH=/transformers4rec:$PYTHONPATH
Expand Down
Loading