kdwon commited on
Commit
176ca66
·
verified ·
1 Parent(s): b78ba92

Add files using upload-large-folder tool

Browse files
README.md ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - compact
6
+ - image-tokenization
7
+ - world-model
8
+ - robotics
9
+ - pytorch
10
+ - image-to-image
11
+ ---
12
+
13
+ # CompACT — 16-token checkpoints
14
+
15
+ Final 16-token checkpoints for **Planning in 8 Tokens: A Compact Discrete Tokenizer for Latent World Model** (CVPR 2026).
16
+
17
+ [Code and setup instructions](https://github.com/kdwonn/CompACT) · [Paper](https://arxiv.org/abs/2603.05438) · [Project](https://kdwonn.github.io/CompACT)
18
+
19
+ ## Included models
20
+
21
+ | Directory | Model | Resolution | Checkpoint |
22
+ |---|---|---|---|
23
+ | `tokenizer-16-224` | CompACT, 16 tokens | 224 × 224 | `checkpoints/epoch=24-step=500000.ckpt` |
24
+ | `tokenizer-16-256` | CompACT, 16 tokens | 256 × 256 | `checkpoints/epoch=24-step=500000.ckpt` |
25
+ | `cdit-b-16` | CDiT-B world model | 224 × 224 | `checkpoints/latest.pth.tar` |
26
+ | `cdit-l-16` | CDiT-L world model | 224 × 224 | `checkpoints/latest.pth.tar` |
27
+
28
+ Both world models use **`tokenizer-16-224`**. The 256-resolution tokenizer is provided separately. These are the original full training checkpoint files, including training state; world-model inference uses the `ema` weights. Only the final checkpoint for each variant is included. Exact training steps, original experiment names, file sizes, and SHA-256 checksums are in [manifest.json](manifest.json).
29
+
30
+ ## Download
31
+
32
+ Install the environment following the [code repository](https://github.com/kdwonn/CompACT). Run from its root:
33
+
34
+ ```python
35
+ from huggingface_hub import snapshot_download
36
+
37
+ snapshot_download(repo_id="kdwon/CompACT", local_dir="checkpoints/CompACT")
38
+ ```
39
+
40
+ To download just one variant, include its config:
41
+
42
+ ```python
43
+ snapshot_download(
44
+ repo_id="kdwon/CompACT",
45
+ local_dir="checkpoints/CompACT",
46
+ allow_patterns=["tokenizer-16-224/**", "manifest.json", "SHA256SUMS"],
47
+ )
48
+ ```
49
+
50
+ ## Configuration
51
+
52
+ Each variant includes `.hydra/config.yaml`, in the format expected by the code repository. Set these environment variables to your local paths:
53
+
54
+ ```bash
55
+ export COMPACT_CKPT_ROOT="$(pwd)/checkpoints/CompACT"
56
+ export BASE_TOKENIZER_CKPT=/absolute/path/to/base-checkpoints
57
+ export DATASET_PREFIX=/absolute/path/to/datasets
58
+ ```
59
+
60
+ The current constructors also require these initialization files:
61
+
62
+ - `$BASE_TOKENIZER_CKPT/mage_vqgan/vqgan_jax_strongaug.ckpt`
63
+ - `$BASE_TOKENIZER_CKPT/dinov3/dinov3_vitb16_pretrain_lvd1689m-73cec8be.pth`
64
+
65
+ See the code repository for obtaining the MAGE and DINOv3 files. `DATASET_PREFIX` must be defined even for standalone tokenizer loading because the world-model loader resolves the complete saved tokenizer configuration.
66
+
67
+ World-model configs use `${oc.env:COMPACT_CKPT_ROOT}/tokenizer-16-224` and `${oc.env:DATASET_PREFIX}/nwm/{recon,sacson,scand}` instead of the original machine's paths. Adjust dataset overrides to match your local layout.
68
+
69
+ ## Load a tokenizer
70
+
71
+ ```bash
72
+ uv run load_tokenizer_checkpoint.py "$COMPACT_CKPT_ROOT/tokenizer-16-224" --no-test
73
+ ```
74
+
75
+ Use `tokenizer-16-256` for the 256-resolution variant. For image encoding, use the saved DINO normalization (`dinov2_mean` and `dinov2_std`); the tokenizer's output normalization buffers describe decoded images.
76
+
77
+ ## Planning evaluation
78
+
79
+ With the required navigation datasets installed:
80
+
81
+ ```bash
82
+ uv run bash scripts/plan.sh --nproc=1 -- \
83
+ ++exp_dir="$COMPACT_CKPT_ROOT/cdit-b-16" \
84
+ ++tokenizer_path="$COMPACT_CKPT_ROOT/tokenizer-16-224" \
85
+ ++ckp=latest
86
+ ```
87
+
88
+ Replace `cdit-b-16` with `cdit-l-16` to use the larger world model. Dataset setup and evaluation options are documented in the code repository.
89
+
90
+ ## Validation
91
+
92
+ These files passed strict weight-loading checks in the public CompACT codebase. Both tokenizers encoded and reconstructed a real image. Both the regular and EMA weights of the world models passed forward checks, and EMA models completed image-to-predicted-image inference. Validation used PyTorch 2.6.0+cu124 and bfloat16 inference on an RTX 6000 Ada GPU. These smoke checks do not constitute a rerun of the paper's evaluation benchmarks.
93
+
94
+ Verify downloaded checkpoint bytes from the download directory:
95
+
96
+ ```bash
97
+ sha256sum -c SHA256SUMS
98
+ ```
99
+
100
+ ## Citation
101
+
102
+ ```bibtex
103
+ @inproceedings{kim2026planning,
104
+ title={Planning in 8 Tokens: A Compact Discrete Tokenizer for Latent World Model},
105
+ author={Kim, Dongwon and Seo, Gawon and Lee, Jinsung and Cho, Minsu and Kwak, Suha},
106
+ booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
107
+ year={2026}
108
+ }
109
+ ```
SHA256SUMS ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ 946156a657430b3aedfa005e2a83729642c679a48f739667970e9dbedba09354 tokenizer-16-224/checkpoints/epoch=24-step=500000.ckpt
2
+ f73ffacaceed9d8389410d398fe9e458cbb9b55aa744736fc5a468821bb3ddf0 tokenizer-16-256/checkpoints/epoch=24-step=500000.ckpt
3
+ d52268676201c96e6d1586d6a49ad60b5798ea59997301cb2f27afde2aa2212f cdit-b-16/checkpoints/latest.pth.tar
4
+ 168f3d0cd5784464f056288c9757fc12391c98804a34d4956d36b52ce287f501 cdit-l-16/checkpoints/latest.pth.tar
cdit-b-16/.hydra/config.yaml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ seed: 0
2
+ epochs: 100
3
+ log_every: 100
4
+ ckpt_every: 10000
5
+ eval_every: 5000
6
+ bfloat16: 1
7
+ torch_compile: 0
8
+ resume_from_dir: null
9
+ dataset:
10
+ image_size: 224
11
+ context_size: 4
12
+ normalize: true
13
+ distance:
14
+ min_dist_cat: -64
15
+ max_dist_cat: 64
16
+ len_traj_pred: 64
17
+ action_stats:
18
+ min:
19
+ - -2.5
20
+ - -4
21
+ max:
22
+ - 5
23
+ - 4
24
+ datasets:
25
+ recon:
26
+ data_folder: ${oc.env:DATASET_PREFIX}/nwm/recon
27
+ train: data_splits/recon/train/
28
+ test: data_splits/recon/test/
29
+ goals_per_obs: 4
30
+ metric_waypoint_spacing: 0.25
31
+ sacson:
32
+ data_folder: ${oc.env:DATASET_PREFIX}/nwm/sacson
33
+ train: data_splits/sacson/train
34
+ test: data_splits/sacson/test
35
+ goals_per_obs: 4
36
+ metric_waypoint_spacing: 0.255
37
+ scand:
38
+ data_folder: ${oc.env:DATASET_PREFIX}/nwm/scand
39
+ train: data_splits/scand/train
40
+ test: data_splits/scand/test
41
+ goals_per_obs: 4
42
+ metric_waypoint_spacing: 0.38
43
+ model:
44
+ generator:
45
+ _target_: disc_models.DiscreteCDiT
46
+ input_size: ${model.tokenizer.num_tokens}
47
+ codebook_size: ${model.tokenizer.codebook_size}
48
+ context_size: 2
49
+ hidden_size: 768
50
+ depth: 12
51
+ num_heads: 12
52
+ use_action_cfg: ${model.diffusion.cfg_prob}
53
+ diffusion:
54
+ _target_: diffusion.disc_diffusion.DiscreteDiffusionWithHistoryMasking
55
+ mask_token_id: ${model.tokenizer.codebook_size}
56
+ num_timesteps: 8
57
+ schedule_type: linear
58
+ temperature: 1.0
59
+ history_key: x_cond
60
+ history_sample_t: 0.8
61
+ cfg_prob: 0
62
+ cfg_scale: 2.0
63
+ tokenizer_path: ${oc.env:COMPACT_CKPT_ROOT}/tokenizer-16-224
64
+ training:
65
+ notes: newcfg_acfcfg-0_historymasking-linear_qformer-freeze
66
+ run_name: ${now:%Y%m%d_%H%M%S}_${training.notes}
67
+ results_dir: logs/nwm_training
68
+ batch_size: 32
69
+ num_workers: 8
70
+ grad_clip_val: 2.0
71
+ from_checkpoint: null
72
+ optimizer:
73
+ _target_: torch.optim.AdamW
74
+ lr: 0.0001
75
+ weight_decay: 0.01
76
+ wandb_enabled: true
77
+ wandb_project: nwm-training
78
+ wandb_notes: ${training.run_name}
79
+ wandb_tags: []
80
+ scheduler:
81
+ scheduler:
82
+ _target_: null
cdit-b-16/checkpoints/latest.pth.tar ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d52268676201c96e6d1586d6a49ad60b5798ea59997301cb2f27afde2aa2212f
3
+ size 3887081502
cdit-l-16/.hydra/config.yaml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ seed: 0
2
+ epochs: 100
3
+ log_every: 100
4
+ ckpt_every: 10000
5
+ eval_every: 5000
6
+ bfloat16: 1
7
+ torch_compile: 0
8
+ resume_from_dir: null
9
+ dataset:
10
+ image_size: 224
11
+ context_size: 4
12
+ normalize: true
13
+ distance:
14
+ min_dist_cat: -64
15
+ max_dist_cat: 64
16
+ len_traj_pred: 64
17
+ action_stats:
18
+ min:
19
+ - -2.5
20
+ - -4
21
+ max:
22
+ - 5
23
+ - 4
24
+ datasets:
25
+ recon:
26
+ data_folder: ${oc.env:DATASET_PREFIX}/nwm/recon
27
+ train: data_splits/recon/train/
28
+ test: data_splits/recon/test/
29
+ goals_per_obs: 4
30
+ metric_waypoint_spacing: 0.25
31
+ sacson:
32
+ data_folder: ${oc.env:DATASET_PREFIX}/nwm/sacson
33
+ train: data_splits/sacson/train
34
+ test: data_splits/sacson/test
35
+ goals_per_obs: 4
36
+ metric_waypoint_spacing: 0.255
37
+ scand:
38
+ data_folder: ${oc.env:DATASET_PREFIX}/nwm/scand
39
+ train: data_splits/scand/train
40
+ test: data_splits/scand/test
41
+ goals_per_obs: 4
42
+ metric_waypoint_spacing: 0.38
43
+ model:
44
+ generator:
45
+ _target_: disc_models.DiscreteCDiT
46
+ input_size: ${model.tokenizer.num_tokens}
47
+ codebook_size: ${model.tokenizer.codebook_size}
48
+ context_size: 2
49
+ hidden_size: 1024
50
+ depth: 24
51
+ num_heads: 16
52
+ use_action_cfg: ${model.diffusion.cfg_prob}
53
+ diffusion:
54
+ _target_: diffusion.disc_diffusion.DiscreteDiffusionWithHistoryMasking
55
+ mask_token_id: ${model.tokenizer.codebook_size}
56
+ num_timesteps: 8
57
+ schedule_type: linear
58
+ temperature: 1.0
59
+ history_key: x_cond
60
+ history_sample_t: 0.8
61
+ cfg_prob: 0.1
62
+ cfg_scale: 2.0
63
+ without_history_masking: false
64
+ tokenizer_path: ${oc.env:COMPACT_CKPT_ROOT}/tokenizer-16-224
65
+ training:
66
+ notes: cdit-l_newcfg_acfcfg-0_historymasking-linear_qformer-freeze
67
+ run_name: ${now:%Y%m%d_%H%M%S}_${training.notes}
68
+ results_dir: logs/nwm_training
69
+ batch_size: 32
70
+ num_workers: 16
71
+ grad_clip_val: 2.0
72
+ from_checkpoint: null
73
+ optimizer:
74
+ _target_: torch.optim.AdamW
75
+ lr: 0.0001
76
+ weight_decay: 0.01
77
+ wandb_enabled: true
78
+ wandb_project: nwm-training
79
+ wandb_notes: ${training.run_name}
80
+ wandb_tags: []
81
+ scheduler:
82
+ scheduler:
83
+ _target_: null
cdit-l-16/checkpoints/latest.pth.tar ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:168f3d0cd5784464f056288c9757fc12391c98804a34d4956d36b52ce287f501
3
+ size 11996868852
manifest.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "variant": "tokenizer-16-224",
4
+ "checkpoint": "tokenizer-16-224/checkpoints/epoch=24-step=500000.ckpt",
5
+ "bytes": 11572743012,
6
+ "sha256": "946156a657430b3aedfa005e2a83729642c679a48f739667970e9dbedba09354",
7
+ "step": 500000,
8
+ "original_experiment": "20250930_072404_dinov3-b-qformer-freeze_mmdit-l_code2exp16_lr1e-4_repa-dec-8_nomasking"
9
+ },
10
+ {
11
+ "variant": "tokenizer-16-256",
12
+ "checkpoint": "tokenizer-16-256/checkpoints/epoch=24-step=500000.ckpt",
13
+ "bytes": 11573725860,
14
+ "sha256": "f73ffacaceed9d8389410d398fe9e458cbb9b55aa744736fc5a468821bb3ddf0",
15
+ "step": 500000,
16
+ "original_experiment": "20251003_100611_dinov3-b-qformer-freeze_256"
17
+ },
18
+ {
19
+ "variant": "cdit-b-16",
20
+ "checkpoint": "cdit-b-16/checkpoints/latest.pth.tar",
21
+ "bytes": 3887081502,
22
+ "sha256": "d52268676201c96e6d1586d6a49ad60b5798ea59997301cb2f27afde2aa2212f",
23
+ "step": 230000,
24
+ "original_experiment": "20251005_020501_newcfg_acfcfg-0_historymasking-linear_qformer-freeze"
25
+ },
26
+ {
27
+ "variant": "cdit-l-16",
28
+ "checkpoint": "cdit-l-16/checkpoints/latest.pth.tar",
29
+ "bytes": 11996868852,
30
+ "sha256": "168f3d0cd5784464f056288c9757fc12391c98804a34d4956d36b52ce287f501",
31
+ "step": 200000,
32
+ "original_experiment": "20251102_074208_cdit-l_newcfg_acfcfg-0_historymasking-linear_qformer-freeze"
33
+ }
34
+ ]
tokenizer-16-224/.hydra/config.yaml ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ seed: 42
2
+ max_steps: 500000
3
+ log_every: 500
4
+ eval_every: 100000
5
+ bfloat16: true
6
+ devices: auto
7
+ experiment:
8
+ n_compact_tokens: 16
9
+ n_2d_tokens: 196
10
+ compact_tokenizer_dim: 512
11
+ compact_tokenizer_code_dim: 6
12
+ compact_tokenizer_num_blocks: 8
13
+ process_attn_depth: 3
14
+ n_registers: 0
15
+ enable_encoder_masking: false
16
+ cutoff_enable: false
17
+ cutoff_prob: 0.5
18
+ cutoff_downsample_factor: 2
19
+ model:
20
+ tokenizer:
21
+ _target_: token_distill.token_distill_model.TokenDistillModel
22
+ codebook_size: ${model.tokenizer.compact_tokenizer.quantizer.codebook_size}
23
+ num_tokens: ${experiment.n_compact_tokens}
24
+ normalize_mean: ${dataset.mean}
25
+ normalize_std: ${dataset.std}
26
+ base_tokenizer:
27
+ _target_: token_distill.mage_vqgan.vqgan.VQModel
28
+ encoder:
29
+ _target_: token_distill.mage_vqgan.model.Encoder
30
+ ch: 128
31
+ out_ch: 3
32
+ ch_mult:
33
+ - 1
34
+ - 1
35
+ - 2
36
+ - 2
37
+ - 4
38
+ num_res_blocks: 2
39
+ attn_resolutions:
40
+ - 16
41
+ dropout: 0.0
42
+ in_channels: 3
43
+ resolution: 256
44
+ z_channels: 256
45
+ double_z: false
46
+ decoder:
47
+ _target_: token_distill.mage_vqgan.model.Decoder
48
+ ch: 128
49
+ out_ch: 3
50
+ ch_mult:
51
+ - 1
52
+ - 1
53
+ - 2
54
+ - 2
55
+ - 4
56
+ num_res_blocks: 2
57
+ attn_resolutions:
58
+ - 16
59
+ dropout: 0.0
60
+ in_channels: 3
61
+ resolution: 256
62
+ z_channels: 256
63
+ double_z: false
64
+ n_embed: 1024
65
+ embed_dim: 256
66
+ ckpt_path: ${oc.env:BASE_TOKENIZER_CKPT}/mage_vqgan/vqgan_jax_strongaug.ckpt
67
+ compact_tokenizer:
68
+ _target_: token_distill.compact_tokenizer.CompactTokenizer
69
+ encoder:
70
+ _target_: token_distill.vit_components.DINOv3EncoderQFormer
71
+ in_dim: 768
72
+ latent_dim: 768
73
+ num_2d_tokens: ${experiment.n_2d_tokens}
74
+ dinov3_model_name: dinov3_vitb16
75
+ dinov3_weights_path: ${oc.env:BASE_TOKENIZER_CKPT}/dinov3/dinov3_vitb16_pretrain_lvd1689m-73cec8be.pth
76
+ num_1d_tokens: ${experiment.n_compact_tokens}
77
+ num_registers: ${experiment.n_registers}
78
+ final_norm: true
79
+ out_proj_dim: ${experiment.compact_tokenizer_code_dim}
80
+ final_norm_context: ${model.tokenizer.compact_tokenizer.repa_on_enc}
81
+ enable_masking: ${experiment.enable_encoder_masking}
82
+ masking_prob: 0.9
83
+ min_masking_ratio: 0.0
84
+ max_masking_ratio: 0.6
85
+ freeze_dinov3: true
86
+ num_qformer_layers: 5
87
+ num_attention_heads: 8
88
+ decoder:
89
+ _target_: token_distill.vit_components.DiTDecoder
90
+ in_dim: 1024
91
+ latent_dim: 1024
92
+ target_codebook_size: ${model.tokenizer.base_tokenizer.n_embed}
93
+ process_attn_depth: ${experiment.process_attn_depth}
94
+ num_blocks: 16
95
+ num_2d_tokens: ${experiment.n_2d_tokens}
96
+ final_norm: false
97
+ in_proj_dim: ${experiment.compact_tokenizer_code_dim}
98
+ final_norm_context: true
99
+ repa_target_block_num: 8
100
+ num_1d_tokens: ${experiment.n_compact_tokens}
101
+ quantizer:
102
+ _target_: token_distill.fsq.FSQWrapper
103
+ levels:
104
+ - 8
105
+ - 8
106
+ - 8
107
+ - 5
108
+ - 5
109
+ - 5
110
+ codebook_size: 64000
111
+ diffusion:
112
+ _target_: diffusion.disc_diffusion.DiscreteDiffusionWithCFG
113
+ mask_token_id: ${model.tokenizer.base_tokenizer.n_embed}
114
+ num_timesteps: 16
115
+ schedule_type: cosine
116
+ temperature: 1.0
117
+ output_key: decoder_2d_logits
118
+ cfg_prob: 0.1
119
+ num_1d_tokens: ${experiment.n_compact_tokens}
120
+ num_2d_tokens: ${experiment.n_2d_tokens}
121
+ masking_type: cosine
122
+ target_codebook_size: ${model.tokenizer.base_tokenizer.n_embed}
123
+ repa_on_enc: false
124
+ rep_guidance:
125
+ _target_: token_distill.rep_guidance.RepGuidanceLoss
126
+ in_dim: ${model.tokenizer.compact_tokenizer.decoder.latent_dim}
127
+ repa_target_enc: dinov3_vitb16
128
+ dinov3_weights_path: ${oc.env:BASE_TOKENIZER_CKPT}/dinov3/dinov3_vitb16_pretrain_lvd1689m-73cec8be.pth
129
+ use_mask: false
130
+ dataset:
131
+ context_size: 1
132
+ batch_size: 64
133
+ image_size: 224
134
+ dinov2_image_size: 224
135
+ num_workers: 8
136
+ data_root: ${oc.env:DATASET_PREFIX}/imagenet_wds
137
+ train_shards: ${dataset.data_root}/train/imagenet-train-{000000..001281}.tar
138
+ val_shards: ${dataset.data_root}/val/imagenet-val-{000000..000049}.tar
139
+ test_shards: ${dataset.data_root}/val/imagenet-val-{000000..000049}.tar
140
+ shuffle_buffer_size: 5000
141
+ shard_shuffle_initial: 1000
142
+ estimated_train_size: 1281167
143
+ estimated_val_size: 50000
144
+ estimated_test_size: 50000
145
+ use_augmentation: true
146
+ mean:
147
+ - 0
148
+ - 0
149
+ - 0
150
+ std:
151
+ - 1
152
+ - 1
153
+ - 1
154
+ dinov2_mean:
155
+ - 0.485
156
+ - 0.456
157
+ - 0.406
158
+ dinov2_std:
159
+ - 0.229
160
+ - 0.224
161
+ - 0.225
162
+ use_dual_normalization: true
163
+ use_dino_image_for_compact: true
164
+ base_tokenizer_name: mage
165
+ training:
166
+ notes: dinov3-b-qformer-freeze_mmdit-l_code2exp16_lr1e-4_repa-dec-8_nomasking
167
+ run_name: ${now:%Y%m%d_%H%M%S}_${training.notes}
168
+ results_dir: logs/tokenizer_training
169
+ grad_clip_val: 1.0
170
+ accumulate_grad_batches: 1
171
+ from_checkpoint: null
172
+ recon_loss_weight: 1.0
173
+ commit_loss_weight: 0.25
174
+ rep_guidance_loss_weight: 1.0
175
+ wandb_project: token-distill
176
+ log_images_locally: true
177
+ local_image_log_dir: null
178
+ model_summary_depth: 3
179
+ log_metrics_every_n_steps: 50
180
+ profiler:
181
+ enabled: false
182
+ type: pytorch
183
+ record_module_names: true
184
+ file_name: debug
185
+ export_to_chrome: true
186
+ sort_by_key: cpu_time
187
+ row_limit: 100
188
+ schedule:
189
+ wait: 10
190
+ warmup: 20
191
+ active: 10
192
+ repeat: 2
193
+ profile_memory: true
194
+ with_stack: true
195
+ optimizer:
196
+ _target_: torch.optim.AdamW
197
+ lr: 0.0001
198
+ weight_decay: 0.001
199
+ betas:
200
+ - 0.9
201
+ - 0.999
202
+ scheduler:
203
+ scheduler:
204
+ _target_: schedulers.CosineAnnealingWithPlateau
205
+ T_max: ${max_steps}
206
+ eta_min: 1.0e-06
207
+ warmup_steps: 10000
tokenizer-16-224/checkpoints/epoch=24-step=500000.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:946156a657430b3aedfa005e2a83729642c679a48f739667970e9dbedba09354
3
+ size 11572743012
tokenizer-16-256/.hydra/config.yaml ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ seed: 42
2
+ max_steps: 500000
3
+ log_every: 500
4
+ eval_every: 100000
5
+ bfloat16: true
6
+ devices: auto
7
+ experiment:
8
+ n_compact_tokens: 16
9
+ n_2d_tokens: 256
10
+ compact_tokenizer_dim: 512
11
+ compact_tokenizer_code_dim: 6
12
+ compact_tokenizer_num_blocks: 8
13
+ process_attn_depth: 3
14
+ n_registers: 0
15
+ enable_encoder_masking: false
16
+ cutoff_enable: false
17
+ cutoff_prob: 0.5
18
+ cutoff_downsample_factor: 2
19
+ model:
20
+ tokenizer:
21
+ _target_: token_distill.token_distill_model.TokenDistillModel
22
+ codebook_size: ${model.tokenizer.compact_tokenizer.quantizer.codebook_size}
23
+ num_tokens: ${experiment.n_compact_tokens}
24
+ normalize_mean: ${dataset.mean}
25
+ normalize_std: ${dataset.std}
26
+ base_tokenizer:
27
+ _target_: token_distill.mage_vqgan.vqgan.VQModel
28
+ encoder:
29
+ _target_: token_distill.mage_vqgan.model.Encoder
30
+ ch: 128
31
+ out_ch: 3
32
+ ch_mult:
33
+ - 1
34
+ - 1
35
+ - 2
36
+ - 2
37
+ - 4
38
+ num_res_blocks: 2
39
+ attn_resolutions:
40
+ - 16
41
+ dropout: 0.0
42
+ in_channels: 3
43
+ resolution: 256
44
+ z_channels: 256
45
+ double_z: false
46
+ decoder:
47
+ _target_: token_distill.mage_vqgan.model.Decoder
48
+ ch: 128
49
+ out_ch: 3
50
+ ch_mult:
51
+ - 1
52
+ - 1
53
+ - 2
54
+ - 2
55
+ - 4
56
+ num_res_blocks: 2
57
+ attn_resolutions:
58
+ - 16
59
+ dropout: 0.0
60
+ in_channels: 3
61
+ resolution: 256
62
+ z_channels: 256
63
+ double_z: false
64
+ n_embed: 1024
65
+ embed_dim: 256
66
+ ckpt_path: ${oc.env:BASE_TOKENIZER_CKPT}/mage_vqgan/vqgan_jax_strongaug.ckpt
67
+ compact_tokenizer:
68
+ _target_: token_distill.compact_tokenizer.CompactTokenizer
69
+ encoder:
70
+ _target_: token_distill.vit_components.DINOv3EncoderQFormer
71
+ in_dim: 768
72
+ latent_dim: 768
73
+ num_2d_tokens: ${experiment.n_2d_tokens}
74
+ dinov3_model_name: dinov3_vitb16
75
+ dinov3_weights_path: ${oc.env:BASE_TOKENIZER_CKPT}/dinov3/dinov3_vitb16_pretrain_lvd1689m-73cec8be.pth
76
+ num_1d_tokens: ${experiment.n_compact_tokens}
77
+ num_registers: ${experiment.n_registers}
78
+ final_norm: true
79
+ out_proj_dim: ${experiment.compact_tokenizer_code_dim}
80
+ final_norm_context: ${model.tokenizer.compact_tokenizer.repa_on_enc}
81
+ enable_masking: ${experiment.enable_encoder_masking}
82
+ masking_prob: 0.9
83
+ min_masking_ratio: 0.0
84
+ max_masking_ratio: 0.6
85
+ freeze_dinov3: true
86
+ num_qformer_layers: 5
87
+ num_attention_heads: 8
88
+ decoder:
89
+ _target_: token_distill.vit_components.DiTDecoder
90
+ in_dim: 1024
91
+ latent_dim: 1024
92
+ target_codebook_size: ${model.tokenizer.base_tokenizer.n_embed}
93
+ process_attn_depth: ${experiment.process_attn_depth}
94
+ num_blocks: 16
95
+ num_2d_tokens: ${experiment.n_2d_tokens}
96
+ final_norm: false
97
+ in_proj_dim: ${experiment.compact_tokenizer_code_dim}
98
+ final_norm_context: true
99
+ repa_target_block_num: 8
100
+ num_1d_tokens: ${experiment.n_compact_tokens}
101
+ quantizer:
102
+ _target_: token_distill.fsq.FSQWrapper
103
+ levels:
104
+ - 8
105
+ - 8
106
+ - 8
107
+ - 5
108
+ - 5
109
+ - 5
110
+ codebook_size: 64000
111
+ diffusion:
112
+ _target_: diffusion.disc_diffusion.DiscreteDiffusionWithCFG
113
+ mask_token_id: ${model.tokenizer.base_tokenizer.n_embed}
114
+ num_timesteps: 16
115
+ schedule_type: cosine
116
+ temperature: 1.0
117
+ output_key: decoder_2d_logits
118
+ cfg_prob: 0.1
119
+ num_1d_tokens: ${experiment.n_compact_tokens}
120
+ num_2d_tokens: ${experiment.n_2d_tokens}
121
+ masking_type: cosine
122
+ target_codebook_size: ${model.tokenizer.base_tokenizer.n_embed}
123
+ repa_on_enc: false
124
+ rep_guidance:
125
+ _target_: token_distill.rep_guidance.RepGuidanceLoss
126
+ in_dim: ${model.tokenizer.compact_tokenizer.decoder.latent_dim}
127
+ repa_target_enc: dinov3_vitb16
128
+ dinov3_weights_path: ${oc.env:BASE_TOKENIZER_CKPT}/dinov3/dinov3_vitb16_pretrain_lvd1689m-73cec8be.pth
129
+ use_mask: false
130
+ dataset:
131
+ context_size: 1
132
+ batch_size: 64
133
+ image_size: 256
134
+ dinov2_image_size: 256
135
+ num_workers: 8
136
+ data_root: ${oc.env:DATASET_PREFIX}/imagenet_wds
137
+ train_shards: ${dataset.data_root}/train/imagenet-train-{000000..001281}.tar
138
+ val_shards: ${dataset.data_root}/val/imagenet-val-{000000..000049}.tar
139
+ test_shards: ${dataset.data_root}/val/imagenet-val-{000000..000049}.tar
140
+ shuffle_buffer_size: 5000
141
+ shard_shuffle_initial: 1000
142
+ estimated_train_size: 1281167
143
+ estimated_val_size: 50000
144
+ estimated_test_size: 50000
145
+ use_augmentation: true
146
+ mean:
147
+ - 0
148
+ - 0
149
+ - 0
150
+ std:
151
+ - 1
152
+ - 1
153
+ - 1
154
+ dinov2_mean:
155
+ - 0.485
156
+ - 0.456
157
+ - 0.406
158
+ dinov2_std:
159
+ - 0.229
160
+ - 0.224
161
+ - 0.225
162
+ use_dual_normalization: true
163
+ use_dino_image_for_compact: true
164
+ base_tokenizer_name: mage
165
+ training:
166
+ notes: dinov3-b-qformer-freeze_256
167
+ run_name: ${now:%Y%m%d_%H%M%S}_${training.notes}
168
+ results_dir: logs/tokenizer_training
169
+ grad_clip_val: 1.0
170
+ accumulate_grad_batches: 1
171
+ from_checkpoint: null
172
+ recon_loss_weight: 1.0
173
+ commit_loss_weight: 0.25
174
+ rep_guidance_loss_weight: 1.0
175
+ wandb_project: token-distill
176
+ log_images_locally: true
177
+ local_image_log_dir: null
178
+ model_summary_depth: 3
179
+ log_metrics_every_n_steps: 50
180
+ profiler:
181
+ enabled: false
182
+ type: pytorch
183
+ record_module_names: true
184
+ file_name: debug
185
+ export_to_chrome: true
186
+ sort_by_key: cpu_time
187
+ row_limit: 100
188
+ schedule:
189
+ wait: 10
190
+ warmup: 20
191
+ active: 10
192
+ repeat: 2
193
+ profile_memory: true
194
+ with_stack: true
195
+ optimizer:
196
+ _target_: torch.optim.AdamW
197
+ lr: 0.0001
198
+ weight_decay: 0.001
199
+ betas:
200
+ - 0.9
201
+ - 0.999
202
+ scheduler:
203
+ scheduler:
204
+ _target_: schedulers.CosineAnnealingWithPlateau
205
+ T_max: ${max_steps}
206
+ eta_min: 1.0e-06
207
+ warmup_steps: 10000
tokenizer-16-256/checkpoints/epoch=24-step=500000.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f73ffacaceed9d8389410d398fe9e458cbb9b55aa744736fc5a468821bb3ddf0
3
+ size 11573725860