#!/bin/bash #SBATCH --job-name=dppo_robomimic_full #SBATCH --account=hk-project-p0022232 #SBATCH --partition=accelerated #SBATCH --gres=gpu:1 #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=40 #SBATCH --time=08:00:00 #SBATCH --mem=32G #SBATCH --output=logs/dppo_robomimic_full_%j.out #SBATCH --error=logs/dppo_robomimic_full_%j.err module load devel/cuda/12.4 # MuJoCo environment for robomimic export MUJOCO_PY_MUJOCO_PATH=$HOME/.mujoco/mujoco210 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.mujoco/mujoco210/bin:/usr/lib/nvidia export MUJOCO_GL=egl # Environment variables export WANDB_MODE=online export DPPO_WANDB_ENTITY=${DPPO_WANDB_ENTITY:-"dominik_roth"} export DPPO_DATA_DIR=${DPPO_DATA_DIR:-$SLURM_SUBMIT_DIR/data} export DPPO_LOG_DIR=${DPPO_LOG_DIR:-$SLURM_SUBMIT_DIR/log} # Parse command line arguments TASK=${1:-lift} # lift, can, square, transport MODE=${2:-finetune} # pretrain or finetune cd $SLURM_SUBMIT_DIR source .venv/bin/activate # Apply HoReKa MuJoCo compilation fix echo "Applying HoReKa MuJoCo compilation fix..." python -c "exec(open('fix_mujoco_compilation.py').read()); apply_mujoco_fix(); import mujoco_py; print('MuJoCo ready!')" echo "Starting Robomimic $TASK $MODE experiment..." echo "Job ID: $SLURM_JOB_ID" # Select config based on mode if [ "$MODE" = "pretrain" ]; then CONFIG_DIR="cfg/robomimic/pretrain/${TASK}" CONFIG_NAME="pre_diffusion_mlp" elif [ "$MODE" = "finetune" ]; then CONFIG_DIR="cfg/robomimic/finetune/${TASK}" CONFIG_NAME="ft_ppo_diffusion_mlp" else echo "Invalid mode: $MODE" exit 1 fi # Run experiment python script/run.py \ --config-name=$CONFIG_NAME \ --config-dir=$CONFIG_DIR \ wandb=${WANDB_MODE:-null} echo "Experiment completed!"