p-doom/crowd-code-dataset-0.2 huggingface dataset:
[content] slurm/jobs/mihir/berlin/diffusion/breakout/train_tokenizer_mae_dev.sh (shellscript)
g_checkpoint_interval=10 \
    --log_checkpoint_keep_period=10 \
    --log_gradients=True \
    --log_memory=True \
    --log_memory_interval=10 \
    --log_memory_keep_period=10 \
    --log_memory_interval=10 \
[tab] slurm/jobs/mihir/berlin/diffusion/coinrun/dyn_dit_coinrun_lr_gt_actions.sh (shellscript)
#!/usr/bin/env bash

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --time=24:00:00
#SBATCH --cpus-per-task=5
#SBATCH --gres=gpu:1
#SBATCH --mem=100GB
#SBATCH --output=/fast/project/HFMI_ProFOUND/mihir/logs/train/dyn/diffusion/%x_%j.log
#SBATCH --error=/fast/project/HFMI_ProFOUND/mihir/logs/train/dyn/diffusion/%x_%j.log
#SBATCH --job-name=train_dyn_dit

cat $0

source .venv/bin/activate

array_records_dir_train=/fast/project/HFMI_ProFOUND/mihir/data/data_coinrun/coinrun_episodes_50m/train
array_records_dir_val=/fast/project/HFMI_ProFOUND/mihir/data/data_coinrun/coinrun_episodes_50m/val

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

CHECKPOINT_DIR=/fast/project/HFMI_ProFOUND/mihir/checkpoints/dyn/$job_name/$slurm_job_id
mkdir -p $CHECKPOINT_DIR

srun python jasmine/train_dynamics.py \
    --save_ckpt \
    --image_height=64 \
    --image_width=64 \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=36 \
    --max_lr=3e-5 \
    --val_interval 1000 \
    --dyna_type=diffusion \
    --use_gt_actions \
    --diffusion_denoise_steps=128 \
    --name=train_dyn_dit_coinrun_lr_3e-5_gt_actions_$slurm_job_id \
    --tags dyn diffusion coinrun lr_3e-5 gt_actions \
    --entity instant-uv \
    --project jafar \
    --data_dir $array_records_dir_train \
    --val_data_dir $array_records_dir_val \
[tab] slurm/jobs/mihir/berlin/diffusion/coinrun/dyn_dit_coinrun_lr_gt_actions.sh (shellscript)
#!/usr/bin/env bash

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --time=24:00:00
#SBATCH --cpus-per-task=5
#SBATCH --gres=gpu:1
#SBATCH --mem=100GB
#SBATCH --output=/fast/project/HFMI_ProFOUND/mihir/logs/train/dyn/diffusion/%x_%j.log
#SBATCH --error=/fast/project/HFMI_ProFOUND/mihir/logs/train/dyn/diffusion/%x_%j.log
#SBATCH --job-name=train_dyn_dit

cat $0

source .venv/bin/activate

array_records_dir_train=/fast/project/HFMI_ProFOUND/mihir/data/data_coinrun/coinrun_episodes_50m/train
array_records_dir_val=/fast/project/HFMI_ProFOUND/mihir/data/data_coinrun/coinrun_episodes_50m/val

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

CHECKPOINT_DIR=/fast/project/HFMI_ProFOUND/mihir/checkpoints/dyn/$job_name/$slurm_job_id
mkdir -p $CHECKPOINT_DIR

srun python jasmine/train_dynamics.py \
    --save_ckpt \
    --image_height=64 \
    --image_width=64 \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=36 \
    --max_lr=1e-4 \
    --val_interval 1000 \
    --dyna_type=diffusion \
    --use_gt_actions \
    --num_actions=15 \
    --diffusion_denoise_steps=128 \
    --name=train_dyn_dit_coinrun_lr_1e-4_gt_actions_$slurm_job_id \
    --tags dyn diffusion coinrun lr_1e-4 gt_actions \
    --entity instant-uv \
    --project jafar \
    --data_dir $array_records_dir_train \
    --val_data_dir $array_records_dir_val \
[tab] slurm/jobs/mihir/berlin/diffusion/coinrun/dyn_dit_coinrun_lr_gt_actions.sh (shellscript)
#!/usr/bin/env bash

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --time=24:00:00
#SBATCH --cpus-per-task=5
#SBATCH --gres=gpu:1
#SBATCH --mem=100GB
#SBATCH --output=/fast/project/HFMI_ProFOUND/mihir/logs/train/dyn/diffusion/%x_%j.log
#SBATCH --error=/fast/project/HFMI_ProFOUND/mihir/logs/train/dyn/diffusion/%x_%j.log
#SBATCH --job-name=train_dyn_dit

