From 98fb71857792d9226f4dbe6ceadaca45ff332993 Mon Sep 17 00:00:00 2001 From: Adrien David-Sivelle Date: Tue, 6 Oct 2020 09:23:32 -0400 Subject: [PATCH] Docker GPU Images: Add NVIDIA/apex to the cuda images with pytorch (#7598) - Use cuda:10.2 image instead of 10.1 (to address version mismatch warning with pytorch) - Use devel version that is built on the runtime and includes headers and development tools (was otherwise failing to build apex) --- docker/transformers-gpu/Dockerfile | 9 +++++++-- docker/transformers-pytorch-gpu/Dockerfile | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docker/transformers-gpu/Dockerfile b/docker/transformers-gpu/Dockerfile index 6d68d2e480..0212eaa2a7 100644 --- a/docker/transformers-gpu/Dockerfile +++ b/docker/transformers-gpu/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 +FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 LABEL maintainer="Hugging Face" LABEL repository="transformers" @@ -18,9 +18,14 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \ tensorflow \ torch +RUN git clone https://github.com/NVIDIA/apex +RUN cd apex && \ + python3 setup.py install && \ + pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ + WORKDIR /workspace COPY . transformers/ RUN cd transformers/ && \ python3 -m pip install --no-cache-dir . -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/docker/transformers-pytorch-gpu/Dockerfile b/docker/transformers-pytorch-gpu/Dockerfile index 4beff57dc9..5ed2bd70fd 100644 --- a/docker/transformers-pytorch-gpu/Dockerfile +++ b/docker/transformers-pytorch-gpu/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 +FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 LABEL maintainer="Hugging Face" LABEL repository="transformers" @@ -17,9 +17,14 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \ mkl \ torch +RUN git clone https://github.com/NVIDIA/apex +RUN cd apex && \ + python3 setup.py install && \ + pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ + WORKDIR /workspace COPY . transformers/ RUN cd transformers/ && \ python3 -m pip install --no-cache-dir . -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"]