sayakpaul HF staff commited on
Commit
4fcfeed
1 Parent(s): e3e0ff8

Upload run_sdxl_fast_benchmark.slurm with huggingface_hub

Browse files
Files changed (1) hide show
  1. run_sdxl_fast_benchmark.slurm +64 -0
run_sdxl_fast_benchmark.slurm ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ #SBATCH --job-name=benchmarking
3
+ #SBATCH --nodes=1
4
+ #SBATCH --qos=normal
5
+ # set 2h for job wall time limit
6
+ #SBATCH --time=02:00:00
7
+ # activate the requeue option
8
+ #SBATCH --requeue
9
+ #SBATCH --ntasks-per-node=1
10
+ #SBATCH --cpus-per-task=12
11
+ #SBATCH --gres=gpu:1
12
+ #SBATCH --mem-per-cpu=10G
13
+ #SBATCH --partition=production-cluster
14
+ #SBATCH -o /fsx/sayak/logs/benchmarking-job/sdxl-fast-%x-%j.out
15
+
16
+
17
+ set -x -e
18
+
19
+ source /admin/home/sayak/.bashrc
20
+ source /admin/home/sayak/miniconda3/etc/profile.d/conda.sh
21
+ conda activate /fsx/sayak
22
+
23
+ echo "START TIME: $(date)"
24
+
25
+ REPO=/fsx/sayak/sdxl-fast
26
+ OUTPUT_DIR=/fsx/sayak/benchmarking
27
+ LOG_PATH=$OUTPUT_DIR/main_log.txt
28
+
29
+ mkdir -p $OUTPUT_DIR
30
+ touch $LOG_PATH
31
+ pushd $REPO
32
+
33
+ PROGRAM="run_specific.sh"
34
+
35
+ # Note: it is important to escape `$SLURM_PROCID` since we want the srun on each node to evaluate this variable
36
+ export LAUNCHER="CUDA_VISIBLE_DEVICES=0 bash"
37
+
38
+
39
+ export CMD="$LAUNCHER $PROGRAM"
40
+ echo $CMD
41
+
42
+
43
+ # AWS specific
44
+ export NCCL_PROTO=simple
45
+ export RDMAV_FORK_SAFE=1
46
+ export FI_EFA_FORK_SAFE=1
47
+ export FI_EFA_USE_DEVICE_RDMA=1
48
+ export FI_PROVIDER=efa
49
+ export FI_LOG_LEVEL=1
50
+ export NCCL_IB_DISABLE=1
51
+ export NCCL_SOCKET_IFNAME=ens
52
+
53
+
54
+ # srun error handling:
55
+ # --wait=60: wait 60 sec after the first task terminates before terminating all remaining tasks
56
+ # --kill-on-bad-exit=1: terminate a step if any task exits with a non-zero exit code
57
+ SRUN_ARGS=" \
58
+ --wait=60 \
59
+ --kill-on-bad-exit=1 \
60
+ "
61
+
62
+ clear; srun $SRUN_ARGS --jobid $SLURM_JOB_ID bash -c "$CMD" 2>&1 | tee $LOG_PATH
63
+
64
+ echo "END TIME: $(date)"