#!/bin/bash -l

# SLURM SUBMIT SCRIPT
#SBATCH --job-name=d-1b
#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=...)
#SBATCH --cpus-per-task=8    # Number of cores per tasks


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

# activate conda env
conda activate suno_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


# --local-data-shard-dir /mnt/localdisk/cjs_shards \

# have to lower batch size to 3 for 1b model and qk_norm

# run script from above
srun python3 ./train.py \
--dataset-config stable_audio_tools/configs/dataset_configs/memmap_semantic+text_dac_25hz.json \
--model-config stable_audio_tools/configs/model_configs/txt2audio/stable_audio_2_0_semantic+text_48khz_lg_dac_25hz.json \
--name harmonai_train \
--checkpoint-every 20000 \
--num-gpus 8 \
--num-nodes 1 \
--batch-size 4