p-doom/crowd-code-dataset-0.2 huggingface dataset:
[tab] scripts_horeka/modelsize_scaling/tokenizer/tester.sh (shellscript)

# 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=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data/open_ai_minecraft_tfrecord
ws_dir='/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/'

job_name="debug"
slurm_job_id="debug-mihir"

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

env | grep SLURM

srun python train_tokenizer.py \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=96 \
    --min_lr=1e-4 \
    --max_lr=1e-4 \
    --log_image_interval=500 \
    --log_checkpoint_interval=5 \
    --log \
    --name=tokenizer-model-size-scaling-38M-$slurm_job_id \
    --tags tokenizer model-size-scaling 38M \
    --entity instant-uv \
    --project jafar \
    --data_dir $tf_records_dir
[tab] scripts_horeka/modelsize_scaling/lam/tester.sh (shellscript)

# 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=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data/open_ai_minecraft_tfrecord
ws_dir='/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/'

job_name="debug"
slurm_job_id="debug-mihir"

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

env | grep SLURM

srun python train_tokenizer.py \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=96 \
    --min_lr=1e-4 \
    --max_lr=1e-4 \
    --log_image_interval=500 \
    --log_checkpoint_interval=5 \
    --log \
    --name=tokenizer-model-size-scaling-38M-$slurm_job_id \
    --tags tokenizer model-size-scaling 38M \
    --entity instant-uv \
    --project jafar \
    --data_dir $tf_records_dir
[tab] scripts_horeka/modelsize_scaling/lam/tester.sh (shellscript)

# 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=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data/open_ai_minecraft_tfrecord
ws_dir='/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/'

job_name="debug"
slurm_job_id="debug-mihir"

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

env | grep SLURM

XLA_FLAGS=--xla_gpu_autotune_level=0 srun python train_lam.py \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=96 \
    --min_lr=1e-4 \
    --max_lr=1e-4 \
    --log_image_interval=500 \
    --log_checkpoint_interval=5 \
    --log \
    --name=lam-model-size-scaling-39M-$slurm_job_id \
    --tags lam model-size-scaling 39M \
    --entity instant-uv \
    --project jafar \
    --data_dir $tf_records_dir
[content] scripts_horeka/modelsize_scaling/lam/train_lam_38M.sbatch (plaintext)
#!/usr/bin/env bash

#SBATCH --nodes=2
#SBATCH --ntasks-per-node=4
#SBATCH --time=15: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/%x_%j.log
#SBATCH --error=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/logs/logs_mihir/%x_%j.log
#SBATCH --job-name=train_tokenizer_model_size_scaling_37M

# 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=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data/open_ai_minecraft_tfrecord
ws_dir='/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/'

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

CHECKPOINT_DIR=/home/hk-project-p0023960/tum_cte0515/Projects/checkpoints/$job_name/$slurm_job_id
mkdir -p $CHECKPOINT_DIR

env | grep SLURM

srun python train_tokenizer.py \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=96 \
    --min_lr=1e-4 \
    --max_lr=1e-4 \
    --log_image_interval=500 \
    --log_checkpoint_interval=500 \
    --log \
    --name=tokenizer-model-size-scaling-38M-$slurm_job_id \
    --tags tokenizer model-size-scaling 38M \
    --entity instant-uv \
    --project jafar \
    --data_dir $tf_records_dir
[tab] scripts_horeka/modelsize_scaling/tokenizer/train_tokenizer_80M.sbatch (shellscript)
#!/usr/bin/env bash

#SBATCH --nodes=4
#SBATCH --ntasks-per-node=4
#SBATCH --time=15: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/%x_%j.log
#SBATCH --error=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/logs/logs_mihir/%x_%j.log
#SBATCH --job-name=train_tokenizer_model_size_scaling_80M

# 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=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data/open_ai_minecraft_tfrecord
ws_dir='/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/'

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

CHECKPOINT_DIR=/home/hk-project-p0023960/tum_cte0515/Projects/checkpoints/$job_name/$slurm_job_id
mkdir -p $CHECKPOINT_DIR

env | grep SLURM

srun python train_tokenizer.py \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=96 \
    --min_lr=1e-4 \
    --max_lr=1e-4 \
    --log_image_interval=500 \
    --log_checkpoint_interval=500 \
    --log \
    --name=tokenizer-modelsize-80M-$slurm_job_id \
    --tags tokenizer model-size-scaling L1 80M \
    --entity instant-uv \
    --project jafar \
    --data_dir $tf_records_dir \
    --model_dim=768 \
    --num_blocks=12 \
    --num_heads=12 \
    --latent_dim=64 \
    --num_latents=2048
[content] scripts_horeka/modelsize_scaling/tokenizer/tester.sh (shellscript)
srun python train_tokenizer.py \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=96 \
    --min_lr=7e-5 \
    --max_lr=7e-5 \
    --log_image_interval=500 \
    --log_checkpoint_interval=500 \
    --log \
    --name=tokenizer-modelsize-80M-$slurm_job_id \
    --tags tokenizer model-size-scaling L1 80M \
    --entity instant-uv \
    --project jafar \
    --data_dir $tf_records_dir \
    --model_dim=768 \
    --num_blocks=12 \
    --num_heads=12 \
    --latent_dim=64 \
    --num_latents=2048
[tab] scripts_horeka/modelsize_scaling/tokenizer/train_tokenizer_127M.sbatch (shellscript)
#!/usr/bin/env bash

#SBATCH --nodes=4
#SBATCH --ntasks-per-node=4
#SBATCH --time=15: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/%x_%j.log
#SBATCH --error=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/logs/logs_mihir/%x_%j.log
#SBATCH --job-name=train_tokenizer_model_size_scaling_80M

