[tab] /hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/logs/logs_mihir/coinrun/dynamics/maskgit/train_dynamics_maskgit_3532455.log (log)
#!/usr/bin/env bash

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=4
#SBATCH --time=48:00:00
#SBATCH --partition=accelerated
#SBATCH --cpus-per-task=5
#SBATCH --gres=gpu:4
#SBATCH --output=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/logs/logs_mihir/coinrun/dynamics/maskgit/%x_%j.log
#SBATCH --error=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/logs/logs_mihir/coinrun/dynamics/maskgit/%x_%j.log
#SBATCH --job-name=train_dynamics_maskgit
#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..."
    # optional: trigger checkpoint saving here
    # e.g., touch $checkpoint_dir/requeue_trigger
    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_train=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data_coinrun/coinrun_episodes_10m_gt_actions_split/train
array_records_dir_val=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data_coinrun/coinrun_episodes_10m_gt_actions_split/val

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

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

tokenizer_ckpt_dir=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/checkpoints/big-runs/tokenizer/train_tokenizer_default/3528955

env | grep SLURM

srun python jasmine/train_dynamics.py \
    --save_ckpt \
    $restore_ckpt_flag \
    --wandb_id $SLURM_JOB_ID \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=110 \
    --image_height=64 \
    --image_width=64 \
    --patch_size=16 \
    --max_lr=3e-5 \
    --log_image_interval=1000 \
    --log \
    --log_checkpoint_interval=1000 \
    --name=coinrun-dynamics-maskgit-default-$slurm_job_id \
    --tags coinrun dynamics maskgit default \
    --entity instant-uv \
    --project jafar \
    --tokenizer_checkpoint=$tokenizer_ckpt_dir \
    --eval_full_frame \
    --data_dir $array_records_dir_train \
    --val_data_dir $array_records_dir_val &

child_pid=$!

