|
| 1 | +FROM lablup/common-base:22.09-cuda10.2 |
| 2 | + |
| 3 | +# Install TensorFlow, Keras, PyTorch and MXNet |
| 4 | +ENV PYTORCH_VERSION=1.7.1 |
| 5 | +ENV TORCHVISION_VERSION=0.8.2 |
| 6 | +ENV TORCHAUDIO_VERSION=0.7.2 |
| 7 | +ENV TORCHTEXT_VERSION=0.7.0 |
| 8 | +ENV TENSORBOARDX_VERSION=2.5.1 |
| 9 | +ENV DEBIAN_FRONTEND=noninteractive |
| 10 | +ENV mecab_dicdir /usr/local/lib/mecab/dic/mecab-ko-dic |
| 11 | + |
| 12 | +RUN python3 -m pip install --no-cache-dir --upgrade \ |
| 13 | + https://download.pytorch.org/whl/cu101/torch-${PYTORCH_VERSION}%2Bcu101-cp36-cp36m-linux_x86_64.whl \ |
| 14 | + https://download.pytorch.org/whl/cu101/torchvision-${TORCHVISION_VERSION}%2Bcu101-cp36-cp36m-linux_x86_64.whl \ |
| 15 | + https://download.pytorch.org/whl/torchaudio-${TORCHAUDIO_VERSION}-cp36-cp36m-linux_x86_64.whl \ |
| 16 | + torchtext==${TORCHTEXT_VERSION} && \ |
| 17 | + python3 -m pip install --no-cache-dir tensorboardX==${TENSORBOARDX_VERSION} |
| 18 | + |
| 19 | + |
| 20 | +RUN python3 -m pip install --no-cache-dir --extra-index-url \ |
| 21 | + https://developer.download.nvidia.com/compute/redist \ |
| 22 | + nvidia-dali-cuda100 |
| 23 | +#RUN python3 -m pip install --no-cache-dir tensorrt |
| 24 | +# torch2trt PyTorch to TensorRT converter which utilizes the TensorRT Python API |
| 25 | +#WORKDIR /tmp |
| 26 | +#RUN git clone https://github.com/NVIDIA-AI-IOT/torch2trt /tmp/torch2trt && \ |
| 27 | +# cd /tmp/torch2trt && \ |
| 28 | +# python3 setup.py install --plugins && \ |
| 29 | +# rm -fr /tmp/torch2trt |
| 30 | + |
| 31 | +# Install Horovod, temporarily using CUDA stubs |
| 32 | +RUN ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs && \ |
| 33 | + HOROVOD_GPU_ALLREDUCE=NCCL HOROVOD_GPU_BROADCAST=NCCL \ |
| 34 | + HOROVOD_WITHOUT_TENSORFLOW=1 HOROVOD_WITH_PYTORCH=1 HOROVOD_WITHOUT_MXNET=1 \ |
| 35 | + pip install --no-cache-dir horovod==0.19.4 && \ |
| 36 | + ldconfig |
| 37 | + |
| 38 | +RUN python3 -m pip install --no-cache-dir \ |
| 39 | + mpi4py==3.0.3 \ |
| 40 | + nni==1.8 \ |
| 41 | + scikit-nni==0.2.1 |
| 42 | + |
| 43 | +# Install ipython kernelspec |
| 44 | +Run python3 -m ipykernel install --display-name "PyTorch 1.7 on Python 3.6 (CUDA 10.2)" && \ |
| 45 | + cat /usr/local/share/jupyter/kernels/python3/kernel.json |
| 46 | + |
| 47 | +# Backend.AI specifics |
| 48 | +LABEL ai.backend.kernelspec="1" \ |
| 49 | + ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \ |
| 50 | + ai.backend.features="batch query uid-match user-input" \ |
| 51 | + ai.backend.base-distro="ubuntu16.04" \ |
| 52 | + ai.backend.resource.min.cpu="1" \ |
| 53 | + ai.backend.resource.min.mem="1g" \ |
| 54 | + ai.backend.resource.min.cuda.device=0 \ |
| 55 | + ai.backend.resource.min.cuda.shares=0 \ |
| 56 | + ai.backend.runtime-type="python" \ |
| 57 | + ai.backend.runtime-path="/usr/bin/python3" \ |
| 58 | + ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,jupyterlab:http:8090,vscode:http:8180,tensorboard:http:6006" |
| 59 | + |
| 60 | +WORKDIR /home/work |
| 61 | +# vim: ft=dockerfile |
0 commit comments