Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

33
accelerate Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# Accelerate
> A library that enables the same PyTorch code to be run across any distributed configuration.
> More information: <https://huggingface.co/docs/accelerate/index>.
- Print environment information:
`accelerate env`
- Interactively create a configuration file:
`accelerate config`
- Print the estimated GPU memory cost of running a Hugging Face 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`