ofa_search.sh (1670B)
1 #!/bin/bash 2 #SBATCH -A lco@gpu 3 #SBATCH -C v100-32g 4 #SBATCH --job-name=mmsrl # job name 5 #SBATCH --ntasks=1 # number of MP tasks 6 #SBATCH --ntasks-per-node=1 # number of MPI tasks per node 7 #SBATCH --gres=gpu:1 # number of GPUs per node 8 #SBATCH --cpus-per-task=10 # number of cores per tasks 9 #SBATCH --hint=nomultithread # we get physical cores not logical 10 #SBATCH --distribution=block:block # we pin the tasks on contiguous cores 11 #SBATCH --time=5:00:00 # maximum execution time (HH:MM:SS) 12 #SBATCH --output=ofa_%j_%x_%A_%a.out # output file name 13 #SBATCH --error=ofa_%j_%x_%A_%a.err # error file name 14 #SBATCH --array=0-35 15 16 17 cd $WORK/mmsrl 18 19 module purge 20 source ~/.bashrc 21 conda activate pytorch 22 export DATA_PATH=$WORK/data 23 24 TASK=('configs/ofa_vqa.py' 'configs/ofa_snli.py') 25 PARAMS=('configs/ofa_repo.py' 'configs/ofa_ours.py' 'configs/ofa_ours.py --freeze_resnet --freeze_embeddings') 26 CYCLE=('--subsample_labels=affine --frequency_factor=0.1 --frequency_bias=0.05' 'configs/alternate_macro_micro.py' 'configs/alternate_macro_micro.py --cyclic_subsample=cyclic_subsample_longer') 27 HEAD=('--ofa_classification_head=False' '--ofa_classification_head=True') 28 itask=$(($SLURM_ARRAY_TASK_ID%2)) 29 iparams=$(($SLURM_ARRAY_TASK_ID%6/2)) 30 icycle=$(($SLURM_ARRAY_TASK_ID%18/6)) 31 ihead=$(($SLURM_ARRAY_TASK_ID/18)) 32 task=${TASK[$itask]} 33 params=${PARAMS[$iparams]} 34 cycle=${CYCLE[$icycle]} 35 head=${HEAD[$ihead]} 36 37 python -m mmsrl.train $task $params $cycle $head --patience=10 --output_val=\"val_${itask}_${iparams}_${icycle}_${ihead}.pkl\" --output_test=\"test_${itask}_${iparams}_${icycle}_${ihead}.pkl\"