Debian Codegraph @

docker/README.md

raw
1 <!---
2 Copyright 2024 The HuggingFace Team. All rights reserved.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 -->
16
17 # Official Hugging Face Accelerate Docker Images
18
19 Accelerate publishes a variety of docker versions as part of our CI that users can also use. These are stable images that Accelerate can run off of which comes with a variety of different setup configurations, all of which are officially hosted on [Docker Hub](https://hub.docker.com/r/huggingface/accelerate).
20
21 A breakdown of each are given below
22
23 ## Naming Conventions
24
25 Accelerate docker images follow a tagging convention of:
26
27 ```bash
28 huggingface/accelerate:{accelerator}-{nightly,release}
29 ```
30
31 `accelerator` in this instance is one of many applical pre-configured backend supports:
32 * `gpu`: Comes compiled off of the `nvidia/cuda` image and includes core parts like `bitsandbytes`. Runs off python 3.9.
33 * `cpu`: Comes compiled off of `python:3.9-slim` and is designed for non-CUDA based workloads.
34 * More to come soon
35 * `gpu-deepspeed`: Comes compiled off of the `nvidia/cuda` image and includes core parts like `bitsandbytes` as well as the latest `deepspeed` version. Runs off python 3.10.
36 * `gpu-fp8-transformerengine`: Comes compiled off of `nvcr.io/nvidia/pytorch` and is specifically for running the `benchmarks/fp8` scripts on devices which support FP8 operations using the `TransformerEngine` library (RTX 4090, H100, etc)
37
38 ## Nightlies vs Releases
39
40 Each release a new build is pushed with a version number included in the name. For a GPU-supported image of version 0.28.0 for instance, it would look like the following:
41
42 ```bash
43 huggingface/accelerate:gpu-release-0.28.0
44 ```
45
46 Nightlies contain two different image tags. There is a general `nightly` tag which is built each night, and a `nightly-YYYY-MM-DD` which corresponds to a build from a particular date.
47
48 For instance, here is an example nightly CPU image from 3/14/2024
49
50 ```bash
51 huggingface/accelerate:cpu-nightly-2024-03-14
52 ```
53
54 ## Running the images
55
56 Each image comes compiled with `conda` and an `accelerate` environment contains all of the installed dependencies.
57
58 To pull down the latest nightly run:
59
60 ```bash
61 docker pull huggingface/accelerate:gpu-nightly
62 ```
63
64 To then run it in interactive mode with GPU-memory available, run:
65
66 ```bash
67 docker container run --gpus all -it huggingface/accelerate:gpu-nightly
68 ```
69
70 ## DEPRECATED IMAGES
71
72 CPU and GPU docker images were hosted at `huggingface/accelerate-gpu` and `huggingface/accelerate-cpu`. These builds are now outdated and will not receive updates.
73
74 The builds at the corresponding `huggingface/accelerate:{gpu,cpu}` contain the same `Dockerfile`, so it's as simple as changing the docker image to the desired ones from above. We will not be deleting these images for posterity, but they will not be receiving updates going forward.