|
| 1 | +FROM lablup/common-base:py38-cuda10.1 |
| 2 | + |
| 3 | +RUN python3 -m pip uninstall -y numpy scipy && \ |
| 4 | + python3 -m pip install --no-cache-dir \ |
| 5 | + tfx-bsl==0.25.0 \ |
| 6 | + tfx==0.25.0 \ |
| 7 | + numpy scipy scikit-learn \ |
| 8 | + tensorflow==2.3.2 \ |
| 9 | +# tensorboard==2.3.0 \ |
| 10 | + tensorflow-serving-api==2.3.0 \ |
| 11 | + tensorflow-text==2.3.0 |
| 12 | + |
| 13 | +RUN python3 -m pip install --extra-index-url \ |
| 14 | + https://developer.download.nvidia.com/compute/redist nvidia-dali-cuda100 \ |
| 15 | + && \ |
| 16 | + python3 -m pip install --extra-index-url \ |
| 17 | + https://developer.download.nvidia.com/compute/redist nvidia-dali-tf-plugin-cuda100 |
| 18 | + |
| 19 | +# Install PyTorch and MXNet |
| 20 | +ENV PYTORCH_VERSION=1.8.1 |
| 21 | +ENV TORCHVISION_VERSION=0.9.1 |
| 22 | +ENV TORCHAUDIO_VERSION=0.8.1 |
| 23 | +ENV TORCHTEXT_VERSION=0.9.1 |
| 24 | +ENV TENSORBOARDX_VERSION=2.1 |
| 25 | +ENV MXNET_VERSION=1.7.0 |
| 26 | + |
| 27 | +RUN python3 -m pip uninstall -y torch && \ |
| 28 | + python3 -m pip install --no-cache-dir \ |
| 29 | + https://download.pytorch.org/whl/cu101/torch-${PYTORCH_VERSION}%2Bcu101-cp38-cp38-linux_x86_64.whl \ |
| 30 | + https://download.pytorch.org/whl/cu101/torchvision-${TORCHVISION_VERSION}%2Bcu101-cp38-cp38-linux_x86_64.whl \ |
| 31 | + https://download.pytorch.org/whl/torchaudio-${TORCHAUDIO_VERSION}-cp38-cp38-linux_x86_64.whl \ |
| 32 | + https://download.pytorch.org/whl/cu101/torchcsprng-0.2.1%2Bcu101-cp38-cp38-linux_x86_64.whl \ |
| 33 | + https://download.pytorch.org/whl/torchserve-0.3.0-py2.py3-none-any.whl \ |
| 34 | + https://download.pytorch.org/whl/torchtext-${TORCHTEXT_VERSION}-cp38-cp38-linux_x86_64.whl && \ |
| 35 | + python3 -m pip install --no-cache-dir tensorboardX==${TENSORBOARDX_VERSION} |
| 36 | + |
| 37 | +RUN python3 -m pip install --no-cache-dir mxnet mkl |
| 38 | + |
| 39 | +# Install Horovod, temporarily using CUDA stubs |
| 40 | +RUN ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs && \ |
| 41 | + HOROVOD_GPU_ALLREDUCE=NCCL HOROVOD_GPU_BROADCAST=NCCL \ |
| 42 | + HOROVOD_WITH_TENSORFLOW=1 HOROVOD_WITH_PYTORCH=1 HOROVOD_WITHOUT_MXNET=1 \ |
| 43 | + pip install --no-cache-dir horovod==0.21.3 && \ |
| 44 | + ldconfig |
| 45 | + |
| 46 | +RUN python3 -m pip install --no-cache-dir \ |
| 47 | + mpi4py==3.0.3 \ |
| 48 | + mlflow==1.15.0 \ |
| 49 | + nni==2.1 \ |
| 50 | + scikit-nni==0.2.1 |
| 51 | + |
| 52 | +RUN apt autoclean && \ |
| 53 | + rm -rf /var/lib/apt/lists/* && \ |
| 54 | + rm -rf /root/.cache && \ |
| 55 | + rm -rf /tmp/* |
| 56 | + |
| 57 | +COPY ./service-defs /etc/backend.ai/service-defs |
| 58 | +COPY runner-scripts/bootstrap.sh runner-scripts/setup_multinode.py /opt/container/ |
| 59 | + |
| 60 | +# Install ipython kernelspec |
| 61 | +Run python3 -m ipykernel install --display-name "Lablup FF 21.05 on Python 3.8 (CUDA 10.1)" && \ |
| 62 | + cat /usr/local/share/jupyter/kernels/python3/kernel.json |
| 63 | + |
| 64 | +# Backend.AI specifics |
| 65 | +LABEL ai.backend.kernelspec="1" \ |
| 66 | + ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \ |
| 67 | + ai.backend.features="batch query uid-match user-input" \ |
| 68 | + ai.backend.base-distro="ubuntu16.04" \ |
| 69 | + ai.backend.resource.min.cpu="1" \ |
| 70 | + ai.backend.resource.min.mem="1g" \ |
| 71 | + ai.backend.resource.min.cuda.device=0 \ |
| 72 | + ai.backend.resource.min.cuda.shares=0 \ |
| 73 | + ai.backend.runtime-type="python" \ |
| 74 | + ai.backend.runtime-path="/usr/bin/python3" \ |
| 75 | + ai.backend.service-ports="ipython:pty:3000,jupyter:http:8081,jupyterlab:http:8090,vscode:http:8180,tensorboard:http:6006" |
| 76 | + |
| 77 | +WORKDIR /home/work |
| 78 | +# vim: ft=dockerfile |
0 commit comments