Skip to content

Commit dedd2b4

Browse files
committed
PyTorch 1.5 python 3.6 & CUDA 10.1
1 parent 53fb913 commit dedd2b4

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
FROM lablup/common-base:20.03-py36-cuda10.1
2+
3+
# Install TensorFlow, Keras, PyTorch and MXNet
4+
ENV PYTORCH_VERSION=1.5.0
5+
ENV TORCHVISION_VERSION=0.6.0
6+
ENV TORCHAUDIO_VERSION=0.5.0
7+
ENV TORCHTEXT_VERSION=0.6.0
8+
ENV TENSORBOARDX_VERSION=1.9
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
ENV mecab_dicdir /usr/local/lib/mecab/dic/mecab-ko-dic
11+
12+
ENV PYTHONUNBUFFERED=1 \
13+
LD_LIBRARY_PATH="/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/nvidia/lib64:/usr/include/x86_64-linux-gnu" \
14+
PATH="/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin/mecab" \
15+
LANG=C.UTF-8
16+
17+
# Set default shell to /bin/bash
18+
SHELL ["/bin/bash", "-cu"]
19+
20+
# Install TensorFlow, Keras, PyTorch and MXNet
21+
RUN python3 -m pip install pip --no-cache-dir -Iv \
22+
Cython==0.29.13 \
23+
numpy==1.16.5 \
24+
scipy==1.4.1 \
25+
scikit-image==0.16.2 \
26+
scikit-learn==0.21.3 \
27+
matplotlib==3.1.3 \
28+
tornado==6.0.4 \
29+
pystan==2.19.1.1 \
30+
notebook==6.0.3
31+
32+
RUN python3 -m pip install --no-cache-dir \
33+
https://download.pytorch.org/whl/cu101/torch-${PYTORCH_VERSION}%2Bcu101-cp36-cp36m-linux_x86_64.whl \
34+
https://download.pytorch.org/whl/cu101/torchvision-${TORCHVISION_VERSION}%2Bcu101-cp36-cp36m-linux_x86_64.whl \
35+
https://download.pytorch.org/whl/torchaudio-${TORCHAUDIO_VERSION}-cp36-cp36m-linux_x86_64.whl \
36+
torchtext==${TORCHTEXT_VERSION} && \
37+
python3 -m pip install --no-cache-dir tensorboardX==${TENSORBOARDX_VERSION}
38+
RUN python3 -m pip install --no-cache-dir --extra-index-url \
39+
https://developer.download.nvidia.com/compute/redist/cuda/10.0 \
40+
nvidia-dali
41+
42+
RUN python3 -m pip install pip --no-cache-dir \
43+
jupyter-tensorboard==0.2.0 \
44+
tensorwatch==0.8.10 \
45+
jupyterlab-nvdashboard==0.2.0
46+
47+
# Install Horovod, temporarily using CUDA stubs
48+
RUN ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs && \
49+
HOROVOD_GPU_ALLREDUCE=NCCL HOROVOD_GPU_BROADCAST=NCCL \
50+
HOROVOD_WITH_TENSORFLOW=1 HOROVOD_WITH_PYTORCH=1 HOROVOD_WITHOUT_MXNET=1 \
51+
pip install --no-cache-dir git+https://github.com/horovod/horovod && \
52+
# horovod==0.19.0 && \
53+
ldconfig
54+
55+
RUN python3 -m pip install --no-cache-dir \
56+
mpi4py==3.0.3 \
57+
nni
58+
59+
# Install ipython kernelspec
60+
Run python3 -m ipykernel install --display-name "PyTorch 1.5 on Python 3.6 (CUDA 10.1)" && \
61+
cat /usr/local/share/jupyter/kernels/python3/kernel.json
62+
63+
# Jupyter notebook extension
64+
RUN mkdir -p /home/work/.jupyter/nbextension
65+
WORKDIR /home/work/.jupyter/nbextension
66+
67+
RUN jupyter nbextensions_configurator enable && \
68+
jupyter contrib nbextension install && \
69+
jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
70+
jupyter contrib nbextension install && \
71+
jupyter serverextension enable --py jupyterlab --sys-prefix && \
72+
jupyter labextension install @jupyter-widgets/jupyterlab-manager && \
73+
# jupyter labextension install jupyterlab-nvdashboard && \
74+
git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding && \
75+
jupyter nbextension enable /home/work/.jupyter/nbextension/vim_binding/vim_binding
76+
77+
# Backend.AI specifics
78+
LABEL ai.backend.kernelspec="1" \
79+
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
80+
ai.backend.features="batch query uid-match user-input" \
81+
ai.backend.base-distro="ubuntu16.04" \
82+
ai.backend.resource.min.cpu="1" \
83+
ai.backend.resource.min.mem="1g" \
84+
ai.backend.resource.min.cuda.device=0 \
85+
ai.backend.resource.min.cuda.shares=0 \
86+
ai.backend.runtime-type="python" \
87+
ai.backend.runtime-path="/usr/bin/python3" \
88+
ai.backend.service-ports="ipython:pty:3000,tensorboard:http:6006,jupyter:http:8080,jupyterlab:http:8090"
89+
90+
WORKDIR /home/work
91+
# vim: ft=dockerfile

0 commit comments

Comments
 (0)