|
| 1 | +FROM lablup/common-base:py38-cuda11.1 |
| 2 | + |
| 3 | +RUN python3 -m pip install --no-cache-dir --extra-index-url \ |
| 4 | + https://developer.download.nvidia.com/compute/redist \ |
| 5 | + nvidia-dali-cuda100 && \ |
| 6 | + python3 -m pip install --no-cache-dir --extra-index-url \ |
| 7 | + https://developer.download.nvidia.com/compute/redist nvidia-dali-tf-plugin-cuda100 |
| 8 | + |
| 9 | +# Install PyTorch and MXNet |
| 10 | +ENV PYTORCH_VERSION=1.7.1 |
| 11 | +ENV TORCHVISION_VERSION=0.8.2 |
| 12 | +ENV TORCHAUDIO_VERSION=0.7.2 |
| 13 | +ENV TORCHTEXT_VERSION=0.8.1 |
| 14 | +ENV TENSORBOARDX_VERSION=2.1 |
| 15 | +ENV MXNET_VERSION=1.6.0 |
| 16 | + |
| 17 | +RUN python3 -m pip uninstall -y torch && \ |
| 18 | + python3 -m pip install --no-cache-dir \ |
| 19 | + https://download.pytorch.org/whl/cu110/torch-${PYTORCH_VERSION}%2Bcu110-cp38-cp38-linux_x86_64.whl \ |
| 20 | + https://download.pytorch.org/whl/cu110/torchvision-${TORCHVISION_VERSION}%2Bcu110-cp38-cp38-linux_x86_64.whl \ |
| 21 | + https://download.pytorch.org/whl/torchaudio-${TORCHAUDIO_VERSION}-cp38-cp38-linux_x86_64.whl \ |
| 22 | + https://download.pytorch.org/whl/torchtext-${TORCHTEXT_VERSION}-cp38-cp38-linux_x86_64.whl && \ |
| 23 | + python3 -m pip install --no-cache-dir tensorboardX==${TENSORBOARDX_VERSION} |
| 24 | + |
| 25 | +RUN python3 -m pip install --no-cache-dir mxnet mkl |
| 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 | +# install kaldi |
| 41 | +WORKDIR /opt |
| 42 | +RUN apt update ; apt-get install -y sox subversion |
| 43 | +RUN git clone https://github.com/kaldi-asr/kaldi.git /opt/kaldi && \ |
| 44 | + cd /opt/kaldi && \ |
| 45 | + git checkout c013e2e && \ |
| 46 | + cd /opt/kaldi/tools && \ |
| 47 | + make -j $(nproc) && \ |
| 48 | + cd /opt/kaldi/src && \ |
| 49 | + ./configure --shared --use-cuda && \ |
| 50 | + make depend -j $(nproc) && \ |
| 51 | + make -j $(nproc) -lcuda -L /usr/local/cuda/lib64/stubs && \ |
| 52 | + find /opt/kaldi -type f \( -name "*.o" -o -name "*.la" -o -name "*.a" \) -exec rm {} \; && \ |
| 53 | + rm -rf /opt/kaldi/.git |
| 54 | + |
| 55 | +# Install ipython kernelspec |
| 56 | +Run python3 -m ipykernel install --display-name "Lablup FF 21.01 on Python 3.8 (CUDA 11.1)" && \ |
| 57 | + cat /usr/local/share/jupyter/kernels/python3/kernel.json |
| 58 | + |
| 59 | +# Backend.AI specifics |
| 60 | +LABEL ai.backend.kernelspec="1" \ |
| 61 | + ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \ |
| 62 | + ai.backend.features="batch query uid-match user-input" \ |
| 63 | + ai.backend.base-distro="ubuntu16.04" \ |
| 64 | + ai.backend.resource.min.cpu="1" \ |
| 65 | + ai.backend.resource.min.mem="1g" \ |
| 66 | + ai.backend.resource.min.cuda.device=0 \ |
| 67 | + ai.backend.resource.min.cuda.shares=0 \ |
| 68 | + ai.backend.runtime-type="python" \ |
| 69 | + ai.backend.runtime-path="/usr/bin/python3" \ |
| 70 | + ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,jupyterlab:http:8090,vscode:http:8180,tensorboard:http:6006,mlflow-ui:preopen:5000,nniboard:preopen:8080" |
| 71 | + |
| 72 | +WORKDIR /home/work |
| 73 | +# vim: ft=dockerfile |
0 commit comments