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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: pytorch
|
| 3 |
+
tags:
|
| 4 |
+
- robotics
|
| 5 |
+
- world-model
|
| 6 |
+
- diffusion
|
| 7 |
+
- video-generation
|
| 8 |
+
- vjepa
|
| 9 |
+
- dit
|
| 10 |
+
- cosmos-tokenizer
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# RoboJEPA-Decoder-0.6B
|
| 14 |
+
|
| 15 |
+
A 0.6 B-parameter **DiT diffusion decoder that turns frozen V-JEPA 2.1 features back into video.**
|
| 16 |
+
It is the pixel decoder of the `robo_jepa` action-conditioned robot world model: the world model
|
| 17 |
+
predicts future V-JEPA features, and this head renders them as a 33-frame 240x320 clip so you can
|
| 18 |
+
*watch* what the latent world model imagines.
|
| 19 |
+
|
| 20 |
+
It decodes **encoder** features (`train_heads_on_predictor: false`), so it works just as well as a
|
| 21 |
+
standalone "V-JEPA features -> video" inverter, independent of any predictor.
|
| 22 |
+
|
| 23 |
+
> **Checkpoint status: training in progress.** These weights are step **219 400** of a planned
|
| 24 |
+
> 400 000 (55 %). They are usable, and they are not final.
|
| 25 |
+
|
| 26 |
+
## Architecture
|
| 27 |
+
|
| 28 |
+
| | |
|
| 29 |
+
|---|---|
|
| 30 |
+
| kind | DiT (transformer diffusion), x0-prediction |
|
| 31 |
+
| conditioning | V-JEPA 2.1 ViT-G/384 features, 1664-dim, grid 15x20, **9 frames** (see [Usage](#usage)) |
|
| 32 |
+
| latent space | NVIDIA Cosmos-0.1-Tokenizer-CV4x8x8, 16 channels, 9 x 30x40 |
|
| 33 |
+
| output | 33 frames at 240x320 (8x spatial, 4x temporal detokenization) |
|
| 34 |
+
| depth / width | 32 blocks, 1280-dim, 20 heads, 10 KV heads (GQA), MLP ratio 4 |
|
| 35 |
+
| position encoding | RoPE; local temporal attention window of 4 frames |
|
| 36 |
+
| diffusion | `cosine_simple_diffusion`, zero-terminal-SNR, 1000 train steps, 128 at sampling |
|
| 37 |
+
| condition dropout | 0.1 (classifier-free guidance capable) |
|
| 38 |
+
| precision on disk | fp32 |
|
| 39 |
+
|
| 40 |
+
### Parameter count
|
| 41 |
+
|
| 42 |
+
| component | params |
|
| 43 |
+
|---|---|
|
| 44 |
+
| `blocks` (32 DiT blocks) | 577.45 M |
|
| 45 |
+
| `timestep_embedding` | 11.81 M |
|
| 46 |
+
| `null_y` (CFG null condition) | 4.49 M |
|
| 47 |
+
| `cond_mixing` (1664 -> 1280) | 3.77 M |
|
| 48 |
+
| `out_proj` | 0.02 M |
|
| 49 |
+
| `patch_embed` | 0.02 M |
|
| 50 |
+
| **total (this repo)** | **597 568 016** |
|
| 51 |
+
|
| 52 |
+
The Cosmos tokenizer it decodes through is **frozen and not included here** (30.1 M encoder +
|
| 53 |
+
43.1 M decoder); download it separately, see [Usage](#usage). The V-JEPA encoder that produces the
|
| 54 |
+
conditioning features is also separate and frozen.
|
| 55 |
+
|
| 56 |
+
## Files
|
| 57 |
+
|
| 58 |
+
| file | what it is |
|
| 59 |
+
|---|---|
|
| 60 |
+
| `model.safetensors` | the 494 decoder tensors, fp32, 2.39 GB. Keys match `WorldModelDiTCosmosHead.ema_model` (the DDP `module.` prefix has been stripped) |
|
| 61 |
+
| `config.json` | head config in the exact shape `WorldModel.load_pretrained` expects for `decoder/config.json`, plus `epoch` / `global_step` / `num_parameters` |
|
| 62 |
+
|
| 63 |
+
Optimizer state is **not** included, so this is an inference/fine-tuning-from-weights artifact, not
|
| 64 |
+
a resumable training checkpoint.
|
| 65 |
+
|
| 66 |
+
`sha256(model.safetensors) = 4954d5fc2150cd759a3e961d829a8a07f5b82b6146573b9602be6c8268bb76f6`
|
| 67 |
+
|
| 68 |
+
## Usage
|
| 69 |
+
|
| 70 |
+
You need the `robo_jepa` code (`app.robo_jepa.world_model_heads`) and the Cosmos tokenizer:
|
| 71 |
+
|
| 72 |
+
```bash
|
| 73 |
+
# the frozen Cosmos CV4x8x8 tokenizer (NVIDIA, separate license)
|
| 74 |
+
huggingface-cli download nvidia/Cosmos-0.1-Tokenizer-CV4x8x8 \
|
| 75 |
+
encoder.jit decoder.jit --local-dir cosmos/
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
```python
|
| 79 |
+
import json, torch
|
| 80 |
+
from huggingface_hub import hf_hub_download
|
| 81 |
+
from safetensors.torch import load_file
|
| 82 |
+
from app.robo_jepa.world_model_heads import WorldModelDiTCosmosHead
|
| 83 |
+
|
| 84 |
+
REPO = "artemZholus/RoboJEPA-Decoder-0.6B"
|
| 85 |
+
cfg = json.load(open(hf_hub_download(REPO, "config.json")))
|
| 86 |
+
for k in ("kind", "epoch", "global_step", "num_parameters"):
|
| 87 |
+
cfg.pop(k, None)
|
| 88 |
+
diffusion_kwargs = cfg.pop("diffusion_kwargs")
|
| 89 |
+
cfg["encoder_path"] = "cosmos/encoder.jit" # where you downloaded the tokenizer
|
| 90 |
+
cfg["decoder_path"] = "cosmos/decoder.jit"
|
| 91 |
+
|
| 92 |
+
head = WorldModelDiTCosmosHead(head_config=cfg, device="cuda", diffusion_kwargs=diffusion_kwargs)
|
| 93 |
+
sd = load_file(hf_hub_download(REPO, "model.safetensors"))
|
| 94 |
+
missing, unexpected = head.ema_model.load_state_dict(sd, strict=False)
|
| 95 |
+
assert not unexpected, unexpected # fail loudly instead of decoding random weights
|
| 96 |
+
head.eval()
|
| 97 |
+
|
| 98 |
+
# features: [B, T, V, H, W, C] V-JEPA 2.1 features; T = 9, V = 1, H, W = 15, 20, C = 1664
|
| 99 |
+
video = head.decode(features, denoising_steps=128) # -> uint8 [B, 33, V, 240, 320, 3]
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
Three things that will silently or loudly bite you:
|
| 103 |
+
|
| 104 |
+
* **Pass exactly 9 feature frames.** The sampler always builds `num_frames + 1 = 9` Cosmos latent
|
| 105 |
+
frames (the tokenizer's extra first frame), while the attention mask is keyed off the
|
| 106 |
+
*conditioning* depth, so 8 frames in gives
|
| 107 |
+
`RuntimeError: The expanded size of the tensor (10800) must match the existing size (9600)`.
|
| 108 |
+
Upstream does the same thing: `decode(video_features[:, -eval_rollout_steps - 1:])` with
|
| 109 |
+
`eval_rollout_steps = 8`.
|
| 110 |
+
|
| 111 |
+
* **The weights go into `head.ema_model`, not `head.model`.** For `kind: dit` that is where
|
| 112 |
+
`load_pretrained` puts them and where `decode()` samples from. During training the EMA is
|
| 113 |
+
refreshed with `decay=0.0` (a straight copy), so EMA and online weights are identical.
|
| 114 |
+
* **`load_state_dict(..., strict=False)` is how the head is loaded upstream**, which means a key
|
| 115 |
+
mismatch loads *nothing* and raises no error. Assert on `unexpected` (and check `missing`) as
|
| 116 |
+
above. The keys here were exported to match, and verified by loading.
|
| 117 |
+
* **Keep `attn_impl: "sdpa"`.** `local_attn_window` makes the model pass a custom attention mask,
|
| 118 |
+
and the `fmha` path raises `ValueError: fmha is supported with custom attention mask!`. Note the
|
| 119 |
+
SDPA kernel this needs is not available on every GPU — the same call that works on an A100 fails
|
| 120 |
+
with `RuntimeError: No available kernel` on older cards.
|
| 121 |
+
|
| 122 |
+
The snippet above was run end to end on an A100-80GB before publishing: 494/494 tensors loaded with
|
| 123 |
+
0 missing and 0 unexpected keys, bitwise identical to the training checkpoint, and `decode` on
|
| 124 |
+
random features returned a `uint8` tensor of shape `(1, 33, 1, 240, 320, 3)`. Sampling 1 clip at 8
|
| 125 |
+
denoising steps peaked at 6.0 GB of GPU memory.
|
| 126 |
+
|
| 127 |
+
## Training
|
| 128 |
+
|
| 129 |
+
Only this head was trained. The V-JEPA 2.1 ViT-G/384 encoder is frozen, and the world model's
|
| 130 |
+
predictor was *not* trained in this run, so the decoder never saw predicted features.
|
| 131 |
+
|
| 132 |
+
| | |
|
| 133 |
+
|---|---|
|
| 134 |
+
| steps | 219 400 (epoch 1097 of a planned 2000 x 200) |
|
| 135 |
+
| hardware | 1 node x 4 A100-80GB, ~3.02 s/iter, 56 GB peak per GPU |
|
| 136 |
+
| global batch | 8 clips/step (2 per GPU, no grad accumulation), 8 feature frames per clip |
|
| 137 |
+
| optimizer | AdamW, constant lr 1e-4, betas (0.9, 0.95), weight decay 0, grad clip 1.0 |
|
| 138 |
+
| precision | bf16 mixed precision, `torch.compile`d |
|
| 139 |
+
| objective | x0-prediction diffusion loss in Cosmos latent space |
|
| 140 |
+
| last logged `encoder_image_loss` | **0.0204** (0.038 at step 140 600, so still improving) |
|
| 141 |
+
|
| 142 |
+
### Data
|
| 143 |
+
|
| 144 |
+
A weighted mixture of three real-robot datasets, sampled in proportion to video hours:
|
| 145 |
+
|
| 146 |
+
| dataset | weight | episodes | raw fps | sampled fps | intermediate fps |
|
| 147 |
+
|---|---|---|---|---|---|
|
| 148 |
+
| LeRobot (single-arm SO-100/101) | 0.0818 | 22 998 | 30 | 7.5 | 30 |
|
| 149 |
+
| DROID | 0.4257 | 73 338 | 15 | 1.875 | 7.5 |
|
| 150 |
+
| AgiBot World | 0.4925 | 34 512 | 30 | 7.5 | 15 |
|
| 151 |
+
|
| 152 |
+
`intermediate_frames_fps / fps` is 4 for every dataset by construction — the ratio sets the clip
|
| 153 |
+
length the DiT head expects (33 frames), so it cannot differ across datasets in one run.
|
| 154 |
+
|
| 155 |
+
Augmentation: random resized crop to 240x320 (aspect 1.333-1.777, scale 0.5-1.0), no flip.
|
| 156 |
+
|
| 157 |
+
Caveats inherited from the data pipeline, worth knowing before you trust a sample:
|
| 158 |
+
|
| 159 |
+
* The LeRobot mixture is read with a single `raw_fps: 30`, but ~4.5 % of its episodes are not 30 fps
|
| 160 |
+
(15, 10, 25, 50, 20, 5), so those clips play at the wrong speed.
|
| 161 |
+
* AgiBot proprioception is adapted from `end/`+`effector/` into the loader's flat layout; the
|
| 162 |
+
quaternion is read as scalar-last `(x, y, z, w)` and the gripper opening is scaled by 120 without
|
| 163 |
+
polarity inversion. Neither is confirmed against AgiBot documentation. This affects
|
| 164 |
+
action/state conditioning, not the pixel decoding path used by this head.
|
| 165 |
+
* ~3 % of AgiBot episodes are dexterous-hand (12-DoF) and have their gripper columns zeroed.
|
| 166 |
+
|
| 167 |
+
## Intended use and limits
|
| 168 |
+
|
| 169 |
+
Made for research: visualizing and debugging latent robot world models, and as a general
|
| 170 |
+
V-JEPA-feature-to-pixel decoder. It is trained only on third-person and wrist robot-manipulation
|
| 171 |
+
video at 240x320, and it reconstructs what the features encode — it is not a text-to-video model,
|
| 172 |
+
has no language conditioning, and will not hold identity or text detail that V-JEPA features drop.
|
| 173 |
+
Samples of unseen scene types, other resolutions, or other feature extractors are out of
|
| 174 |
+
distribution. Not validated for any safety-critical or on-robot control use.
|
| 175 |
+
|
| 176 |
+
## Provenance
|
| 177 |
+
|
| 178 |
+
Built with `robo_jepa`, config `configs/decoder/video_dit_240_3ds_mila.yaml`, run
|
| 179 |
+
`video_dit_240_3ds_mila_26_09_23_02_35_30`, trained on the Mila cluster.
|
| 180 |
+
|
| 181 |
+
Third-party components, each under its own license, none redistributed here: V-JEPA 2.1 ViT-G/384
|
| 182 |
+
(Meta) for the conditioning features, Cosmos-0.1-Tokenizer-CV4x8x8 (NVIDIA) for the latent space,
|
| 183 |
+
and the DROID / AgiBot World / LeRobot community datasets for training data. Check those terms
|
| 184 |
+
before using these weights beyond research — in particular the training datasets' terms, which can
|
| 185 |
+
be more restrictive than the code's.
|
config.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"denoising_steps": [
|
| 3 |
+
1000
|
| 4 |
+
],
|
| 5 |
+
"eval_denoising_steps": 128,
|
| 6 |
+
"patch_size": 1,
|
| 7 |
+
"use_cosmos": true,
|
| 8 |
+
"in_chans": 16,
|
| 9 |
+
"tubelet_size": 1,
|
| 10 |
+
"use_rope": true,
|
| 11 |
+
"num_frames": 8,
|
| 12 |
+
"decode_video": true,
|
| 13 |
+
"img_size": [
|
| 14 |
+
30,
|
| 15 |
+
40
|
| 16 |
+
],
|
| 17 |
+
"condition_dim": 1664,
|
| 18 |
+
"decoder_embed_dim": 1280,
|
| 19 |
+
"condition_dropout": 0.1,
|
| 20 |
+
"depth": 32,
|
| 21 |
+
"num_heads": 20,
|
| 22 |
+
"num_kv_heads": 10,
|
| 23 |
+
"mlp_ratio": 4.0,
|
| 24 |
+
"num_views": 1,
|
| 25 |
+
"condition_h": 15,
|
| 26 |
+
"condition_w": 20,
|
| 27 |
+
"condition_d": 8,
|
| 28 |
+
"use_activation_checkpointing": false,
|
| 29 |
+
"local_attn_window": [
|
| 30 |
+
4,
|
| 31 |
+
-1,
|
| 32 |
+
-1
|
| 33 |
+
],
|
| 34 |
+
"attn_impl": "sdpa",
|
| 35 |
+
"encoder_path": "cosmos/encoder.jit",
|
| 36 |
+
"decoder_path": "cosmos/decoder.jit",
|
| 37 |
+
"kind": "dit",
|
| 38 |
+
"diffusion_kwargs": {
|
| 39 |
+
"noise_schedule": "cosine_simple_diffusion",
|
| 40 |
+
"shift": 1.0,
|
| 41 |
+
"clip_min": 1e-09,
|
| 42 |
+
"zero_terminal_snr": true,
|
| 43 |
+
"predict_v": false,
|
| 44 |
+
"predict_xstart": true,
|
| 45 |
+
"sigma_small": true,
|
| 46 |
+
"learn_sigma": false,
|
| 47 |
+
"diffusion_steps": 1000
|
| 48 |
+
},
|
| 49 |
+
"epoch": 1097,
|
| 50 |
+
"global_step": 219400,
|
| 51 |
+
"num_parameters": 597568016
|
| 52 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4954d5fc2150cd759a3e961d829a8a07f5b82b6146573b9602be6c8268bb76f6
|
| 3 |
+
size 2390320792
|