p-doom/crowd-code-dataset-0.2 huggingface dataset:
[tab] scripts_horeka/train_dynamics.sh (shellscript)
#!/usr/bin/env bash

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


tf_records_dir=$ws_dir/knoms_tfrecords_500_shards
ws_dir='/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/'

job_name="debug"
slurm_job_id="0000"

CHECKPOINT_DIR=$ws_dir/checkpoints/$job_name/$slurm_job_id
mkdir -p $CHECKPOINT_DIR

env | grep SLURM

# Use checkpoints from tokenizer/lam overfit sample runs
tokenizer_ckpt_dir=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/checkpoints/3299272/tokenizer_1751037678_153500/
# lam_ckpt_dir=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/checkpoints/3299259/lam_1751036759_200000/
lam_ckpt_dir=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/checkpoints/lam-1-action/lam_1751297992_5/

python train_dynamics.py \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=1 \
    --min_lr=3e-4 \
    --max_lr=3e-4 \
    --log_image_interval=500 \
    --log \
    --log_checkpoint_interval=500 \
    --name=dynamics-tiny-overfit-big-lr-$slurm_job_id \
    --tags dynamics overfit tiny \
    --entity instant-uv \
    --project jafar \
    --tokenizer_checkpoint=$tokenizer_ckpt_dir \
    --lam_checkpoint=$lam_ckpt_dir \
    --data_dir $tf_records_dir \
    --tokenizer_dim=384 \
    --latent_patch_dim=32 \
    --num_patch_latents=1024 \
    --patch_size=4 \
    --tokenizer_num_blocks=8 \
    --tokenizer_num_heads=8 \
    --lam_dim=384 \
    --latent_action_dim=32 \
    --lam_patch_size=16 \
    --lam_num_blocks=8 \
    --lam_num_heads=8 \
    --dyna_dim=128 \
    --dyna_num_blocks=2 \
    --dyna_num_heads=4 \
    --num_latent_actions=1 \
    --mask_limit=1.0
[tab] scripts_horeka/overfit_sample_tiny/sample.sh (shellscript)
#!/usr/bin/env bash

# Unload modules that may interfere
module unload mpi/openmpi/5.0
module unload devel/cuda/12.4

# Activate virtual environment
source .venv/bin/activate

# Set workspace and checkpoint directory (update slurm_job_id as needed)
ws_dir='/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared'
# Replace the following with the actual job id/checkpoint you want to sample from
slurm_job_id=3301029

# job_name=train_dynamics_minecraft_overfit_sample_tiny
CHECKPOINT_DIR=$ws_dir/checkpoints/${slurm_job_id}

# Example: If you want to use a specific checkpoint, set it here
# CHECKPOINT_PATH=$ws_dir/checkpoints/3299272/dynamics-tiny-overfit-big-lr-3299272_50000/
# Or use the latest in the directory
# CHECKPOINT_PATH=$(ls -d $CHECKPOINT_DIR/*/ | sort | tail -n 1)
CHECKPOINT_PATH=$CHECKPOINT_DIR/genie_1751067601_200000/
CHECKPOINT_PATH=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/checkpoints/0000/genie_1751301068_2000/
echo "Sampling from checkpoint: $CHECKPOINT_PATH"

python sample.py \
    --checkpoint "$CHECKPOINT_PATH" \
    --tokenizer_dim=384 \
    --latent_patch_dim=32 \
    --num_patch_latents=1024 \
    --patch_size=4 \
    --tokenizer_num_blocks=8 \
    --tokenizer_num_heads=8 \
    --lam_dim=384 \
    --latent_action_dim=32 \
    --lam_patch_size=16 \
    --lam_num_blocks=8 \
    --lam_num_heads=8 \
    --dyna_dim=128 \
    --dyna_num_blocks=2 \
    --dyna_num_heads=4 \
    --maskgit_steps=1 \
    --num_latent_actions=1 \
    --seq_len=5 \
    --start_frame=0
