mirror of https://github.com/hpcaitech/ColossalAI
![]() * update accelerator * fix timer * fix amp * update * fix * update bug * add error raise * fix autocast * fix set device * remove doc accelerator * update doc * update doc * update doc * use nullcontext * update cpu * update null context * change time limit for example * udpate * update * update * update * [npu] polish accelerator code --------- Co-authored-by: Xuanlei Zhao <xuanlei.zhao@gmail.com> Co-authored-by: zxl <43881818+oahzxl@users.noreply.github.com> |
||
---|---|---|
.. | ||
README.md | ||
data.py | ||
finetune.py | ||
requirements.txt | ||
test_ci.sh |
README.md
Finetune BERT on GLUE
🚀 Quick Start
This example provides a training script, which provides an example of finetuning BERT on GLUE dataset.
- Training Arguments
-t
,--task
: GLUE task to run. Defaults tomrpc
.-p
,--plugin
: Plugin to use. Choices:torch_ddp
,torch_ddp_fp16
,gemini
,low_level_zero
. Defaults totorch_ddp
.--target_f1
: Target f1 score. Raise exception if not reached. Defaults toNone
.
Install requirements
pip install -r requirements.txt
Train
# train with torch DDP with fp32
colossalai run --nproc_per_node 4 finetune.py
# train with torch DDP with mixed precision training
colossalai run --nproc_per_node 4 finetune.py -p torch_ddp_fp16
# train with gemini
colossalai run --nproc_per_node 4 finetune.py -p gemini
# train with low level zero
colossalai run --nproc_per_node 4 finetune.py -p low_level_zero
Expected F1-score will be:
Model | Single-GPU Baseline FP32 | Booster DDP with FP32 | Booster DDP with FP16 | Booster Gemini | Booster Low Level Zero |
---|---|---|---|---|---|
bert-base-uncased | 0.86 | 0.88 | 0.87 | 0.88 | 0.89 |