#!/bin/bash #SBATCH -p gpu_rtx6000,gpu_h100,gpu_h200 #SBATCH --gpus=1 #SBATCH -c 6 #SBATCH --mem=96G #SBATCH -t 06:00:00 #SBATCH -J iv_arr #SBATCH -o /home/bjc75/other/finetuning/logs/%x_%A_%a.out # MIT License, Bryan Cheng, 2026. Interventions on the shared GPU queue (backup lane, D-031): one GPU, PW workers claiming # units from the same plan as slurm/iv_devel.sh. IVARGS must match the devel lane. cd /home/bjc75/other/finetuning export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True PYTHONUNBUFFERED=1 TOKENIZERS_PARALLELISM=false HF_HOME=/nfs/roberts/scratch/pi_skr2/bjc75/finetuning/hf_home PY=/nfs/roberts/project/pi_skr2/bjc75/conda_envs/lorapop/bin/python PLANS=${PLANS:-results/interventions/plan_qwen05.json:results/interventions/qwen05 results/interventions/plan_qwen05_raw.json:results/interventions/qwen05_raw} # D-037 [ -n "$PLAN" ] && PLANS="$PLAN:${OUT:-results/interventions/qwen05}" nvidia-smi --query-gpu=name --format=csv,noheader mem=$(nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits | head -1); PW=${PW:-1}; [ "${mem:-0}" -lt 120000 ] && PW=1 # D-035/D-038 for j in $(seq 1 $PW); do ( for pp in $PLANS; do $PY src/run/intervene.py --plan ${pp%%:*} --out ${pp#*:} --claim $IVARGS; done ) > logs/iv_${SLURM_JOB_ID}_w${j}.log 2>&1 & sleep 20 done wait grep -h -v -i warn logs/iv_${SLURM_JOB_ID}_*.log | tail -10