[content] Untitled-1 (plaintext)
Array([ 0.05725611,  0.09551146, -0.00489834,  0.01260828,  0.05435381,
       -0.07198133, -0.07775287,  0.05409481,  0.02997333,  0.04513329,
        0.02724726,  0.07016625,  0.0266482 ,  0.00043704,  0.05048018,
        0.23477305, -0.21280609,  0.09817033,  0.07657167, -0.10951705,
       -0.04667508, -0.08143116,  0.24134587,  0.14582449,  0.02667357,
        0.02862681, -0.07047819, -0.02924404, -0.0280011 , -0.04653165,
        0.04913179,  0.11870538,  0.02786516, -0.02981153,  0.01190054,
        0.11647964,  0.04842164,  0.20591389, -0.16787218,  0.00283359,
        0.00505792, -0.09712408, -0.0347484 ,  0.03225971, -0.09866993,
        0.11096629, -0.09046505, -0.0140517 ,  0.03503699,  0.11512648,
       -0.02379899, -0.04026883,  0.03255694, -0.09811404,  0.00511647,
       -0.01332523, -0.04000858,  0.02270413,  0.07081898,  0.05539022,
       -0.0611615 , -0.08200137,  0.15767165,  0.0129967 ,  0.07423519,
       -0.01111614, -0.06456082,  0.04739142, -0.04031334,  0.01418943,
        0.01895791,  0.08658207,  0.11832447, -0.03598715,  0.2079043 ,
        0.07268324, -0.03344419, -0.0061969 ,  0.00807034,  0.15595683,
       -0.0384468 ,  0.03934486, -0.00418254, -0.12929118,  0.07121508,
       -0.05045069, -0.05637243,  0.06838017, -0.0856661 , -0.22436744,
       -0.03157925, -0.11812835,  0.13658975,  0.15003507,  0.07303645,
       -0.19493134, -0.07597115, -0.10575026,  0.04326085, -0.05067817,
        0.10927688, -0.0358252 , -0.16355576,  0.01243466, -0.01344708,
        0.04452743,  0.02736073, -0.06833841, -0.11444332,  0.09598876,
       -0.1212263 , -0.06760522,  0.00453666,  0.01041534, -0.15467572,
       -0.02522295, -0.04485739, -0.03417278, -0.05451573, -0.12252605,
       -0.1292875 ,  0.04643333,  0.01454904, -0.05047289,  0.00826681,
       -0.09083664, -0.0697903 , -0.00391799], dtype=float32)
[tab] scripts_horeka/overfit_sample_tiny/train_dynamics_overfit_sample_big_lr-2.sbatch (shellscript)
#!/usr/bin/env bash

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --time=05:00:00
#SBATCH --partition=accelerated
#SBATCH --cpus-per-task=5
#SBATCH --gres=gpu:1
#SBATCH --output=logs/logs_training/%x_%j.log
#SBATCH --error=logs/logs_training/%x_%j.log
#SBATCH --mail-user=mihir.mahajan2002@gmail.com
#SBATCH --job-name=train_dynamics_minecraft_overfit_sample_tiny
#SBATCH --mem=50G
#SBATCH --mail-type=ALL

# Log the sbatch script
cat $0

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

tf_records_dir=$ws_dir/knoms_tfrecords_500_shards
ws_dir='/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/'

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

CHECKPOINT_DIR=$ws_dir/checkpoints/$job_name_$slurm_job_id
mkdir -p $CHECKPOINT_DIR

env | grep SLURM

echo Running dynamics model overfit run. Slurm id: $slurm_job_id

# Use checkpoints from tokenizer/lam overfit sample runs
tokenizer_ckpt_dir=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/checkpoints/3299272/tokenizer_1751037678_153500/
lam_ckpt_dir=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/checkpoints/3299259/lam_1751036759_200000/

srun python train_dynamics.py \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=1 \
    --min_lr=1e-4 \
    --max_lr=1e-4 \
    --log_image_interval=500 \
    --log \
    --log_checkpoint_interval=500 \
    --name=masklim-0-dynamics-tiny-overfit-big-lr-$slurm_job_id \
    --tags dynamics overfit tiny masklimit-0 \
    --entity instant-uv \
    --project jafar \
    --tokenizer_checkpoint=$tokenizer_ckpt_dir \
    --lam_checkpoint=$lam_ckpt_dir \
    --data_dir $tf_records_dir \
    --tokenizer_dim=384 \
    --latent_patch_dim=32 \
    --num_patch_latents=1024 \
    --patch_size=4 \
    --tokenizer_num_blocks=8 \
    --tokenizer_num_heads=8 \
    --lam_dim=384 \
    --latent_action_dim=32 \
    --num_latent_actions=6 \
    --lam_patch_size=16 \
    --lam_num_blocks=8 \
    --lam_num_heads=8 \
    --dyna_dim=128 \
    --dyna_num_blocks=2 \
    --dyna_num_heads=4 \
    --mask_limit=0.0