2023-02-18 02:46:44 +00:00
|
|
|
#!/bin/bash
|
2023-02-18 02:07:22 +00:00
|
|
|
source ./venv/bin/activate
|
2023-03-03 04:37:18 +00:00
|
|
|
|
|
|
|
GPUS=$1
|
|
|
|
CONFIG=$2
|
|
|
|
PORT=1234
|
|
|
|
|
|
|
|
if (( $GPUS > 1 )); then
|
2023-03-04 20:53:00 +00:00
|
|
|
torchrun --nproc_per_node=$GPUS --master_port=$PORT ./src/train.py -opt "$CONFIG" --launcher=pytorch
|
2023-03-03 04:37:18 +00:00
|
|
|
else
|
|
|
|
python3 ./src/train.py -opt "$CONFIG"
|
|
|
|
fi
|
2023-02-18 02:07:22 +00:00
|
|
|
deactivate
|