From f994b81ad5397d9279e9eaf1c9d8fb50e40f0c35 Mon Sep 17 00:00:00 2001 From: WU Zhenglong Date: Wed, 1 Nov 2023 01:17:44 +0800 Subject: [PATCH] accelerate: add page (#11340) * accelerate: add page * accelerate: modify command description * accelerate: update template format Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> * accelerate: remove inappropriate description Co-authored-by: Juri Dispan * accelerate: update command description Co-authored-by: Juri Dispan * accelerate: fix typo and update appropriate description Co-authored-by: Juri Dispan --------- Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Co-authored-by: Juri Dispan --- pages/common/accelerate.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/common/accelerate.md diff --git a/pages/common/accelerate.md b/pages/common/accelerate.md new file mode 100644 index 000000000..740b03f9a --- /dev/null +++ b/pages/common/accelerate.md @@ -0,0 +1,28 @@ +# Accelerate + +> Accelerate is a library that enables the same PyTorch code to be run across any distributed configuration. +> More information: . + +- Print environment information: + +`accelerate env` + +- Interactively create a configuration file: + +`accelerate config` + +- Print the estimated GPU memory cost of running a huggingface model with different data types: + +`accelerate estimate-memory {{name/model}}` + +- Test an Accelerate configuration file: + +`accelerate test --config_file {{path/to/config.yaml}}` + +- Run a model on CPU with Accelerate: + +`accelerate launch {{path/to/script.py}} {{--cpu}}` + +- Run a model on multi-GPU with Accelerate, with 2 machines: + +`accelerate launch {{path/to/script.py}} --multi_gpu --num_machines {{2}}`