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)
This commit is contained in:
Adrien David-Sivelle
2020-10-06 09:23:32 -04:00
committed by GitHub
parent 4d541f516f
commit 98fb718577
2 changed files with 14 additions and 4 deletions

View File

@@ -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 maintainer="Hugging Face"
LABEL repository="transformers" LABEL repository="transformers"
@@ -18,6 +18,11 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
tensorflow \ tensorflow \
torch 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 WORKDIR /workspace
COPY . transformers/ COPY . transformers/
RUN cd transformers/ && \ RUN cd transformers/ && \

View File

@@ -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 maintainer="Hugging Face"
LABEL repository="transformers" LABEL repository="transformers"
@@ -17,6 +17,11 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
mkl \ mkl \
torch 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 WORKDIR /workspace
COPY . transformers/ COPY . transformers/
RUN cd transformers/ && \ RUN cd transformers/ && \