|
| 1 | +FROM lablup/common-base:py38-cuda11.3 |
| 2 | + |
| 3 | +# Install TensorFlow |
| 4 | +ENV TENSORFLOW_VERSION=2.7.1 |
| 5 | +ENV TFX_VERSION=1.6.0 |
| 6 | +ENV TFX_BSL_VERSION=1.6.0 |
| 7 | +ENV TF_SERVING_API_VERSION=2.7.0 |
| 8 | +ENV TF_TEXT_VERSION=2.7.3 |
| 9 | +ENV TENSORBOARD_VERSION=2.7.0 |
| 10 | + |
| 11 | +RUN python3 -m pip uninstall -y numpy scipy && \ |
| 12 | + python3 -m pip install --no-cache-dir \ |
| 13 | + tfx-bsl==${TFX_BSL_VERSION} \ |
| 14 | + tfx==${TFX_VERSION} \ |
| 15 | + numpy scipy scikit-learn \ |
| 16 | + tensorflow==${TENSORFLOW_VERSION} \ |
| 17 | + tensorboard==${TENSORBOARD_VERSION} \ |
| 18 | + tensorflow-serving-api==${TF_SERVING_API_VERSION} \ |
| 19 | + tensorflow-text==${TF_TEXT_VERSION} |
| 20 | + |
| 21 | +RUN python3 -m pip install --extra-index-url \ |
| 22 | + https://developer.download.nvidia.com/compute/redist nvidia-dali-cuda110==1.10.0 \ |
| 23 | + && \ |
| 24 | + python3 -m pip install --extra-index-url \ |
| 25 | + https://developer.download.nvidia.com/compute/redist nvidia-dali-tf-plugin-cuda110==1.10.0 |
| 26 | + |
| 27 | +# Install PyTorch and MXNet |
| 28 | +ENV PYTORCH_VERSION=1.10.2 |
| 29 | +ENV TORCHVISION_VERSION=0.11.3 |
| 30 | +ENV TORCHAUDIO_VERSION=0.10.2 |
| 31 | +ENV TORCHTEXT_VERSION=0.11.2 |
| 32 | +ENV TENSORBOARDX_VERSION=2.4 |
| 33 | +ENV MXNET_VERSION=1.9.0 |
| 34 | +ENV PYTORCH_CUDA_VERSION=cu113 |
| 35 | + |
| 36 | +RUN python3 -m pip uninstall -y torch && \ |
| 37 | + python3 -m pip install --no-cache-dir \ |
| 38 | + https://download.pytorch.org/whl/${PYTORCH_CUDA_VERSION}/torch-${PYTORCH_VERSION}%2B${PYTORCH_CUDA_VERSION}-cp38-cp38-linux_x86_64.whl \ |
| 39 | + https://download.pytorch.org/whl/${PYTORCH_CUDA_VERSION}/torchvision-${TORCHVISION_VERSION}%2B${PYTORCH_CUDA_VERSION}-cp38-cp38-linux_x86_64.whl \ |
| 40 | + https://download.pytorch.org/whl/${PYTORCH_CUDA_VERSION}/torchaudio-${TORCHAUDIO_VERSION}%2B${PYTORCH_CUDA_VERSION}-cp38-cp38-linux_x86_64.whl \ |
| 41 | + #https://download.pytorch.org/whl/${PYTORCH_CUDA_VERSION}/torchcsprng-0.2.1%2B${PYTORCH_CUDA_VERSION}-cp38-cp38-linux_x86_64.whl \ |
| 42 | + https://download.pytorch.org/whl/torchserve-0.3.0-py2.py3-none-any.whl \ |
| 43 | + https://download.pytorch.org/whl/torchtext-${TORCHTEXT_VERSION}-cp38-cp38-linux_x86_64.whl && \ |
| 44 | + python3 -m pip install --no-cache-dir tensorboardX==${TENSORBOARDX_VERSION} |
| 45 | + |
| 46 | +RUN python3 -m pip install --no-cache-dir mxnet==${MXNET_VERSION} mkl |
| 47 | + |
| 48 | +ENV HOROVOD_VERSION=0.23.0 |
| 49 | +# Install Horovod, temporarily using CUDA stubs |
| 50 | +RUN ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs && \ |
| 51 | + HOROVOD_GPU_ALLREDUCE=NCCL HOROVOD_GPU_BROADCAST=NCCL \ |
| 52 | + HOROVOD_WITH_TENSORFLOW=1 HOROVOD_WITH_PYTORCH=1 HOROVOD_WITHOUT_MXNET=1 \ |
| 53 | + pip install --no-cache-dir horovod==${HOROVOD_VERSION} && \ |
| 54 | + ldconfig |
| 55 | + |
| 56 | +ENV MLFLOW_VERSION=1.23.1 |
| 57 | +ENV MPI4PY_VERSION=3.1.3 |
| 58 | +ENV NNI_VERSION=2.6 |
| 59 | + |
| 60 | +RUN python3 -m pip install --no-cache-dir \ |
| 61 | + mpi4py==${MPI4PY_VERSION} \ |
| 62 | + mlflow==${MLFLOW_VERSION} \ |
| 63 | + nni==${NNI_VERSION} \ |
| 64 | + scikit-nni==0.2.1 |
| 65 | + |
| 66 | +RUN apt autoclean && \ |
| 67 | + rm -rf /var/lib/apt/lists/* && \ |
| 68 | + rm -rf /root/.cache && \ |
| 69 | + rm -rf /tmp/* |
| 70 | + |
| 71 | +COPY ./service-defs /etc/backend.ai/service-defs |
| 72 | +COPY runner-scripts/bootstrap.sh runner-scripts/setup_multinode.py /opt/container/ |
| 73 | + |
| 74 | +# Install ipython kernelspec |
| 75 | +Run python3 -m ipykernel install --display-name "Lablup FF 22.02 on Python 3.8 (CUDA 11.3)" && \ |
| 76 | + cat /usr/local/share/jupyter/kernels/python3/kernel.json |
| 77 | + |
| 78 | +# Backend.AI specifics |
| 79 | +LABEL ai.backend.kernelspec="1" \ |
| 80 | + ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \ |
| 81 | + ai.backend.features="batch query uid-match user-input" \ |
| 82 | + ai.backend.base-distro="ubuntu18.04" \ |
| 83 | + ai.backend.resource.min.cpu="1" \ |
| 84 | + ai.backend.resource.min.mem="1g" \ |
| 85 | + ai.backend.resource.min.cuda.device=0 \ |
| 86 | + ai.backend.resource.min.cuda.shares=0 \ |
| 87 | + ai.backend.runtime-type="python" \ |
| 88 | + ai.backend.runtime-path="/usr/bin/python3" \ |
| 89 | + 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" |
| 90 | + |
| 91 | +WORKDIR /home/work |
| 92 | +# vim: ft=dockerfile |
0 commit comments