[tab] /hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/logs/logs_mihir/lam/train_lam_minecraft_8node_3431870.log (log)
#!/usr/bin/env bash

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=4
#SBATCH --time=00:10:00
#SBATCH --partition=dev_accelerated
#SBATCH --cpus-per-task=5
#SBATCH --gres=gpu:4
#SBATCH --output=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/logs/logs_mihir/lam/train_lam_minecraft_8node_%j.log
#SBATCH --error=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/logs/logs_mihir/lam/train_lam_minecraft_8node_%j.log
#SBATCH --job-name=train_lam_minecraft_1node_dev
#SBATCH --requeue
#SBATCH --signal=b:usr1@300 # 5 min before timeout

# --- signal trap to requeue job before timeout ---
requeue_job() {
    echo "[$(date)] caught sigusr1 (timeout warning), requeueing slurm job $SLURM_JOB_ID..."
    scontrol requeue $SLURM_JOB_ID
    exit 0
}

trap requeue_job sigusr1

# set checkpoint flag based on restart count
restart_count=$(scontrol show job $SLURM_JOB_ID | grep -o 'Restarts=[0-9]*' | cut -d'=' -f2)

if [ $restart_count -eq 0 ]; then
    restore_ckpt_flag="--no-restore-ckpt"
else
    restore_ckpt_flag="--restore-ckpt"
fi

# Log the sbatch script
cat $0

module unload mpi/openmpi/5.0
module unload devel/cuda/12.4
source .venv/bin/activate

array_records_dir=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data_new/open_ai_minecraft_arrayrecords_chunked

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

CHECKPOINT_DIR=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/checkpoints/mihir/lam/$job_name/$slurm_job_id
mkdir -p $CHECKPOINT_DIR

env | grep SLURM

srun python lam.py \
    --num_steps=100 \
    --save_ckpt \
    $restore_ckpt_flag \
    --wandb_id $slurm_job_id \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=20 \
    --init_lr=0 \
    --max_lr=1e-4 \
    --log_image_interval=1000 \
    --log \
    --log_checkpoint_interval=1000 \
    --name=lam-minecraft-1-node-dev-$slurm_job_id \
    --tags lam minecraft 1-node \
    --entity instant-uv \
    --project jafar \
    --num_latents=100 \
    --data_dir $array_records_dir &

child_pid=$!

wait $child_pid
SLURM_JOB_USER=tum_cte0515
SLURM_TASKS_PER_NODE=4
SLURM_JOB_UID=999226
SLURM_TASK_PID=382462
SLURM_JOB_GPUS=0,1,2,3
SLURM_LOCALID=0
SLURM_SUBMIT_DIR=/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jafar
SLURMD_NODENAME=hkn0401
SLURM_JOB_START_TIME=1755631153
SLURM_CLUSTER_NAME=hk
SLURM_JOB_END_TIME=1755631753
SLURM_CPUS_ON_NODE=24
SLURM_JOB_CPUS_PER_NODE=24
SLURM_GPUS_ON_NODE=4
SLURM_GTIDS=0
SLURM_JOB_PARTITION=dev_accelerated
SLURM_TRES_PER_TASK=cpu=5
SLURM_OOM_KILL_STEP=0
SLURM_JOB_NUM_NODES=1
SLURM_JOBID=3431870
SLURM_JOB_QOS=normal
SLURM_PROCID=0
SLURM_CPUS_PER_TASK=5
SLURM_NTASKS=4
SLURM_TOPOLOGY_ADDR=hkibb.hkibbi1.hkibbi1e11.hkn0401
SLURM_TOPOLOGY_ADDR_PATTERN=switch.switch.switch.node
SLURM_SCRIPT_CONTEXT=prolog_task
SLURM_NODELIST=hkn0401
SLURM_JOB_ACCOUNT=hk-project-p0023960
SLURM_PRIO_PROCESS=0
SLURM_NPROCS=4
SLURM_NNODES=1
SLURM_SUBMIT_HOST=hkn1991.localdomain
SLURM_JOB_ID=3431870
SLURM_NODEID=0
SLURM_CONF=/etc/slurm/slurm.conf
SLURM_JOB_NAME=train_lam_minecraft_1node_dev
SLURM_NTASKS_PER_NODE=4
SLURM_JOB_GID=502226
SLURM_JOB_NODELIST=hkn0401
GpuFreq=control_disabled
/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jafar/.venv/bin/python: can't open file '/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jafar/lam.py': [Errno 2] No such file or directory
/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jafar/.venv/bin/python: can't open file '/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jafar/lam.py': [Errno 2] No such file or directory
/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jafar/.venv/bin/python: can't open file '/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jafar/lam.py': [Errno 2] No such file or directory
/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jafar/.venv/bin/python: can't open file '/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jafar/lam.py': [Errno 2] No such file or directory
srun: error: hkn0401: tasks 0-3: Exited with exit code 2

============================= JOB FEEDBACK =============================

Job ID: 3431870
Cluster: hk
User/Group: tum_cte0515/hk-project-p0023960
Account: hk-project-p0023960
State: FAILED (exit code 2)
Partition: dev_accelerated
Nodes: 1
Cores per node: 24
Nodelist: hkn0401
CPU Utilized: 00:00:00
CPU Efficiency: 0.00% of 00:10:48 core-walltime
Job Wall-clock time: 00:00:27
Starttime: Tue Aug 19 21:19:13 2025
Endtime: Tue Aug 19 21:19:40 2025
Memory Utilized: 10.32 MB
Memory Efficiency: 0.00% of 0.00 MB
Energy Consumed: 285481 Joule / 79.3002777777778 Watthours
Average node power draw: 10573.3703703704 Watt