#!/bin/bash -l

# SLURM SUBMIT SCRIPT
#SBATCH --job-name=ae-rvq
#SBATCH --nodes=1             # This needs to match Trainer(num_nodes=...)
#SBATCH --gres=gpu:8
#SBATCH --ntasks-per-node=8   # This needs to match Trainer(devices=...)

# ACTIVATE ANACONDA
eval "$(conda shell.bash hook)"

# activate conda env
conda activate stable-audio-tools-env

# debugging flags (optional)
export NCCL_DEBUG=INFO
export PYTHONFAULTHANDLER=1

# on your cluster you might need these:
# set the network interface
# export NCCL_SOCKET_IFNAME=^docker0,lo

# might need the latest CUDA
#module load NCCL/2.4.7-1-cuda.10.0

# run script from above
srun python3 ./train.py \
--dataset-config stable_audio_tools/configs/dataset_configs/audio_2ch_48khz_lg.json \
--model-config stable_audio_tools/configs/model_configs/autoencoders/stable_audio_2_0_rvq_48khz.json \
--name harmonai_train \
--num-gpus 8 \
--num-nodes 1 \
--batch-size 6