forked from hpcaitech/ColossalAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[example] fix benchmark.sh for gpt example (hpcaitech#2229)
- Loading branch information
Showing
2 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# distplan in ["colossalai", "zero1", "zero2", "torch_ddp", "torch_zero"] | ||
export DISTPAN={$DISTPAN:-"colossalai"} | ||
export DISTPAN=${DISTPAN:-"colossalai"} | ||
|
||
# The following options only valid when DISTPAN="colossalai" | ||
export TPDEGREE=${TPDEGREE:-1} | ||
export GPUNUM=${GPUNUM:-1} | ||
export PLACEMENT=${PLACEMENT:'const'} | ||
export USE_SHARD_INIT=${USE_SHARD_INIT:False} | ||
export BATCH_SIZE=${BATCH_SIZE:-8} | ||
export MODEL_TYPE=${MODEL_TYPE:"gpt2_medium"} | ||
export TPDEGREE=${TPDEGREE:-1} | ||
export PLACEMENT=${PLACEMENT:-"const"} | ||
export USE_SHARD_INIT=${USE_SHARD_INIT:-False} | ||
export BATCH_SIZE=${BATCH_SIZE:-16} | ||
export MODEL_TYPE=${MODEL_TYPE:-"gpt2_medium"} | ||
|
||
mkdir -p logs | ||
torchrun --standalone --nproc_per_node=${GPUNUM} train_gpt_demo.py --tp_degree=${TPDEGREE} --model_type=${MODEL_TYPE} --batch_size=${BATCH_SIZE} --placement ${PLACEMENT} --shardinit ${USE_SHARD_INIT} --distplan ${DISTPAN} 2>&1 | tee ./logs/${MODEL_TYPE}_${DISTPAN}_gpu_${GPUNUM}_bs_${BATCH_SIZE}_tp_${TPDEGREE}.log |