Skip to content

Commit

Permalink
Docker GPU Images: Add NVIDIA/apex to the cuda images with pytorch (h…
Browse files Browse the repository at this point in the history
…uggingface#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)
  • Loading branch information
AdrienDS authored Oct 6, 2020
1 parent 4d541f5 commit 98fb718
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions docker/transformers-gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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"]
CMD ["/bin/bash"]
9 changes: 7 additions & 2 deletions docker/transformers-pytorch-gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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"]
CMD ["/bin/bash"]

0 comments on commit 98fb718

Please sign in to comment.