cat $0

source .venv/bin/activate

array_records_dir_train=/fast/project/HFMI_ProFOUND/mihir/data/data_coinrun/coinrun_episodes_50m/train
array_records_dir_val=/fast/project/HFMI_ProFOUND/mihir/data/data_coinrun/coinrun_episodes_50m/val

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

CHECKPOINT_DIR=/fast/project/HFMI_ProFOUND/mihir/checkpoints/dyn/$job_name/$slurm_job_id
mkdir -p $CHECKPOINT_DIR

srun python jasmine/train_dynamics.py \
    --save_ckpt \
    --image_height=64 \
    --image_width=64 \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=36 \
    --max_lr=1e-4 \
    --dyna_type=diffusion \
    --use_gt_actions \
    --num_actions=15 \
    --diffusion_denoise_steps=128 \
    --name=train_dyn_dit_coinrun_lr_1e-4_gt_actions_$slurm_job_id \
    --tags dyn diffusion coinrun lr_1e-4 gt_actions \
    --entity instant-uv \
    --project jafar \
    --data_dir $array_records_dir_train \
    --val_data_dir $array_records_dir_val \
[tab] slurm/jobs/mihir/berlin/diffusion/coinrun/dyn_dit_coinrun_lr_1e-4.sh (shellscript)
#!/usr/bin/env bash

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --time=24:00:00
#SBATCH --cpus-per-task=5
#SBATCH --gres=gpu:1
#SBATCH --mem=100GB
#SBATCH --output=/fast/project/HFMI_ProFOUND/mihir/logs/train/dyn/diffusion/%x_%j.log
#SBATCH --error=/fast/project/HFMI_ProFOUND/mihir/logs/train/dyn/diffusion/%x_%j.log
#SBATCH --job-name=train_dyn_dit

cat $0

source .venv/bin/activate

array_records_dir_train=/fast/project/HFMI_ProFOUND/mihir/data/data_coinrun/coinrun_episodes_50m/train
array_records_dir_val=/fast/project/HFMI_ProFOUND/mihir/data/data_coinrun/coinrun_episodes_50m/val

job_name=$SLURM_JOB_NAME
slurm_job_id=$SLURM_JOB_ID

CHECKPOINT_DIR=/fast/project/HFMI_ProFOUND/mihir/checkpoints/dyn/$job_name/$slurm_job_id
mkdir -p $CHECKPOINT_DIR

srun python jasmine/train_dynamics.py \
    --save_ckpt \
    --image_height=64 \
    --image_width=64 \
    --ckpt_dir $CHECKPOINT_DIR \
    --batch_size=36 \
    --max_lr=1e-4 \
    --dyna_type=diffusion \
    --diffusion_denoise_steps=128 \
    --name=train_dyn_dit_coinrun_lr_1e-4_$slurm_job_id \
    --tags dyn diffusion coinrun lr_1e-4 \
    --entity instant-uv \
    --project jafar \
    --data_dir $array_records_dir_train \
    --val_data_dir $array_records_dir_val \
[content] jasmine/models/dynamics.py (python)

    def __call__(
        self,
        batch: Dict[str, jax.Array],
    ) -> tuple[jax.Array, jax.Array]:
        # For now we only denoise the last frame
        rng, time_rng, noise_rng = jax.random.split(batch["rng"], 3)
        videos = batch["videos"]
        latent_actions_BTm11L = batch["latent_actions"]
        B, T, H, W, C = videos.shape
        # Sample t.
        t = jax.random.randint(time_rng, (B, T), minval=0, maxval=self.denoise_steps)
        t /= self.denoise_steps
        t_full = t[:, :, None, None, None]  # [B, T, 1, 1, 1]
        x_1 = videos
        x_0 = jax.random.normal(noise_rng, (B, T, H, W, C))
        x_t = (1 - (1 - 1e-5) * t_full) * x_0 + t_full * x_1
        dt_flow = jnp.log2(self.denoise_steps).astype(jnp.int32)
        dt_base = jnp.ones((B, T), dtype=jnp.int32) * dt_flow  # [B, T]
        videos = x_t

        act_embed_BTm11M = self.action_up(latent_actions_BTm11L)
        padded_act_embed_BTM = jnp.pad(
            act_embed_BTm11M, ((0, 0), (1, 0), (0, 0), (0, 0))
        ).reshape(B, T, self.model_dim)

        # call the diffusion transformer
        # TODO add action conditioning
        x_pred = self.diffusion_transformer(videos, t, dt_base, padded_act_embed_BTM)
        return x_pred, t