Skip to content

Commit

Permalink
Prune cuda installation for docker image (#2232)
Browse files Browse the repository at this point in the history
Summary:
The [`install_cuda.sh`](https://github.com/pytorch/builder/blob/main/common/install_cuda.sh#L126) in pytorch/builder provides functions `prune_121` and `prune_118` to remove unnecessary parts in the installed CUDA.

In my local testing, the image size generated by this docker file is reduced from 23.5GB to 19.7GB.

Pull Request resolved: #2232

Reviewed By: aaronenyeshi

Differential Revision: D56219144

Pulled By: xuzhao9

fbshipit-source-id: 8fae4e8da2f738e8dc12e564b1c518bfd9c0b109
  • Loading branch information
FindHao authored and facebook-github-bot committed Apr 17, 2024
1 parent 56f8181 commit 2cd5a49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/gcp-a100-runner-dind.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ RUN sudo mkdir -p /workspace; sudo chown runner:runner /workspace

# Use the CUDA installation scripts from pytorch/builder
RUN cd /workspace; git clone https://github.com/pytorch/builder.git
RUN sudo bash -c 'source /workspace/builder/common/install_cuda.sh; install_118'
RUN sudo bash -c 'source /workspace/builder/common/install_cuda.sh; install_121'
RUN sudo bash -c 'source /workspace/builder/common/install_cuda.sh; install_118; prune_118'
RUN sudo bash -c 'source /workspace/builder/common/install_cuda.sh; install_121; prune_121'

# Install miniconda
RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /workspace/Miniconda3-latest-Linux-x86_64.sh
Expand Down

0 comments on commit 2cd5a49

Please sign in to comment.