mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-25 11:44:03 +00:00
[example] update ViT example using booster api (#3940)
This commit is contained in:
27
examples/images/vit/run_benchmark.sh
Normal file
27
examples/images/vit/run_benchmark.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
set -xe
|
||||
pip install -r requirements.txt
|
||||
|
||||
export BS=8
|
||||
export MEMCAP=0
|
||||
export GPUNUM=1
|
||||
|
||||
for BS in 8 32 128
|
||||
do
|
||||
for PLUGIN in "torch_ddp" "torch_ddp_fp16" "low_level_zero" "gemini"
|
||||
do
|
||||
for GPUNUM in 1 4
|
||||
do
|
||||
|
||||
MODEL_PATH="google/vit-base-patch16-224"
|
||||
torchrun \
|
||||
--standalone \
|
||||
--nproc_per_node ${GPUNUM} \
|
||||
vit_benchmark.py \
|
||||
--model_name_or_path ${MODEL_PATH} \
|
||||
--mem_cap ${MEMCAP} \
|
||||
--plugin ${PLUGIN} \
|
||||
--batch_size ${BS}
|
||||
|
||||
done
|
||||
done
|
||||
done
|
Reference in New Issue
Block a user