-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
184 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# mpi version for node rank | ||
H=`hostname` | ||
THEID=`echo -e $HOSTNAMES | python3 -c "import sys;[sys.stdout.write(str(i)) for i,line in enumerate(next(sys.stdin).split(' ')) if line.strip() == '$H'.strip()]"` | ||
export NODE_RANK=${THEID} | ||
echo THEID=$THEID | ||
|
||
echo "##########################################" | ||
echo MASTER_ADDR=${MASTER_ADDR} | ||
echo MASTER_PORT=${MASTER_PORT} | ||
echo NODE_RANK=${NODE_RANK} | ||
echo WORLD_SIZE=${WORLD_SIZE} | ||
echo CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES} | ||
echo SLURM_PROCID=${SLURM_PROCID} | ||
echo "##########################################" | ||
# debug environment worked great so we stick with it | ||
# no magic there, just a miniconda python=3.9, pytorch=1.12, cudatoolkit=11.3 | ||
# env with pip dependencies from stable diffusion's requirements.txt | ||
eval "$(/fsx/stable-diffusion/debug/miniconda3/bin/conda shell.bash hook)" | ||
#conda activate stable | ||
conda activate torch111 | ||
cd /fsx/stable-diffusion/stable-diffusion | ||
|
||
#/bin/bash /fsx/stable-diffusion/stable-diffusion/scripts/test_gpu.sh | ||
|
||
EXTRA="--indir /fsx/stable-diffusion/data/eval-inpainting/random_thick_512 --worldsize 8 --rank ${SLURM_PROCID}" | ||
EXTRA="${EXTRA} --ckpt ${1} --outdir /fsx/stable-diffusion/stable-diffusion/inpainting-eval-results/${2}" | ||
|
||
echo "Running ${EXTRA}" | ||
cd /fsx/stable-diffusion/stable-diffusion/ | ||
python scripts/inpaint_sd.py ${EXTRA} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
#SBATCH --partition=gpu | ||
#SBATCH --job-name=stable-diffusion-inpainting-eval | ||
#SBATCH --nodes 1 | ||
#SBATCH --ntasks-per-node 8 | ||
#SBATCH --cpus-per-gpu=4 | ||
#SBATCH --gpus-per-task=1 | ||
#SBATCH --exclusive | ||
#SBATCH --output=%x_%j.out | ||
#SBATCH --comment=stablediffusion | ||
#SBATCH --no-requeue | ||
|
||
module load intelmpi | ||
source /opt/intel/mpi/latest/env/vars.sh | ||
export LD_LIBRARY_PATH=/opt/aws-ofi-nccl/lib:/opt/amazon/efa/lib64:/usr/local/cuda-11.0/efa/lib:/usr/local/cuda-11.0/lib:/usr/local/cuda-11.0/lib64:/usr/local/cuda-11.0:/opt/nccl/build/lib:/opt/aws-ofi-nccl-install/lib:/opt/aws-ofi-nccl/lib:$LD_LIBRARY_PATH | ||
export NCCL_PROTO=simple | ||
export PATH=/opt/amazon/efa/bin:$PATH | ||
export LD_PRELOAD="/opt/nccl/build/lib/libnccl.so" | ||
export FI_EFA_FORK_SAFE=1 | ||
export FI_LOG_LEVEL=1 | ||
export FI_EFA_USE_DEVICE_RDMA=1 # use for p4dn | ||
export NCCL_DEBUG=info | ||
export PYTHONFAULTHANDLER=1 | ||
export CUDA_LAUNCH_BLOCKING=0 | ||
export OMPI_MCA_mtl_base_verbose=1 | ||
export FI_EFA_ENABLE_SHM_TRANSFER=0 | ||
export FI_PROVIDER=efa | ||
export FI_EFA_TX_MIN_CREDITS=64 | ||
export NCCL_TREE_THRESHOLD=0 | ||
|
||
# sent to sub script | ||
export HOSTNAMES=`scontrol show hostnames "$SLURM_JOB_NODELIST"` | ||
export MASTER_ADDR=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | head -n 1) | ||
export MASTER_PORT=12802 | ||
export COUNT_NODE=`scontrol show hostnames "$SLURM_JOB_NODELIST" | wc -l` | ||
export WORLD_SIZE=$COUNT_NODE | ||
|
||
echo go $COUNT_NODE | ||
echo $HOSTNAMES | ||
echo $WORLD_SIZE | ||
|
||
echo "Starting" | ||
srun --comment stablediffusion --mpi=pmix_v3 /fsx/stable-diffusion/stable-diffusion/scripts/slurm/eval_inpainting/launcher.sh $ckpt $outdir |