wait $child_pid/var/spool/slurmd/job3532455/slurm_script: line 42: .venv/bin/activate: No such file or directory
SLURM_JOB_USER=tum_cte0515
SLURM_TASKS_PER_NODE=4
SLURM_JOB_UID=999226
SLURM_TASK_PID=640435
SLURM_JOB_GPUS=0,1,2,3
SLURM_LOCALID=0
SLURM_SUBMIT_DIR=/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jasmine_jobs_2
SLURMD_NODENAME=hkn0730
SLURM_JOB_START_TIME=1759225487
SLURM_CLUSTER_NAME=hk
SLURM_JOB_END_TIME=1759398287
SLURM_CPUS_ON_NODE=24
SLURM_JOB_CPUS_PER_NODE=24
SLURM_GPUS_ON_NODE=4
SLURM_GTIDS=0
SLURM_JOB_PARTITION=accelerated
SLURM_TRES_PER_TASK=cpu=5
SLURM_OOM_KILL_STEP=0
SLURM_JOB_NUM_NODES=1
SLURM_JOBID=3532455
SLURM_JOB_QOS=normal
SLURM_PROCID=0
SLURM_CPUS_PER_TASK=5
SLURM_NTASKS=4
SLURM_TOPOLOGY_ADDR=hkibb.hkibbi1.hkibbi1e9.hkn0730
SLURM_TOPOLOGY_ADDR_PATTERN=switch.switch.switch.node
SLURM_SCRIPT_CONTEXT=prolog_task
SLURM_NODELIST=hkn0730
SLURM_JOB_ACCOUNT=hk-project-p0023960
SLURM_PRIO_PROCESS=0
SLURM_NPROCS=4
SLURM_NNODES=1
SLURM_SUBMIT_HOST=hkn1990.localdomain
SLURM_JOB_ID=3532455
SLURM_NODEID=0
SLURM_CONF=/etc/slurm/slurm.conf
SLURM_JOB_NAME=train_dynamics_maskgit
SLURM_NTASKS_PER_NODE=4
SLURM_JOB_GID=502226
SLURM_JOB_NODELIST=hkn0730
GpuFreq=control_disabled
Running on 4 devices.
Traceback (most recent call last):
  File "/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jasmine_jobs_2/jasmine/train_dynamics.py", line 790, in <module>
    main(args)
  File "/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jasmine_jobs_2/jasmine/train_dynamics.py", line 386, in main
    raise ValueError(
ValueError: Global batch size 110 must be divisible by number of devices 4.
Running on 4 devices.
Traceback (most recent call last):
  File "/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jasmine_jobs_2/jasmine/train_dynamics.py", line 790, in <module>
    main(args)
  File "/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jasmine_jobs_2/jasmine/train_dynamics.py", line 386, in main
    raise ValueError(
ValueError: Global batch size 110 must be divisible by number of devices 4.
Running on 4 devices.
Traceback (most recent call last):
  File "/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jasmine_jobs_2/jasmine/train_dynamics.py", line 790, in <module>
    main(args)
  File "/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jasmine_jobs_2/jasmine/train_dynamics.py", line 386, in main
    raise ValueError(
ValueError: Global batch size 110 must be divisible by number of devices 4.
Running on 4 devices.
Traceback (most recent call last):
  File "/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jasmine_jobs_2/jasmine/train_dynamics.py", line 790, in <module>
    main(args)
  File "/hkfs/home/project/hk-project-p0023960/tum_cte0515/Projects/jasmine_jobs_2/jasmine/train_dynamics.py", line 386, in main
    raise ValueError(
ValueError: Global batch size 110 must be divisible by number of devices 4.
W0930 11:45:41.948738  640775 pjrt_client.cc:1469] WatchJobStateAsync failed for task goo.gle/debugproto  job_name: "jax_worker": UNAVAILABLE: failed to connect to all addresses; last error: UNKNOWN: ipv4:10.0.1.170:63143: Failed to connect to remote host: Connection refused
Additional GRPC error information from remote target coordination_service while calling /tensorflow.CoordinationService/WatchJobState:
:UNKNOWN:Error received from peer  {grpc_status:14, grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:10.0.1.170:63143: Failed to connect to remote host: Connection refused"}
W0930 11:45:41.948687  640777 pjrt_client.cc:1469] WatchJobStateAsync failed for task goo.gle/debugproto   job_name: "jax_worker" task_id: 1: CANCELLED: CANCELLED
Additional GRPC error information from remote target coordination_service while calling /tensorflow.CoordinationService/WatchJobState:
:UNKNOWN:Error received from peer  {grpc_message:"CANCELLED", grpc_status:1} [type.googleapis.com/tensorflow.DerivedStatus='']
W0930 11:45:41.948734  640778 pjrt_client.cc:1469] WatchJobStateAsync failed for task goo.gle/debugstr   job_name: "jax_worker" task_id: 2: UNAVAILABLE: failed to connect to all addresses; last error: UNKNOWN: ipv4:10.0.1.170:63143: Failed to connect to remote host: Connection refused
Additional GRPC error information from remote target coordination_service while calling /tensorflow.CoordinationService/WatchJobState:
:UNKNOWN:Error received from peer  {grpc_status:14, grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:10.0.1.170:63143: Failed to connect to remote host: Connection refused"}
W0930 11:45:41.948996  640776 pjrt_client.cc:1469] WatchJobStateAsync failed for task goo.gle/debugonly    job_name: "jax_worker" task_id: 3: UNAVAILABLE: failed to connect to all addresses; last error: UNKNOWN: ipv4:10.0.1.170:63143: Failed to connect to remote host: Connection refused
Additional GRPC error information from remote target coordination_service while calling /tensorflow.CoordinationService/WatchJobState:
:UNKNOWN:Error received from peer  {grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:10.0.1.170:63143: Failed to connect to remote host: Connection refused", grpc_status:14}
srun: error: hkn0730: tasks 1-2: Exited with exit code 1
srun: error: hkn0730: task 3: Exited with exit code 1
srun: error: hkn0730: task 0: Exited with exit code 1

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

Job ID: 3532455
Cluster: hk
User/Group: tum_cte0515/hk-project-p0023960
Account: hk-project-p0023960
State: FAILED (exit code 1)
Partition: accelerated
Nodes: 1
Cores per node: 24
Nodelist: hkn0730
CPU Utilized: 00:00:19
CPU Efficiency: 1.41% of 00:22:24 core-walltime
Job Wall-clock time: 00:00:56
Starttime: Tue Sep 30 11:44:47 2025
Endtime: Tue Sep 30 11:45:43 2025
Memory Utilized: 1.24 GB
Memory Efficiency: 0.26% of 485.84 GB (485.84 GB/node)
The task which had the largest memory consumption differs by 103.88% from the average task max memory consumption
Energy Consumed: 89458 Joule / 24.8494444444444 Watthours
Average node power draw: 1597.46428571429 Watt