ColossalAI/examples/tutorial/hybrid_parallel
Hongxin Liu 554aa9592e
[legacy] move communication and nn to legacy and refactor logger (#4671)
* [legacy] move communication to legacy (#4640)

* [legacy] refactor logger and clean up legacy codes (#4654)

* [legacy] make logger independent to gpc

* [legacy] make optim independent to registry

* [legacy] move test engine to legacy

* [legacy] move nn to legacy (#4656)

* [legacy] move nn to legacy

* [checkpointio] fix save hf config

* [test] remove useledd rpc pp test

* [legacy] fix nn init

* [example] skip tutorial hybriad parallel example

* [devops] test doc check

* [devops] test doc check
2023-09-11 16:24:28 +08:00
..
README.md [example] updated the hybrid parallel tutorial (#2444) 2023-01-11 15:17:17 +08:00
config.py [example] updated the hybrid parallel tutorial (#2444) 2023-01-11 15:17:17 +08:00
requirements.txt [example] updated the hybrid parallel tutorial (#2444) 2023-01-11 15:17:17 +08:00
test_ci.sh [legacy] move communication and nn to legacy and refactor logger (#4671) 2023-09-11 16:24:28 +08:00
train.py [legacy] move communication and nn to legacy and refactor logger (#4671) 2023-09-11 16:24:28 +08:00

README.md

Multi-dimensional Parallelism with Colossal-AI

Table of contents

📚 Overview

This example lets you to quickly try out the hybrid parallelism provided by Colossal-AI. You can change the parameters below to try out different settings in the config.py.

# parallel setting
TENSOR_PARALLEL_SIZE = 2
TENSOR_PARALLEL_MODE = '1d'

parallel = dict(
    pipeline=2,
    tensor=dict(mode=TENSOR_PARALLEL_MODE, size=TENSOR_PARALLEL_SIZE),
)

🚀 Quick Start

  1. Install PyTorch

  2. Install the dependencies.

pip install -r requirements.txt
  1. Run the training scripts with synthetic data.
colossalai run --nproc_per_node 4 train.py --config config.py
  1. Modify the config file to play with different types of tensor parallelism, for example, change tensor parallel size to be 4 and mode to be 2d and run on 8 GPUs.