# 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=/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data/open_ai_minecraft_tfrecord
ws_dir='/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/'

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

CHECKPOINT_DIR=/home/hk-project-p0023960/tum_cte0515/Projects/checkpoints/$job_name/$slurm_job_id
mkdir -p $CHECKPOINT_DIR

env | grep SLURM

srun python train_tokenizer.py \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=96 \
    --min_lr=7e-5 \
    --max_lr=7e-5 \
    --log_image_interval=500 \
    --log_checkpoint_interval=500 \
    --log \
    --name=tokenizer-modelsize-80M-$slurm_job_id \
    --tags tokenizer model-size-scaling L1 80M \
    --entity instant-uv \
    --project jafar \
    --data_dir $tf_records_dir \
    --model_dim=768 \
    --num_blocks=12 \
    --num_heads=12 \
    --latent_dim=64 \
    --num_latents=2048
[tab] scripts_horeka/modelsize_scaling/model_sizes.md (markdown)
# Genie 1 - Model Sizes and their configs

## Tokenizer model: sizes

default: 
| Model | model_dim | num_blocks | num_heads | latent_dim | num_latents | Est. Params |
|-------|-----------|------------|-----------|------------|-------------|-------------|
| default | 512 | 8 | 8 | 32 | 1024 | ~38M |

### scaling up 
#### (not tested yet - TODO @mihir)

| Model | model_dim | num_blocks | num_heads | latent_dim | num_latents | Est. Params |
|-------|-----------|------------|-----------|------------|-------------|-------------|
| L1 | 768 | 12 | 12 | 64 | 2048 | ~80M |
| L2 | 1024 | 12 | 16 | 128 | 2048 | ~140M |
| L3 | 1152 | 16 | 16 | 128 | 4096 | ~200M |
| L4 | 896 | 16 | 14 | 96 | 4096 | ~120M |
| L5 | 1536 | 12 | 24 | 256 | 2048 | ~190M |


### tiny models
| Model | model_dim | num_blocks | num_heads | latent_dim | num_latents | Est. Params |
|-------|-----------|------------|-----------|------------|-------------|-------------|
| S1 | 128 | 2 | 2 | 8 | 128 | ~0.6M |
| S2 | 192 | 2 | 3 | 16 | 128 | ~1.3M |
| S3 | 256 | 3 | 4 | 16 | 256 | ~3.6M |
| S4 | 320 | 4 | 5 | 24 | 256 | ~7.4M |
| S5 | 384 | 4 | 6 | 32 | 512 | ~10M |


## Latent Action model: sizes
default: 
| Model | model_dim | num_blocks | num_heads | latent_dim | num_latents | Est. Params |
|-------|-----------|------------|-----------|------------|-------------|-------------|
| default | 512 | 8 | 8 | 32 | 6 | ~39M |

### scaling up 
#### (not tested yet - TODO @mihir)

| Name | model_dim | num_blocks | num_heads | latent_dim | num_latents | Est. Params |
|--------------|-----------|------------|-----------|------------|-------------|-------------|
| XL | 1024 | 12 | 16 | 64 | 12 | ~200M |
| L | 896 | 12 | 14 | 48 | 8 | ~150M |
| M+ | 768 | 10 | 12 | 48 | 8 | ~100M |
| M | 640 | 10 | 10 | 32 | 8 | ~70M |
| Base+ | 512 | 12 | 8 | 32 | 8 | ~55M |


### tiny models
| Name | model_dim | num_blocks | num_heads | latent_dim | num_latents | Est. Params |
|--------------|-----------|------------|-----------|------------|-------------|-------------|
| XS | 128 | 2 | 2 | 8 | 4 | ~0.9M |
| S | 160 | 2 | 2 | 8 | 4 | ~1.3M |
| S+ | 192 | 3 | 3 | 8 | 4 | ~2.4M |
| M- | 256 | 4 | 4 | 16 | 6 | ~5.4M |
| M | 320 | 6 | 4 | 16 | 6 | ~12M |


## Dynamics model: sizes 

| Config | dyna_dim | dyna_num_blocks | dyna_num_heads | Approx. Params |
|--------|----------|-----------------|---------------|----------------|
| 1 | 512 | 12 | 8   | ~36M  |
| 2 | 768 | 16 | 12  | ~110M |
| 3 | 1024 | 16 | 16 | ~180M |
| 4 | 1024 | 24 | 16 | ~270M |
| 5 | 1536 | 24 | 24 | ~500M |


### tiny models
| Config | dyna_dim | dyna_num_blocks | dyna_num_heads | Approx. Params |
|--------|----------|-----------------|---------------|----------------|
| A | 128 | 2 | 4 | ~1.5M |
| B | 256 | 2 | 4 | ~3.5M |
| C | 256 | 4 | 4 | ~6M   |
| D | 384 | 4 | 6 | ~12M  |
| E | 512 | 4 | 8 | ~18M  |
[tab] scripts_horeka/batchsize_scaling/adjusted_lr/run_sbatch.sh (shellscript)
sbatch /home/hk-project-p0023960/tum_cte0515/Projects/jafar/scripts_horeka/batchsize_scaling/adjusted_lr/train_tokenizer_1_nodes.sbatch
sbatch /home/hk-project-p0023960/tum_cte0515/Projects/jafar/scripts_horeka/batchsize_scaling/adjusted_lr/train_tokenizer_2_nodes.sbatch
sbatch /home/hk-project-p0023960/tum_cte0515/Projects/jafar/scripts_horeka/batchsize_scaling/adjusted_lr/train_tokenizer_4_nodes.sbatch