universuen/ViT-Fine-Tuning-with-ColossalAI

1

stars

2

commits

Python

primary language

Apr 7, 2024

updated

README

ViT Fine-Tuning with ColossalAI

  • Model: google/vit-base-patch16-224
  • Dataset: beans
  • Parallel Strategy: gemini

Experiment Environment

  • Python 3.9.19
  • NVIDIA Tesla V100-SXM2-32GB * 4
  • CUDA 11.0

Steps to Run

  1. Install torch in conda
conda install pytorch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 pytorch-cuda=11.8 -c pytorch -c nvidia
  1. Update gcc
conda install -c conda-forge gcc=9.5.0 gxx=9.5.0
  1. Install ColossalAI from scratch
cd ColossalAI
CUDA_EXT=1 pip install .
cd ..
  1. Clear torch_extensions cache
rm -r  ~/.cache/colossalai/torch_extensions/
  1. Install dependencies
pip install -r requirements.txt
  1. Run demo with the following command (The terminal may look like stuck at this step, because all outputs are redirected to output.txt)
sh run_demo.sh > output.txt 2>&1
  1. Find the results in output.txt
  2. Run benckmark with the following command
sh run_benchmark.sh > benchmark_output.txt 2>&1
  1. Find the results in benchmark_output.txt

Experiment Results

run_demo.sh

EpochAvg LossAccuracy
11.13800.8828
20.26510.9844
30.11700.9922

run_benchmark.sh

  • batch_size = 8
PluginThroughputMaximum Memory Usage per GPU
torch_ddp120.50871.75 GB
torch_ddp_fp16146.93611.75 GB
low_level_zero90.8185696.72 MB
gemini92.5829331.88 MB
hybrid_parallel72.6727417.03 MB
  • batch_size = 32
PluginThroughputMaximum Memory Usage per GPU
torch_ddp191.38592.13 GB
torch_ddp_fp16463.27532.05 GB
low_level_zero300.5291890.97 MB
gemini385.2396523.21 MB
hybrid_parallel99.5983431.50 MB

Contributors

universuen

2 commits

universuen/ViT-Fine-Tuning-with-ColossalAI

1

stars

2

commits

Python

primary language

Apr 7, 2024

updated

README

ViT Fine-Tuning with ColossalAI

  • Model: google/vit-base-patch16-224
  • Dataset: beans
  • Parallel Strategy: gemini

Experiment Environment

  • Python 3.9.19
  • NVIDIA Tesla V100-SXM2-32GB * 4
  • CUDA 11.0

Steps to Run

  1. Install torch in conda
conda install pytorch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 pytorch-cuda=11.8 -c pytorch -c nvidia
  1. Update gcc
conda install -c conda-forge gcc=9.5.0 gxx=9.5.0
  1. Install ColossalAI from scratch
cd ColossalAI
CUDA_EXT=1 pip install .
cd ..
  1. Clear torch_extensions cache
rm -r  ~/.cache/colossalai/torch_extensions/
  1. Install dependencies
pip install -r requirements.txt
  1. Run demo with the following command (The terminal may look like stuck at this step, because all outputs are redirected to output.txt)
sh run_demo.sh > output.txt 2>&1
  1. Find the results in output.txt
  2. Run benckmark with the following command
sh run_benchmark.sh > benchmark_output.txt 2>&1
  1. Find the results in benchmark_output.txt

Experiment Results

run_demo.sh

EpochAvg LossAccuracy
11.13800.8828
20.26510.9844
30.11700.9922

run_benchmark.sh

  • batch_size = 8
PluginThroughputMaximum Memory Usage per GPU
torch_ddp120.50871.75 GB
torch_ddp_fp16146.93611.75 GB
low_level_zero90.8185696.72 MB
gemini92.5829331.88 MB
hybrid_parallel72.6727417.03 MB
  • batch_size = 32
PluginThroughputMaximum Memory Usage per GPU
torch_ddp191.38592.13 GB
torch_ddp_fp16463.27532.05 GB
low_level_zero300.5291890.97 MB
gemini385.2396523.21 MB
hybrid_parallel99.5983431.50 MB

Contributors

universuen

2 commits

Languages

Python

94.4%

HTML

2.0%

C++

1.6%

Cuda

1.1%