mirror of https://github.com/hpcaitech/ColossalAI
![]() * [legacy] remove outdated codes of pipeline (#4692) * [legacy] remove cli of benchmark and update optim (#4690) * [legacy] remove cli of benchmark and update optim * [doc] fix cli doc test * [legacy] fix engine clip grad norm * [legacy] remove outdated colo tensor (#4694) * [legacy] remove outdated colo tensor * [test] fix test import * [legacy] move outdated zero to legacy (#4696) * [legacy] clean up utils (#4700) * [legacy] clean up utils * [example] update examples * [legacy] clean up amp * [legacy] fix amp module * [legacy] clean up gpc (#4742) * [legacy] clean up context * [legacy] clean core, constants and global vars * [legacy] refactor initialize * [example] fix examples ci * [example] fix examples ci * [legacy] fix tests * [example] fix gpt example * [example] fix examples ci * [devops] fix ci installation * [example] fix examples ci |
||
---|---|---|
.. | ||
saved_solution | ||
README.md | ||
auto_parallel_with_gpt.py | ||
gpt_modules.py | ||
requirements.txt |
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