Bigenlight commited on
Commit
cd0e969
·
verified ·
1 Parent(s): 51e3c27

fp16 diffusion JOINT @80k (poseMAE 0.0827, gripAcc 0.960)

Browse files
README.md ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - robotics
5
+ - lerobot
6
+ - diffusion-policy
7
+ - imitation-learning
8
+ - manipulation
9
+ ---
10
+
11
+ # Diffusion Policy — banana-in-pot (JOINT, fp16)
12
+
13
+ Diffusion Policy trained on the **"put the right banana in the pot"** task (UR7e + GELLO
14
+ teleoperation, 2 RGB cameras), in **JOINT** action space (6 joints + gripper), using
15
+ **fp16 mixed-precision** training.
16
+
17
+ - **Checkpoint:** step 80,000 (best open-loop MAE)
18
+ - **Base library:** [LeRobot](https://github.com/huggingface/lerobot) 0.6.1 (pin `8a74e0a`)
19
+ - **Dataset:** [`Bigenlight/banana_in_pot_lerobot_v3`](https://huggingface.co/datasets/Bigenlight/banana_in_pot_lerobot_v3) — 51 episodes / 21,524 frames / 30 fps
20
+ - **fp32 sibling:** [`Bigenlight/diffusion_banana_in_pot_joint`](https://huggingface.co/Bigenlight/diffusion_banana_in_pot_joint)
21
+
22
+ ## Architecture
23
+
24
+ ResNet18 (ImageNet-pretrained, trained end-to-end) + SpatialSoftmax vision encoder →
25
+ FiLM-conditioned 1D temporal U-Net denoiser (DDPM-100, epsilon prediction). ~278M params.
26
+ Images resized to 360×640, crop off. `n_obs_steps=2`, `horizon=64`, `n_action_steps=32`.
27
+
28
+ ## Training
29
+
30
+ - **Precision:** fp16 via HF Accelerate `mixed_precision=fp16` (automatic GradScaler).
31
+ - Requires a `dtype` field on `DiffusionConfig` (absent upstream at this pin); launched with
32
+ `--policy.dtype=float16`.
33
+ - Batch 8, 80k steps, AdamW, seed 1000, 45 train / 6 held-out episodes.
34
+ - **Hardware:** single RTX A4000. **~4.48 step/s, ~4.96 h** (vs ~3.49 step/s / ~6.4 h fp32 →
35
+ ~1.25× faster, ~22% less wall-clock). No NaN/instability.
36
+
37
+ ## Open-loop evaluation (DDIM-10, held-out episodes 45–50)
38
+
39
+ | | fp32 @80k | **fp16 @80k** |
40
+ |---|---|---|
41
+ | poseMAE (rad) | 0.0845 | **0.08268** |
42
+ | gripper accuracy | 0.953 | **0.960** |
43
+
44
+ **fp16 matches (marginally beats, within noise) fp32 accuracy at ~22% lower training cost.**
45
+ Select the deploy checkpoint by open-loop MAE, **not** `eval_loss` (which rises during
46
+ training for diffusion policies without indicating overfitting).
47
+
48
+ ## Intended use & limitations
49
+
50
+ Research artifact. Small single-task, single-scene, real-world (noisy) dataset of 51
51
+ success-only demonstrations; offline metrics only — no closed-loop hardware success rate
52
+ measured yet. Not safety-validated for autonomous operation.
config.json ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "diffusion",
3
+ "n_obs_steps": 2,
4
+ "input_features": {
5
+ "observation.state": {
6
+ "type": "STATE",
7
+ "shape": [
8
+ 7
9
+ ]
10
+ },
11
+ "observation.images.cam1": {
12
+ "type": "VISUAL",
13
+ "shape": [
14
+ 3,
15
+ 720,
16
+ 1280
17
+ ]
18
+ },
19
+ "observation.images.cam2": {
20
+ "type": "VISUAL",
21
+ "shape": [
22
+ 3,
23
+ 720,
24
+ 1280
25
+ ]
26
+ }
27
+ },
28
+ "output_features": {
29
+ "action": {
30
+ "type": "ACTION",
31
+ "shape": [
32
+ 7
33
+ ]
34
+ }
35
+ },
36
+ "device": "cuda",
37
+ "use_amp": false,
38
+ "use_peft": false,
39
+ "push_to_hub": false,
40
+ "repo_id": null,
41
+ "private": null,
42
+ "tags": null,
43
+ "license": null,
44
+ "pretrained_path": null,
45
+ "pretrained_revision": null,
46
+ "horizon": 64,
47
+ "n_action_steps": 32,
48
+ "normalization_mapping": {
49
+ "VISUAL": "MEAN_STD",
50
+ "STATE": "MIN_MAX",
51
+ "ACTION": "MIN_MAX"
52
+ },
53
+ "drop_n_last_frames": 31,
54
+ "dtype": "float16",
55
+ "vision_backbone": "resnet18",
56
+ "resize_shape": [
57
+ 360,
58
+ 640
59
+ ],
60
+ "crop_ratio": 1.0,
61
+ "crop_shape": null,
62
+ "crop_is_random": true,
63
+ "pretrained_backbone_weights": "ResNet18_Weights.IMAGENET1K_V1",
64
+ "use_group_norm": false,
65
+ "spatial_softmax_num_keypoints": 32,
66
+ "use_separate_rgb_encoder_per_camera": true,
67
+ "down_dims": [
68
+ 512,
69
+ 1024,
70
+ 2048
71
+ ],
72
+ "kernel_size": 5,
73
+ "n_groups": 8,
74
+ "diffusion_step_embed_dim": 128,
75
+ "use_film_scale_modulation": true,
76
+ "noise_scheduler_type": "DDPM",
77
+ "num_train_timesteps": 100,
78
+ "beta_schedule": "squaredcos_cap_v2",
79
+ "beta_start": 0.0001,
80
+ "beta_end": 0.02,
81
+ "prediction_type": "epsilon",
82
+ "clip_sample": true,
83
+ "clip_sample_range": 1.0,
84
+ "num_inference_steps": null,
85
+ "compile_model": false,
86
+ "compile_mode": "reduce-overhead",
87
+ "do_mask_loss_for_padding": false,
88
+ "optimizer_lr": 0.0001,
89
+ "optimizer_betas": [
90
+ 0.95,
91
+ 0.999
92
+ ],
93
+ "optimizer_eps": 1e-08,
94
+ "optimizer_weight_decay": 1e-06,
95
+ "scheduler_name": "cosine",
96
+ "scheduler_warmup_steps": 500
97
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6d998cd7f1000ac8ba1b2778bdb45454cb4765d4f7c4c61c648139745a7fc65
3
+ size 1111651364
policy_postprocessor.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "policy_postprocessor",
3
+ "steps": [
4
+ {
5
+ "registry_name": "unnormalizer_processor",
6
+ "config": {
7
+ "eps": 1e-08,
8
+ "features": {
9
+ "action": {
10
+ "type": "ACTION",
11
+ "shape": [
12
+ 7
13
+ ]
14
+ }
15
+ },
16
+ "norm_map": {
17
+ "VISUAL": "MEAN_STD",
18
+ "STATE": "MIN_MAX",
19
+ "ACTION": "MIN_MAX"
20
+ }
21
+ },
22
+ "state_file": "policy_postprocessor_step_0_unnormalizer_processor.safetensors"
23
+ },
24
+ {
25
+ "registry_name": "device_processor",
26
+ "config": {
27
+ "device": "cpu",
28
+ "float_dtype": null
29
+ }
30
+ }
31
+ ]
32
+ }
policy_postprocessor_step_0_unnormalizer_processor.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:035168b1aa56baa0e57608cf3058bcbe872d35d7a945a29271a2482c31fd094f
3
+ size 7608
policy_preprocessor.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "policy_preprocessor",
3
+ "steps": [
4
+ {
5
+ "registry_name": "rename_observations_processor",
6
+ "config": {
7
+ "rename_map": {}
8
+ }
9
+ },
10
+ {
11
+ "registry_name": "to_batch_processor",
12
+ "config": {}
13
+ },
14
+ {
15
+ "registry_name": "device_processor",
16
+ "config": {
17
+ "device": "cuda",
18
+ "float_dtype": null
19
+ }
20
+ },
21
+ {
22
+ "registry_name": "normalizer_processor",
23
+ "config": {
24
+ "eps": 1e-08,
25
+ "features": {
26
+ "observation.state": {
27
+ "type": "STATE",
28
+ "shape": [
29
+ 7
30
+ ]
31
+ },
32
+ "observation.images.cam1": {
33
+ "type": "VISUAL",
34
+ "shape": [
35
+ 3,
36
+ 720,
37
+ 1280
38
+ ]
39
+ },
40
+ "observation.images.cam2": {
41
+ "type": "VISUAL",
42
+ "shape": [
43
+ 3,
44
+ 720,
45
+ 1280
46
+ ]
47
+ },
48
+ "action": {
49
+ "type": "ACTION",
50
+ "shape": [
51
+ 7
52
+ ]
53
+ }
54
+ },
55
+ "norm_map": {
56
+ "VISUAL": "MEAN_STD",
57
+ "STATE": "MIN_MAX",
58
+ "ACTION": "MIN_MAX"
59
+ }
60
+ },
61
+ "state_file": "policy_preprocessor_step_3_normalizer_processor.safetensors"
62
+ }
63
+ ]
64
+ }
policy_preprocessor_step_3_normalizer_processor.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1798a108428d8b529f04a915825c270ed877b2489c744abe55164ecf13f43604
3
+ size 7616
train_config.json ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": {
3
+ "repo_id": "theo/banana_in_pot",
4
+ "root": "./banana_in_pot_lerobot",
5
+ "episodes": null,
6
+ "image_transforms": {
7
+ "enable": true,
8
+ "max_num_transforms": 1,
9
+ "random_order": false,
10
+ "tfs": {
11
+ "resize": {
12
+ "weight": 1.0,
13
+ "type": "Resize",
14
+ "kwargs": {
15
+ "size": [
16
+ 360,
17
+ 640
18
+ ]
19
+ }
20
+ }
21
+ }
22
+ },
23
+ "revision": null,
24
+ "use_imagenet_stats": true,
25
+ "video_backend": "torchcodec",
26
+ "return_uint8": false,
27
+ "depth_output_unit": "mm",
28
+ "streaming": false,
29
+ "eval_split": 0.117
30
+ },
31
+ "env": null,
32
+ "policy": {
33
+ "type": "diffusion",
34
+ "n_obs_steps": 2,
35
+ "input_features": {
36
+ "observation.state": {
37
+ "type": "STATE",
38
+ "shape": [
39
+ 7
40
+ ]
41
+ },
42
+ "observation.images.cam1": {
43
+ "type": "VISUAL",
44
+ "shape": [
45
+ 3,
46
+ 720,
47
+ 1280
48
+ ]
49
+ },
50
+ "observation.images.cam2": {
51
+ "type": "VISUAL",
52
+ "shape": [
53
+ 3,
54
+ 720,
55
+ 1280
56
+ ]
57
+ }
58
+ },
59
+ "output_features": {
60
+ "action": {
61
+ "type": "ACTION",
62
+ "shape": [
63
+ 7
64
+ ]
65
+ }
66
+ },
67
+ "device": "cuda",
68
+ "use_amp": false,
69
+ "use_peft": false,
70
+ "push_to_hub": false,
71
+ "repo_id": null,
72
+ "private": null,
73
+ "tags": null,
74
+ "license": null,
75
+ "pretrained_path": null,
76
+ "pretrained_revision": null,
77
+ "horizon": 64,
78
+ "n_action_steps": 32,
79
+ "normalization_mapping": {
80
+ "VISUAL": "MEAN_STD",
81
+ "STATE": "MIN_MAX",
82
+ "ACTION": "MIN_MAX"
83
+ },
84
+ "drop_n_last_frames": 31,
85
+ "dtype": "float16",
86
+ "vision_backbone": "resnet18",
87
+ "resize_shape": [
88
+ 360,
89
+ 640
90
+ ],
91
+ "crop_ratio": 1.0,
92
+ "crop_shape": null,
93
+ "crop_is_random": true,
94
+ "pretrained_backbone_weights": "ResNet18_Weights.IMAGENET1K_V1",
95
+ "use_group_norm": false,
96
+ "spatial_softmax_num_keypoints": 32,
97
+ "use_separate_rgb_encoder_per_camera": true,
98
+ "down_dims": [
99
+ 512,
100
+ 1024,
101
+ 2048
102
+ ],
103
+ "kernel_size": 5,
104
+ "n_groups": 8,
105
+ "diffusion_step_embed_dim": 128,
106
+ "use_film_scale_modulation": true,
107
+ "noise_scheduler_type": "DDPM",
108
+ "num_train_timesteps": 100,
109
+ "beta_schedule": "squaredcos_cap_v2",
110
+ "beta_start": 0.0001,
111
+ "beta_end": 0.02,
112
+ "prediction_type": "epsilon",
113
+ "clip_sample": true,
114
+ "clip_sample_range": 1.0,
115
+ "num_inference_steps": null,
116
+ "compile_model": false,
117
+ "compile_mode": "reduce-overhead",
118
+ "do_mask_loss_for_padding": false,
119
+ "optimizer_lr": 0.0001,
120
+ "optimizer_betas": [
121
+ 0.95,
122
+ 0.999
123
+ ],
124
+ "optimizer_eps": 1e-08,
125
+ "optimizer_weight_decay": 1e-06,
126
+ "scheduler_name": "cosine",
127
+ "scheduler_warmup_steps": 500
128
+ },
129
+ "reward_model": null,
130
+ "output_dir": "outputs/train/diffusion_joint_fp16",
131
+ "job_name": "diffusion_joint_fp16",
132
+ "resume": false,
133
+ "seed": 1000,
134
+ "cudnn_deterministic": false,
135
+ "num_workers": 8,
136
+ "batch_size": 8,
137
+ "prefetch_factor": 4,
138
+ "persistent_workers": true,
139
+ "steps": 80000,
140
+ "env_eval_freq": 20000,
141
+ "log_freq": 200,
142
+ "eval_steps": 5000,
143
+ "max_eval_samples": 480,
144
+ "tolerance_s": 0.0001,
145
+ "save_checkpoint": true,
146
+ "save_freq": 20000,
147
+ "use_policy_training_preset": true,
148
+ "optimizer": {
149
+ "type": "adam",
150
+ "lr": 0.0001,
151
+ "weight_decay": 1e-06,
152
+ "grad_clip_norm": 10.0,
153
+ "betas": [
154
+ 0.95,
155
+ 0.999
156
+ ],
157
+ "eps": 1e-08
158
+ },
159
+ "scheduler": {
160
+ "type": "diffuser",
161
+ "num_warmup_steps": 500,
162
+ "name": "cosine"
163
+ },
164
+ "eval": {
165
+ "n_episodes": 50,
166
+ "batch_size": 44,
167
+ "use_async_envs": true,
168
+ "recording": false,
169
+ "recording_repo_id": null,
170
+ "recording_private": false
171
+ },
172
+ "wandb": {
173
+ "enable": false,
174
+ "disable_artifact": false,
175
+ "project": "lerobot",
176
+ "entity": null,
177
+ "notes": null,
178
+ "run_id": null,
179
+ "mode": null,
180
+ "add_tags": true
181
+ },
182
+ "peft": null,
183
+ "job": {
184
+ "target": null,
185
+ "image": "huggingface/lerobot-gpu:latest",
186
+ "timeout": "2d",
187
+ "detach": false,
188
+ "tags": []
189
+ },
190
+ "save_checkpoint_to_hub": false,
191
+ "sample_weighting": null,
192
+ "rename_map": {},
193
+ "checkpoint_path": null
194
+ }