Skip to content

Commit 15e6d78

Browse files
committed
Pytorch 1.8
1 parent 859636f commit 15e6d78

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
FROM lablup/common-base:py38-cuda11.1
2+
# Install PyTorch and MXNet
3+
ENV PYTORCH_VERSION=1.7.1
4+
ENV TORCHVISION_VERSION=0.8.2
5+
ENV TORCHAUDIO_VERSION=0.7.2
6+
ENV TORCHTEXT_VERSION=0.8.1
7+
ENV TENSORBOARDX_VERSION=2.1
8+
9+
RUN python3 -m pip uninstall -y torch && \
10+
python3 -m pip install --no-cache-dir \
11+
https://download.pytorch.org/whl/cu110/torch-${PYTORCH_VERSION}%2Bcu110-cp38-cp38-linux_x86_64.whl \
12+
https://download.pytorch.org/whl/cu110/torchvision-${TORCHVISION_VERSION}%2Bcu110-cp38-cp38-linux_x86_64.whl \
13+
https://download.pytorch.org/whl/torchaudio-${TORCHAUDIO_VERSION}-cp38-cp38-linux_x86_64.whl \
14+
https://download.pytorch.org/whl/torchtext-${TORCHTEXT_VERSION}-cp38-cp38-linux_x86_64.whl && \
15+
python3 -m pip install --no-cache-dir tensorboardX==${TENSORBOARDX_VERSION}
16+
17+
# torch2trt PyTorch to TensorRT converter which utilizes the TensorRT Python API
18+
WORKDIR /tmp
19+
RUN git clone https://github.com/NVIDIA-AI-IOT/torch2trt /tmp/torch2trt && \
20+
cd /tmp/torch2trt && \
21+
python3 setup.py install --plugins && \
22+
rm -fr /tmp/torch2trt
23+
24+
RUN python3 -m pip install --extra-index-url \
25+
https://developer.download.nvidia.com/compute/redist nvidia-dali-cuda100
26+
27+
# Install Horovod, temporarily using CUDA stubs
28+
RUN ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs && \
29+
HOROVOD_GPU_ALLREDUCE=NCCL HOROVOD_GPU_BROADCAST=NCCL \
30+
HOROVOD_WITH_TENSORFLOW=1 HOROVOD_WITH_PYTORCH=1 HOROVOD_WITHOUT_MXNET=1 \
31+
pip install --no-cache-dir horovod==0.21.1 && \
32+
ldconfig
33+
34+
RUN python3 -m pip install --no-cache-dir \
35+
mpi4py==3.0.3 \
36+
mlflow==1.12.1 \
37+
nni==1.9 \
38+
scikit-nni==0.2.1
39+
40+
RUN apt autoclean && \
41+
rm -rf /var/lib/apt/lists/* && \
42+
rm -rf /root/.cache && \
43+
rm -rf /tmp/*
44+
COPY ./service-defs /etc/backend.ai/service-defs
45+
46+
# Install ipython kernelspec
47+
Run python3 -m ipykernel install --display-name "PyTorch 1.7.1 on Python 3.8 (CUDA 11.1)" && \
48+
cat /usr/local/share/jupyter/kernels/python3/kernel.json
49+
50+
# Backend.AI specifics
51+
LABEL ai.backend.kernelspec="1" \
52+
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
53+
ai.backend.features="batch query uid-match user-input" \
54+
ai.backend.base-distro="ubuntu16.04" \
55+
ai.backend.resource.min.cpu="1" \
56+
ai.backend.resource.min.mem="1g" \
57+
ai.backend.resource.min.cuda.device=0 \
58+
ai.backend.resource.min.cuda.shares=0 \
59+
ai.backend.runtime-type="python" \
60+
ai.backend.runtime-path="/usr/bin/python3" \
61+
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8081,jupyterlab:http:8090,vscode:http:8180,tensorboard:http:6006,mlflow-ui:preopen:5000,nniboard:preopen:8080"
62+
63+
WORKDIR /home/work
64+
# vim: ft=dockerfile

0 commit comments

Comments
 (0)