README.md 1006 Bytes
Newer Older
1
# Large Batch Training Optimization
2

3
## Table of contents
4

5
6
7
8
- [Large Batch Training Optimization](#large-batch-training-optimization)
  - [Table of contents](#table-of-contents)
  - [📚 Overview](#-overview)
  - [🚀 Quick Start](#-quick-start)
9

10
## 📚 Overview
11

12
This example lets you to quickly try out the large batch training optimization provided by Colossal-AI. We use synthetic dataset to go through the process, thus, you don't need to prepare any dataset. You can try out the `Lamb` and `Lars` optimizers from Colossal-AI with the following code.
13

14
15
```python
from colossalai.nn.optimizer import Lamb, Lars
16
17
```

18
19
20
## 🚀 Quick Start

1. Install PyTorch
21

22
23
24
25
26
2. Install the dependencies.

```bash
pip install -r requirements.txt
```
27

28
3. Run the training scripts with synthetic data.
29
30

```bash
31
32
33
# run on 4 GPUs
# run with lars
colossalai run --nproc_per_node 4 train.py --config config.py --optimizer lars
34

35
36
# run with lamb
colossalai run --nproc_per_node 4 train.py --config config.py --optimizer lamb
37
```