ColossalAI/examples/language/gpt/experiments/auto_parallel
Hongxin Liu 7f8b16635b
[misc] refactor launch API and tensor constructor (#5666)
* [misc] remove config arg from initialize

* [misc] remove old tensor contrusctor

* [plugin] add npu support for ddp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [devops] fix doc test ci

* [test] fix test launch

* [doc] update launch doc

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-29 10:40:11 +08:00
..
saved_solution [autoparallel] integrate device mesh initialization into autoparallelize (#2393) 2023-01-11 14:03:49 +08:00
README.md [auto] fix install cmd (#3772) 2023-05-18 13:33:01 +08:00
auto_parallel_with_gpt.py [misc] refactor launch API and tensor constructor (#5666) 2024-04-29 10:40:11 +08:00
gpt_modules.py [misc] update pre-commit and run all files (#4752) 2023-09-19 14:20:26 +08:00
requirements.txt [auto] fix requirements typo for issue #3125 (#3209) 2023-03-23 10:22:08 +08:00

README.md

Auto-Parallelism with GPT2

Requirements

Before you can launch training, you need to install the following requirements.

Install PyTorch

#conda
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.3 -c pytorch
#pip
pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu113

Install Colossal-AI

pip install colossalai==0.2.0

Install transformers

pip install transformers

Install pulp and coin-or-cbc

pip install pulp
conda install -c conda-forge coin-or-cbc

Dataset

For simplicity, the input data is randomly generated here.

Training

#Run the auto parallel resnet example with 4 GPUs with a dummy dataset.
colossalai run --nproc_per_node 4 auto_parallel_with_gpt.py