-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_raw.sh
executable file
·54 lines (48 loc) · 1.43 KB
/
run_raw.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#SBATCH --nodes=24
#SBATCH --ntasks-per-node=1
#SBATCH -o logs_raw/%j.out
#SBATCH -e logs_raw/%j.err
#SBATCH --gres=gpu:32g:6
#SBATCH --mem=200GB
#SBATCH --cpus-per-task=16
#SBATCH --time=6:00:00
#SBATCH --job-name=raw
#SBATCH [email protected]
# activate conda environment
source ~/.bashrc_bk
eval "$(conda shell.bash hook)"
conda activate ego
#source scripts/cache.sh
# reference: https://huggingface.co/docs/transformers/main/main_classes/deepspeed#launching-in-a-slurm-environment
export GPUS_PER_NODE=6
export MASTER_ADDR=$(scontrol show hostnames $SLURM_JOB_NODELIST | head -n 1)
export MASTER_PORT=8000
export WANDB_MODE=disabled
echo "GPUS_PER_NODE: $GPUS_PER_NODE"
echo "SLURM_NNODES: $SLURM_NNODES"
echo "SLURM_NODEID: $SLURM_NODEID"
echo "MASTER_ADDR: $MASTER_ADDR"
echo "MASTER_PORT: $MASTER_PORT"
export LOGLEVEL=INFO
export NCCL_DEBUG=INFO
export NCCL_BLOCKING_WAIT=1
export TORCH_DISTRIBUTED_DETAIL=DEBUG
# ====
# Note: sbatch doesn't read command line arguments as expected.
# Use scripts/submit_training_jobs.py to submit this script and set {extra} there
# ====
# --deepspeed ds_config.json \
srun bash -c 'torchrun \
--nproc_per_node $GPUS_PER_NODE \
--nnodes $SLURM_NNODES \
--node_rank $SLURM_PROCID \
--master_addr $MASTER_ADDR \
--master_port $MASTER_PORT \
train_rtx.py \
--batch_size 2 \
--lr 7e-5 \
--save_id 1 \
--image_size 64 \
--H 8 \
--job_name raw'