umegan commited on
Commit
a5b881a
·
verified ·
1 Parent(s): 7eba780

Upload folder using huggingface_hub

Browse files
config.json ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "action_horizon": 50,
3
+ "add_pos_embed": true,
4
+ "apply_sincos_state_encoding": true,
5
+ "architectures": [
6
+ "Gr00tN1d6"
7
+ ],
8
+ "attn_dropout": 0.2,
9
+ "attn_implementation": null,
10
+ "backbone_embedding_dim": 2048,
11
+ "backbone_model_type": "eagle",
12
+ "backbone_trainable_params_fp32": true,
13
+ "collator_overwrite_image_inputs": false,
14
+ "color_jitter_params": {
15
+ "brightness": 0.1,
16
+ "contrast": 0.1,
17
+ "hue": 0.1,
18
+ "saturation": 0.1
19
+ },
20
+ "crop_fraction": 0.95,
21
+ "diffusion_model_cfg": {
22
+ "attention_head_dim": 48,
23
+ "dropout": 0.2,
24
+ "final_dropout": true,
25
+ "interleave_self_attention": true,
26
+ "norm_type": "ada_norm",
27
+ "num_attention_heads": 32,
28
+ "num_layers": 32,
29
+ "output_dim": 1024,
30
+ "positional_embeddings": null
31
+ },
32
+ "eagle_collator": true,
33
+ "formalize_language": true,
34
+ "gemma_collator": false,
35
+ "hidden_size": 1024,
36
+ "image_crop_size": null,
37
+ "image_target_size": null,
38
+ "input_embedding_dim": 1536,
39
+ "load_bf16": true,
40
+ "max_action_dim": 128,
41
+ "max_num_embodiments": 32,
42
+ "max_seq_len": 1024,
43
+ "max_state_dim": 128,
44
+ "model_dtype": "bfloat16",
45
+ "model_name": "nvidia/Eagle-Block2A-2B-v2",
46
+ "model_type": "Gr00tN1d6",
47
+ "noise_beta_alpha": 1.5,
48
+ "noise_beta_beta": 1.0,
49
+ "noise_s": 0.999,
50
+ "num_inference_timesteps": 4,
51
+ "num_timestep_buckets": 1000,
52
+ "random_rotation_angle": null,
53
+ "reproject_vision": false,
54
+ "select_layer": 16,
55
+ "shortest_image_edge": 256,
56
+ "state_dropout_prob": 0.0,
57
+ "torch_dtype": "bfloat16",
58
+ "transformers_version": "4.51.3",
59
+ "tune_diffusion_model": true,
60
+ "tune_llm": false,
61
+ "tune_projector": true,
62
+ "tune_top_llm_layers": 4,
63
+ "tune_visual": false,
64
+ "tune_vlln": true,
65
+ "use_albumentations_transforms": true,
66
+ "use_alternate_vl_dit": true,
67
+ "use_flash_attention": true,
68
+ "use_relative_action": true,
69
+ "use_vlln": true
70
+ }
embodiment_id.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "robocasa_panda_omron": 13,
3
+ "gr1": 20,
4
+ "behavior_r1_pro": 24,
5
+ "unitree_g1": 8,
6
+ "oxe_google": 0,
7
+ "oxe_widowx": 1,
8
+ "libero_panda": 2,
9
+ "oxe_droid": 16,
10
+ "new_embodiment": 10
11
+ }
experiment_cfg/conf.yaml ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ load_config_path: null
2
+ model:
3
+ model_type: Gr00tN1d6
4
+ model_dtype: bfloat16
5
+ model_name: nvidia/Eagle-Block2A-2B-v2
6
+ backbone_model_type: eagle
7
+ model_revision: null
8
+ tune_top_llm_layers: 4
9
+ backbone_embedding_dim: 2048
10
+ tune_llm: false
11
+ tune_visual: false
12
+ select_layer: 16
13
+ reproject_vision: false
14
+ use_flash_attention: true
15
+ load_bf16: false
16
+ collator_overwrite_image_inputs: false
17
+ eagle_collator: true
18
+ backbone_trainable_params_fp32: true
19
+ image_crop_size: null
20
+ image_target_size: null
21
+ shortest_image_edge: 256
22
+ crop_fraction: 0.95
23
+ random_rotation_angle: null
24
+ color_jitter_params:
25
+ brightness: 0.3
26
+ contrast: 0.4
27
+ saturation: 0.5
28
+ hue: 0.08
29
+ use_albumentations_transforms: true
30
+ formalize_language: true
31
+ apply_sincos_state_encoding: false
32
+ use_relative_action: true
33
+ max_state_dim: 29
34
+ max_action_dim: 29
35
+ action_horizon: 16
36
+ hidden_size: 1024
37
+ input_embedding_dim: 1536
38
+ add_pos_embed: true
39
+ attn_dropout: 0.2
40
+ use_vlln: true
41
+ max_seq_len: 1024
42
+ use_alternate_vl_dit: true
43
+ attend_text_every_n_blocks: 2
44
+ diffusion_model_cfg:
45
+ positional_embeddings: null
46
+ num_layers: 32
47
+ num_attention_heads: 32
48
+ attention_head_dim: 48
49
+ norm_type: ada_norm
50
+ dropout: 0.2
51
+ final_dropout: true
52
+ output_dim: 1024
53
+ interleave_self_attention: true
54
+ num_inference_timesteps: 4
55
+ noise_beta_alpha: 1.5
56
+ noise_beta_beta: 1.0
57
+ noise_s: 0.999
58
+ num_timestep_buckets: 1000
59
+ tune_projector: true
60
+ tune_diffusion_model: true
61
+ tune_vlln: true
62
+ state_dropout_prob: 0.0
63
+ state_additive_noise_scale: 0.0
64
+ max_num_embodiments: 32
65
+ data:
66
+ datasets:
67
+ - dataset_paths:
68
+ - /workspaces/isaaclab_arena/train_data
69
+ embodiment_tag: new_embodiment
70
+ mix_ratio: 1.0
71
+ dataset_type: physical_embodiment
72
+ val_dataset_path: null
73
+ modality_configs:
74
+ new_embodiment:
75
+ video:
76
+ delta_indices:
77
+ - 0
78
+ modality_keys:
79
+ - ego_view
80
+ - left_view
81
+ - right_view
82
+ sin_cos_embedding_keys: null
83
+ mean_std_embedding_keys: null
84
+ action_configs: null
85
+ state:
86
+ delta_indices:
87
+ - 0
88
+ modality_keys:
89
+ - single_arm
90
+ - gripper
91
+ sin_cos_embedding_keys: null
92
+ mean_std_embedding_keys: null
93
+ action_configs: null
94
+ action:
95
+ delta_indices:
96
+ - 0
97
+ - 1
98
+ - 2
99
+ - 3
100
+ - 4
101
+ - 5
102
+ - 6
103
+ - 7
104
+ - 8
105
+ - 9
106
+ - 10
107
+ - 11
108
+ - 12
109
+ - 13
110
+ - 14
111
+ - 15
112
+ modality_keys:
113
+ - single_arm
114
+ - gripper
115
+ sin_cos_embedding_keys: null
116
+ mean_std_embedding_keys: null
117
+ action_configs:
118
+ - rep: RELATIVE
119
+ type: NON_EEF
120
+ format: DEFAULT
121
+ state_key: single_arm
122
+ - rep: ABSOLUTE
123
+ type: NON_EEF
124
+ format: DEFAULT
125
+ state_key: null
126
+ language:
127
+ delta_indices:
128
+ - 0
129
+ modality_keys:
130
+ - annotation.human.task_description
131
+ sin_cos_embedding_keys: null
132
+ mean_std_embedding_keys: null
133
+ action_configs: null
134
+ download_cache: false
135
+ shard_size: 1024
136
+ episode_sampling_rate: 0.1
137
+ num_shards_per_epoch: 100000
138
+ override_pretraining_statistics: false
139
+ mode: single_turn
140
+ random_chop: 0.0
141
+ mock_dataset_mode: false
142
+ shuffle: true
143
+ seed: 42
144
+ multiprocessing_context: fork
145
+ allow_padding: false
146
+ subsample_ratio: 1.0
147
+ image_crop_size:
148
+ - 244
149
+ - 244
150
+ image_target_size:
151
+ - 224
152
+ - 224
153
+ video_backend: torchcodec
154
+ training:
155
+ output_dir: /workspaces/isaaclab_arena/models
156
+ experiment_name: null
157
+ max_steps: 10000
158
+ global_batch_size: 32
159
+ batch_size: null
160
+ gradient_accumulation_steps: 1
161
+ learning_rate: 0.0001
162
+ lr_scheduler_type: cosine
163
+ weight_decay: 1.0e-05
164
+ warmup_ratio: 0.05
165
+ warmup_steps: 0
166
+ max_grad_norm: 1.0
167
+ optim: adamw_torch
168
+ start_from_checkpoint: nvidia/GR00T-N1.6-3B
169
+ tf32: true
170
+ fp16: false
171
+ bf16: true
172
+ eval_bf16: true
173
+ logging_steps: 10
174
+ save_steps: 200
175
+ save_total_limit: 5
176
+ save_vl_model: false
177
+ upload_checkpoints: false
178
+ upload_every: 1000
179
+ upload_last_n_checkpoints: 5
180
+ max_concurrent_uploads: 2
181
+ eval_strategy: 'no'
182
+ eval_steps: 500
183
+ eval_set_split_ratio: 0.1
184
+ eval_batch_size: 2
185
+ save_best_eval_metric_name: ''
186
+ save_best_eval_metric_greater_is_better: true
187
+ deepspeed_stage: 2
188
+ gradient_checkpointing: false
189
+ transformers_trust_remote_code: true
190
+ transformers_local_files_only: false
191
+ transformers_cache_dir: null
192
+ transformers_access_token: null
193
+ use_ddp: false
194
+ ddp_bucket_cap_mb: 100
195
+ num_gpus: 4
196
+ dataloader_num_workers: 32
197
+ remove_unused_columns: false
198
+ use_wandb: true
199
+ wandb_project: finetune-gr00t-n1d6
200
+ enable_profiling: false
201
+ max_retries: 3
202
+ assert_loss_less_than: null
203
+ add_rl_callback: false
204
+ enable_open_loop_eval: false
205
+ open_loop_eval_traj_ids:
206
+ - 0
207
+ open_loop_eval_steps_per_traj: 100
208
+ open_loop_eval_plot_indices: null
209
+ max_steps: 10000
210
+ save_steps: 200
experiment_cfg/config.yaml ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !!python/object:gr00t.configs.base_config.Config
2
+ data: !!python/object:gr00t.configs.data.data_config.DataConfig
3
+ allow_padding: false
4
+ datasets:
5
+ - !!python/object:gr00t.configs.data.data_config.SingleDatasetConfig
6
+ dataset_paths:
7
+ - /workspaces/isaaclab_arena/train_data
8
+ dataset_type: physical_embodiment
9
+ embodiment_tag: new_embodiment
10
+ mix_ratio: 1.0
11
+ val_dataset_path: null
12
+ download_cache: false
13
+ episode_sampling_rate: 0.1
14
+ image_crop_size:
15
+ - 244
16
+ - 244
17
+ image_target_size:
18
+ - 224
19
+ - 224
20
+ mock_dataset_mode: false
21
+ modality_configs:
22
+ new_embodiment:
23
+ action: !!python/object:gr00t.data.types.ModalityConfig
24
+ action_configs:
25
+ - !!python/object:gr00t.data.types.ActionConfig
26
+ format: &id001 !!python/object/apply:gr00t.data.types.ActionFormat
27
+ - default
28
+ rep: !!python/object/apply:gr00t.data.types.ActionRepresentation
29
+ - relative
30
+ state_key: single_arm
31
+ type: &id002 !!python/object/apply:gr00t.data.types.ActionType
32
+ - non_eef
33
+ - !!python/object:gr00t.data.types.ActionConfig
34
+ format: *id001
35
+ rep: !!python/object/apply:gr00t.data.types.ActionRepresentation
36
+ - absolute
37
+ state_key: null
38
+ type: *id002
39
+ delta_indices:
40
+ - 0
41
+ - 1
42
+ - 2
43
+ - 3
44
+ - 4
45
+ - 5
46
+ - 6
47
+ - 7
48
+ - 8
49
+ - 9
50
+ - 10
51
+ - 11
52
+ - 12
53
+ - 13
54
+ - 14
55
+ - 15
56
+ mean_std_embedding_keys: null
57
+ modality_keys:
58
+ - single_arm
59
+ - gripper
60
+ sin_cos_embedding_keys: null
61
+ language: !!python/object:gr00t.data.types.ModalityConfig
62
+ action_configs: null
63
+ delta_indices:
64
+ - 0
65
+ mean_std_embedding_keys: null
66
+ modality_keys:
67
+ - annotation.human.task_description
68
+ sin_cos_embedding_keys: null
69
+ state: !!python/object:gr00t.data.types.ModalityConfig
70
+ action_configs: null
71
+ delta_indices:
72
+ - 0
73
+ mean_std_embedding_keys: null
74
+ modality_keys:
75
+ - single_arm
76
+ - gripper
77
+ sin_cos_embedding_keys: null
78
+ video: !!python/object:gr00t.data.types.ModalityConfig
79
+ action_configs: null
80
+ delta_indices:
81
+ - 0
82
+ mean_std_embedding_keys: null
83
+ modality_keys:
84
+ - ego_view
85
+ - left_view
86
+ - right_view
87
+ sin_cos_embedding_keys: null
88
+ mode: single_turn
89
+ multiprocessing_context: fork
90
+ num_shards_per_epoch: 100000
91
+ override_pretraining_statistics: false
92
+ random_chop: 0.0
93
+ seed: 42
94
+ shard_size: 1024
95
+ shuffle: true
96
+ subsample_ratio: 1.0
97
+ video_backend: torchcodec
98
+ load_config_path: null
99
+ model: !!python/object:gr00t.configs.model.gr00t_n1d6.Gr00tN1d6Config
100
+ _attn_implementation_autoset: false
101
+ _attn_implementation_internal: null
102
+ _commit_hash: null
103
+ _name_or_path: ''
104
+ add_cross_attention: false
105
+ architectures: null
106
+ backbone_model_type: eagle
107
+ backbone_trainable_params_fp32: true
108
+ bad_words_ids: null
109
+ begin_suppress_tokens: null
110
+ bos_token_id: null
111
+ chunk_size_feed_forward: 0
112
+ color_jitter_params:
113
+ brightness: 0.3
114
+ contrast: 0.4
115
+ hue: 0.08
116
+ saturation: 0.5
117
+ cross_attention_hidden_size: null
118
+ decoder_start_token_id: null
119
+ diffusion_model_cfg:
120
+ attention_head_dim: 48
121
+ dropout: 0.2
122
+ final_dropout: true
123
+ interleave_self_attention: true
124
+ norm_type: ada_norm
125
+ num_attention_heads: 32
126
+ num_layers: 32
127
+ output_dim: 1024
128
+ positional_embeddings: null
129
+ diversity_penalty: 0.0
130
+ do_sample: false
131
+ eagle_collator: true
132
+ early_stopping: false
133
+ encoder_no_repeat_ngram_size: 0
134
+ eos_token_id: null
135
+ exponential_decay_length_penalty: null
136
+ finetuning_task: null
137
+ forced_bos_token_id: null
138
+ forced_eos_token_id: null
139
+ id2label:
140
+ 0: LABEL_0
141
+ 1: LABEL_1
142
+ is_decoder: false
143
+ is_encoder_decoder: false
144
+ label2id:
145
+ LABEL_0: 0
146
+ LABEL_1: 1
147
+ length_penalty: 1.0
148
+ load_bf16: false
149
+ max_length: 20
150
+ min_length: 0
151
+ model_name: nvidia/Eagle-Block2A-2B-v2
152
+ no_repeat_ngram_size: 0
153
+ num_beam_groups: 1
154
+ num_beams: 1
155
+ num_return_sequences: 1
156
+ output_attentions: false
157
+ output_hidden_states: false
158
+ output_scores: false
159
+ pad_token_id: null
160
+ prefix: null
161
+ problem_type: null
162
+ pruned_heads: {}
163
+ random_rotation_angle: null
164
+ remove_invalid_values: false
165
+ repetition_penalty: 1.0
166
+ reproject_vision: false
167
+ return_dict: true
168
+ return_dict_in_generate: false
169
+ sep_token_id: null
170
+ state_dropout_prob: 0.0
171
+ suppress_tokens: null
172
+ task_specific_params: null
173
+ temperature: 1.0
174
+ tf_legacy_loss: false
175
+ tie_encoder_decoder: false
176
+ tie_word_embeddings: true
177
+ tokenizer_class: null
178
+ top_k: 50
179
+ top_p: 1.0
180
+ torch_dtype: null
181
+ torchscript: false
182
+ transformers_version: null
183
+ tune_diffusion_model: true
184
+ tune_llm: false
185
+ tune_projector: true
186
+ tune_visual: false
187
+ typical_p: 1.0
188
+ use_bfloat16: false
189
+ use_relative_action: true
190
+ training: !!python/object:gr00t.configs.training.training_config.TrainingConfig
191
+ add_rl_callback: false
192
+ assert_loss_less_than: null
193
+ batch_size: null
194
+ bf16: true
195
+ dataloader_num_workers: 32
196
+ ddp_bucket_cap_mb: 100
197
+ deepspeed_stage: 2
198
+ enable_open_loop_eval: false
199
+ enable_profiling: false
200
+ eval_batch_size: 2
201
+ eval_bf16: true
202
+ eval_set_split_ratio: 0.1
203
+ eval_steps: 500
204
+ eval_strategy: 'no'
205
+ experiment_name: null
206
+ fp16: false
207
+ global_batch_size: 32
208
+ gradient_accumulation_steps: 1
209
+ gradient_checkpointing: false
210
+ learning_rate: 0.0001
211
+ logging_steps: 10
212
+ lr_scheduler_type: cosine
213
+ max_concurrent_uploads: 2
214
+ max_grad_norm: 1.0
215
+ max_retries: 3
216
+ max_steps: 10000
217
+ num_gpus: 4
218
+ open_loop_eval_plot_indices: null
219
+ open_loop_eval_steps_per_traj: 100
220
+ open_loop_eval_traj_ids:
221
+ - 0
222
+ optim: adamw_torch
223
+ output_dir: /workspaces/isaaclab_arena/models
224
+ remove_unused_columns: false
225
+ save_best_eval_metric_greater_is_better: true
226
+ save_best_eval_metric_name: ''
227
+ save_steps: 200
228
+ save_total_limit: 5
229
+ save_vl_model: false
230
+ start_from_checkpoint: nvidia/GR00T-N1.6-3B
231
+ tf32: true
232
+ transformers_access_token: null
233
+ transformers_cache_dir: null
234
+ transformers_local_files_only: false
235
+ transformers_trust_remote_code: true
236
+ upload_checkpoints: false
237
+ upload_every: 1000
238
+ upload_last_n_checkpoints: 5
239
+ use_ddp: false
240
+ use_wandb: true
241
+ wandb_project: finetune-gr00t-n1d6
242
+ warmup_ratio: 0.05
243
+ warmup_steps: 0
244
+ weight_decay: 1.0e-05
experiment_cfg/dataset_statistics.json ADDED
@@ -0,0 +1,1046 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "new_embodiment": {
3
+ "state": {
4
+ "single_arm": {
5
+ "min": [
6
+ -0.10585178434848785,
7
+ -1.4820414781570435,
8
+ -2.8973002433776855,
9
+ -3.0718090534210205,
10
+ -0.5827794075012207,
11
+ 0.5105782747268677,
12
+ -0.08852053433656693
13
+ ],
14
+ "max": [
15
+ 2.868842840194702,
16
+ 1.4677705764770508,
17
+ 0.31179291009902954,
18
+ -1.1280159950256348,
19
+ 0.7319774031639099,
20
+ 3.0557637214660645,
21
+ 1.9780731201171875
22
+ ],
23
+ "mean": [
24
+ 0.22983360290527344,
25
+ -0.688245415687561,
26
+ -0.30744367837905884,
27
+ -2.3262205123901367,
28
+ -0.12742096185684204,
29
+ 2.051501989364624,
30
+ 0.8900724053382874
31
+ ],
32
+ "std": [
33
+ 0.2312260866165161,
34
+ 0.36163097620010376,
35
+ 0.3226556181907654,
36
+ 0.4621410071849823,
37
+ 0.13340327143669128,
38
+ 0.6676610708236694,
39
+ 0.331983357667923
40
+ ],
41
+ "q01": [
42
+ -0.07056046731770038,
43
+ -1.3751703095436096,
44
+ -1.1829473924636842,
45
+ -2.876049301624298,
46
+ -0.46858262926340105,
47
+ 0.7588222640752792,
48
+ 0.30041238009929655
49
+ ],
50
+ "q99": [
51
+ 0.7168123406171805,
52
+ 0.08001862108707435,
53
+ 0.2015080998837948,
54
+ -1.1704320156574248,
55
+ 0.22084160149097443,
56
+ 2.967472722530365,
57
+ 1.6471182358264924
58
+ ]
59
+ },
60
+ "gripper": {
61
+ "min": [
62
+ 0.0020317176822572947,
63
+ 0.001846641767770052
64
+ ],
65
+ "max": [
66
+ 0.03999999910593033,
67
+ 0.03999999910593033
68
+ ],
69
+ "mean": [
70
+ 0.029287075623869896,
71
+ 0.029307108372449875
72
+ ],
73
+ "std": [
74
+ 0.0159694105386734,
75
+ 0.015958961099386215
76
+ ],
77
+ "q01": [
78
+ 0.002783102965913713,
79
+ 0.002801688495092094
80
+ ],
81
+ "q99": [
82
+ 0.03999999910593033,
83
+ 0.03999999910593033
84
+ ]
85
+ }
86
+ },
87
+ "action": {
88
+ "single_arm": {
89
+ "min": [
90
+ -0.3021092414855957,
91
+ -1.8116390705108643,
92
+ -4.104869365692139,
93
+ -3.249983549118042,
94
+ -0.7601099014282227,
95
+ 0.08673098683357239,
96
+ -0.37897980213165283
97
+ ],
98
+ "max": [
99
+ 4.587083339691162,
100
+ 1.6342649459838867,
101
+ 0.4067772626876831,
102
+ -0.5402984023094177,
103
+ 1.0283595323562622,
104
+ 3.2774882316589355,
105
+ 2.1884078979492188
106
+ ],
107
+ "mean": [
108
+ 0.24527984857559204,
109
+ -0.6943578720092773,
110
+ -0.30451175570487976,
111
+ -2.3437130451202393,
112
+ -0.13110630214214325,
113
+ 2.0647470951080322,
114
+ 0.9045398831367493
115
+ ],
116
+ "std": [
117
+ 0.255961537361145,
118
+ 0.40363916754722595,
119
+ 0.3533377945423126,
120
+ 0.4557691514492035,
121
+ 0.1536775678396225,
122
+ 0.6757283806800842,
123
+ 0.35488656163215637
124
+ ],
125
+ "q01": [
126
+ -0.08808465927839279,
127
+ -1.4722782373428345,
128
+ -1.2692882645130157,
129
+ -2.9259047293663025,
130
+ -0.49780495792627333,
131
+ 0.7401778894662857,
132
+ 0.2420878741145134
133
+ ],
134
+ "q99": [
135
+ 0.86079528450966,
136
+ 0.1582057143747808,
137
+ 0.251977399289608,
138
+ -1.1593033838272095,
139
+ 0.3293571025133144,
140
+ 3.044574635028839,
141
+ 1.720823279619217
142
+ ]
143
+ },
144
+ "gripper": {
145
+ "min": [
146
+ 0.0
147
+ ],
148
+ "max": [
149
+ 0.03999999910593033
150
+ ],
151
+ "mean": [
152
+ 0.028149358928203583
153
+ ],
154
+ "std": [
155
+ 0.018264442682266235
156
+ ],
157
+ "q01": [
158
+ 0.0
159
+ ],
160
+ "q99": [
161
+ 0.03999999910593033
162
+ ]
163
+ }
164
+ },
165
+ "relative_action": {
166
+ "single_arm": {
167
+ "min": [
168
+ [
169
+ -1.3799628019332886,
170
+ -0.846703827381134,
171
+ -2.5530529022216797,
172
+ -0.6990278959274292,
173
+ -0.7236334085464478,
174
+ -0.7074007987976074,
175
+ -0.6110000014305115
176
+ ],
177
+ [
178
+ -1.3839592933654785,
179
+ -0.8901764154434204,
180
+ -2.5966553688049316,
181
+ -0.704864501953125,
182
+ -0.7758755683898926,
183
+ -0.7596008777618408,
184
+ -0.6546932458877563
185
+ ],
186
+ [
187
+ -1.3854783773422241,
188
+ -0.9336205720901489,
189
+ -2.640198230743408,
190
+ -0.7093747854232788,
191
+ -0.8227287530899048,
192
+ -0.8116786479949951,
193
+ -0.6927764415740967
194
+ ],
195
+ [
196
+ -1.3836368322372437,
197
+ -0.977132260799408,
198
+ -2.683812141418457,
199
+ -0.7132972478866577,
200
+ -0.8571776747703552,
201
+ -0.8638787269592285,
202
+ -0.724608838558197
203
+ ],
204
+ [
205
+ -1.375198245048523,
206
+ -1.0207138061523438,
207
+ -2.727403402328491,
208
+ -0.7126319408416748,
209
+ -0.8606671094894409,
210
+ -0.9160792827606201,
211
+ -0.7249724864959717
212
+ ],
213
+ [
214
+ -1.3581116199493408,
215
+ -1.064221978187561,
216
+ -2.771050453186035,
217
+ -0.7117702960968018,
218
+ -0.8995289206504822,
219
+ -0.9682760238647461,
220
+ -0.7250082492828369
221
+ ],
222
+ [
223
+ -1.3482881784439087,
224
+ -1.1072661876678467,
225
+ -2.8145911693573,
226
+ -0.7129005193710327,
227
+ -0.9034186601638794,
228
+ -1.0203931331634521,
229
+ -0.7250344157218933
230
+ ],
231
+ [
232
+ -1.3369436264038086,
233
+ -1.1432496309280396,
234
+ -2.8581626415252686,
235
+ -0.7318893671035767,
236
+ -0.9344077110290527,
237
+ -1.0660440921783447,
238
+ -0.7429417371749878
239
+ ],
240
+ [
241
+ -1.3278416395187378,
242
+ -1.1847753524780273,
243
+ -2.9017910957336426,
244
+ -0.7744251489639282,
245
+ -0.9756299257278442,
246
+ -1.1081738471984863,
247
+ -0.7565152645111084
248
+ ],
249
+ [
250
+ -1.3209303617477417,
251
+ -1.2282776832580566,
252
+ -2.9453225135803223,
253
+ -0.8113338947296143,
254
+ -1.01007878780365,
255
+ -1.1416666507720947,
256
+ -0.7700652480125427
257
+ ],
258
+ [
259
+ -1.316198706626892,
260
+ -1.2717782258987427,
261
+ -2.981689453125,
262
+ -0.8384400606155396,
263
+ -1.0090559720993042,
264
+ -1.1768505573272705,
265
+ -0.7804306745529175
266
+ ],
267
+ [
268
+ -1.3137893676757812,
269
+ -1.3152940273284912,
270
+ -3.00955867767334,
271
+ -0.8819290399551392,
272
+ -1.0146688222885132,
273
+ -1.2041229009628296,
274
+ -0.7792332172393799
275
+ ],
276
+ [
277
+ -1.3064651489257812,
278
+ -1.358786940574646,
279
+ -3.0330066680908203,
280
+ -0.9245129823684692,
281
+ -1.0318551063537598,
282
+ -1.2158663272857666,
283
+ -0.778796911239624
284
+ ],
285
+ [
286
+ -1.3069504499435425,
287
+ -1.402289867401123,
288
+ -3.0418806076049805,
289
+ -0.9453524351119995,
290
+ -1.0474858283996582,
291
+ -1.239392638206482,
292
+ -0.7786667943000793
293
+ ],
294
+ [
295
+ -1.2948497533798218,
296
+ -1.4457826614379883,
297
+ -3.049644947052002,
298
+ -0.9705063104629517,
299
+ -1.0315730571746826,
300
+ -1.2627869844436646,
301
+ -0.7782648801803589
302
+ ],
303
+ [
304
+ -1.2816047668457031,
305
+ -1.4859166145324707,
306
+ -3.057337760925293,
307
+ -0.9996410608291626,
308
+ -1.010919451713562,
309
+ -1.285316824913025,
310
+ -0.793167233467102
311
+ ]
312
+ ],
313
+ "max": [
314
+ [
315
+ 2.567418336868286,
316
+ 0.7940642833709717,
317
+ 1.3483597040176392,
318
+ 0.5038654804229736,
319
+ 0.8064826130867004,
320
+ 0.42534810304641724,
321
+ 0.7363687753677368
322
+ ],
323
+ [
324
+ 2.6070313453674316,
325
+ 0.8375340700149536,
326
+ 1.3556522130966187,
327
+ 0.5470445156097412,
328
+ 0.8587763905525208,
329
+ 0.4535168409347534,
330
+ 0.7815820574760437
331
+ ],
332
+ [
333
+ 2.6480026245117188,
334
+ 0.8809951543807983,
335
+ 1.3603707551956177,
336
+ 0.5853910446166992,
337
+ 0.9099692702293396,
338
+ 0.4805412292480469,
339
+ 0.8328911066055298
340
+ ],
341
+ [
342
+ 2.6904377937316895,
343
+ 0.9244890213012695,
344
+ 1.3617339134216309,
345
+ 0.62050461769104,
346
+ 0.9537554383277893,
347
+ 0.5171980857849121,
348
+ 0.8850930333137512
349
+ ],
350
+ [
351
+ 2.733157157897949,
352
+ 0.9679925441741943,
353
+ 1.3563916683197021,
354
+ 0.653130054473877,
355
+ 0.9584329724311829,
356
+ 0.5527119636535645,
357
+ 0.9372936487197876
358
+ ],
359
+ [
360
+ 2.776454448699951,
361
+ 1.011548399925232,
362
+ 1.3423844575881958,
363
+ 0.7159806489944458,
364
+ 0.962762176990509,
365
+ 0.5780115127563477,
366
+ 0.9895003437995911
367
+ ],
368
+ [
369
+ 2.819460391998291,
370
+ 1.0550143718719482,
371
+ 1.3357713222503662,
372
+ 0.7591596841812134,
373
+ 0.967065691947937,
374
+ 0.6083757877349854,
375
+ 0.9970666170120239
376
+ ],
377
+ [
378
+ 2.862929582595825,
379
+ 1.098570466041565,
380
+ 1.3283271789550781,
381
+ 0.8227701187133789,
382
+ 1.0051043033599854,
383
+ 0.6292746067047119,
384
+ 1.0122740268707275
385
+ ],
386
+ [
387
+ 2.906933069229126,
388
+ 1.142111897468567,
389
+ 1.3234343528747559,
390
+ 0.9115495681762695,
391
+ 1.0388011932373047,
392
+ 0.6505081653594971,
393
+ 1.0234447717666626
394
+ ],
395
+ [
396
+ 2.9509470462799072,
397
+ 1.185598373413086,
398
+ 1.3211033344268799,
399
+ 0.9813358187675476,
400
+ 1.0714678764343262,
401
+ 0.6828610897064209,
402
+ 1.0570249557495117
403
+ ],
404
+ [
405
+ 2.9969143867492676,
406
+ 1.2272741794586182,
407
+ 1.3213672637939453,
408
+ 1.039294958114624,
409
+ 1.1007328033447266,
410
+ 0.7069540023803711,
411
+ 1.0594041347503662
412
+ ],
413
+ [
414
+ 3.0403480529785156,
415
+ 1.253152847290039,
416
+ 1.3244858980178833,
417
+ 1.1303977966308594,
418
+ 1.1028329133987427,
419
+ 0.7325007915496826,
420
+ 1.0783926248550415
421
+ ],
422
+ [
423
+ 3.0788755416870117,
424
+ 1.272753119468689,
425
+ 1.3235565423965454,
426
+ 1.1840159893035889,
427
+ 1.1049879789352417,
428
+ 0.7554268836975098,
429
+ 1.080771803855896
430
+ ],
431
+ [
432
+ 3.1056816577911377,
433
+ 1.2986316680908203,
434
+ 1.330661654472351,
435
+ 1.2504518032073975,
436
+ 1.108304738998413,
437
+ 0.7780568599700928,
438
+ 1.0822246074676514
439
+ ],
440
+ [
441
+ 3.13144850730896,
442
+ 1.3217449188232422,
443
+ 1.3251062631607056,
444
+ 1.3208149671554565,
445
+ 1.1107087135314941,
446
+ 0.8055588006973267,
447
+ 1.0833207368850708
448
+ ],
449
+ [
450
+ 3.156325578689575,
451
+ 1.3329780101776123,
452
+ 1.3181878328323364,
453
+ 1.4193122386932373,
454
+ 1.1303942203521729,
455
+ 0.8331756591796875,
456
+ 1.0827785730361938
457
+ ]
458
+ ],
459
+ "mean": [
460
+ [
461
+ 0.0162045881152153,
462
+ -0.01284683309495449,
463
+ 0.003098804736509919,
464
+ -0.03372170031070709,
465
+ -0.004505295772105455,
466
+ 0.021783702075481415,
467
+ 0.01521182619035244
468
+ ],
469
+ [
470
+ 0.017577122896909714,
471
+ -0.013530674390494823,
472
+ 0.003645440097898245,
473
+ -0.03580537065863609,
474
+ -0.004916673060506582,
475
+ 0.02341781184077263,
476
+ 0.016815518960356712
477
+ ],
478
+ [
479
+ 0.018947791308164597,
480
+ -0.014144103042781353,
481
+ 0.0042039500549435616,
482
+ -0.037736132740974426,
483
+ -0.005320144351571798,
484
+ 0.02498255856335163,
485
+ 0.018421174958348274
486
+ ],
487
+ [
488
+ 0.02031758800148964,
489
+ -0.014692251570522785,
490
+ 0.004773355089128017,
491
+ -0.03952430561184883,
492
+ -0.005717766005545855,
493
+ 0.026474300771951675,
494
+ 0.02003154158592224
495
+ ],
496
+ [
497
+ 0.02169603295624256,
498
+ -0.015192627906799316,
499
+ 0.005315880756825209,
500
+ -0.041174083948135376,
501
+ -0.0061398898251354694,
502
+ 0.027881216257810593,
503
+ 0.021609634160995483
504
+ ],
505
+ [
506
+ 0.023072782903909683,
507
+ -0.015621185302734375,
508
+ 0.0058733210898935795,
509
+ -0.04267120361328125,
510
+ -0.006557443644851446,
511
+ 0.02921134978532791,
512
+ 0.023191053420305252
513
+ ],
514
+ [
515
+ 0.02445853501558304,
516
+ -0.016012879088521004,
517
+ 0.006379991304129362,
518
+ -0.04403478652238846,
519
+ -0.007005136460065842,
520
+ 0.030454443767666817,
521
+ 0.0247166957706213
522
+ ],
523
+ [
524
+ 0.025841616094112396,
525
+ -0.0163332037627697,
526
+ 0.006896289065480232,
527
+ -0.04524318873882294,
528
+ -0.007450786419212818,
529
+ 0.0316125713288784,
530
+ 0.02624223567545414
531
+ ],
532
+ [
533
+ 0.027225056663155556,
534
+ -0.016576094552874565,
535
+ 0.0074104429222643375,
536
+ -0.04628229886293411,
537
+ -0.007899835705757141,
538
+ 0.03268665075302124,
539
+ 0.02776043862104416
540
+ ],
541
+ [
542
+ 0.02863071672618389,
543
+ -0.01684136874973774,
544
+ 0.007741305977106094,
545
+ -0.04724014550447464,
546
+ -0.008443175815045834,
547
+ 0.03367039933800697,
548
+ 0.029093485325574875
549
+ ],
550
+ [
551
+ 0.03001892939209938,
552
+ -0.01698327250778675,
553
+ 0.008157290518283844,
554
+ -0.04800064489245415,
555
+ -0.008937019854784012,
556
+ 0.03457446023821831,
557
+ 0.03048980049788952
558
+ ],
559
+ [
560
+ 0.03142230585217476,
561
+ -0.017429865896701813,
562
+ 0.008554172702133656,
563
+ -0.04909304529428482,
564
+ -0.009442312642931938,
565
+ 0.03550037741661072,
566
+ 0.031910303980112076
567
+ ],
568
+ [
569
+ 0.032860491424798965,
570
+ -0.017565155401825905,
571
+ 0.00891648605465889,
572
+ -0.049608033150434494,
573
+ -0.009951156564056873,
574
+ 0.03615717589855194,
575
+ 0.03330664336681366
576
+ ],
577
+ [
578
+ 0.03432377055287361,
579
+ -0.017927052453160286,
580
+ 0.00926224235445261,
581
+ -0.050526637583971024,
582
+ -0.010460241697728634,
583
+ 0.0369611456990242,
584
+ 0.03471340239048004
585
+ ],
586
+ [
587
+ 0.0357922725379467,
588
+ -0.0182654969394207,
589
+ 0.009601501747965813,
590
+ -0.051374953240156174,
591
+ -0.010974744334816933,
592
+ 0.03770560398697853,
593
+ 0.036107003688812256
594
+ ],
595
+ [
596
+ 0.03721015155315399,
597
+ -0.018647940829396248,
598
+ 0.010218545794487,
599
+ -0.052236221730709076,
600
+ -0.011343417689204216,
601
+ 0.038379695266485214,
602
+ 0.03776820749044418
603
+ ]
604
+ ],
605
+ "std": [
606
+ [
607
+ 0.09561787545681,
608
+ 0.1841392070055008,
609
+ 0.1230149194598198,
610
+ 0.1651013195514679,
611
+ 0.08265779167413712,
612
+ 0.20834241807460785,
613
+ 0.11478734016418457
614
+ ],
615
+ [
616
+ 0.10193362832069397,
617
+ 0.19995222985744476,
618
+ 0.13262243568897247,
619
+ 0.18077391386032104,
620
+ 0.08958185464143753,
621
+ 0.22795242071151733,
622
+ 0.1250300258398056
623
+ ],
624
+ [
625
+ 0.10761761665344238,
626
+ 0.21515797078609467,
627
+ 0.1417541801929474,
628
+ 0.19604629278182983,
629
+ 0.09583412855863571,
630
+ 0.24720466136932373,
631
+ 0.13476639986038208
632
+ ],
633
+ [
634
+ 0.11283185333013535,
635
+ 0.22989585995674133,
636
+ 0.1505030393600464,
637
+ 0.2110775262117386,
638
+ 0.10155555605888367,
639
+ 0.26614490151405334,
640
+ 0.14409737288951874
641
+ ],
642
+ [
643
+ 0.11775802075862885,
644
+ 0.2443120777606964,
645
+ 0.15899932384490967,
646
+ 0.22597895562648773,
647
+ 0.10690765827894211,
648
+ 0.2848511338233948,
649
+ 0.153147891163826
650
+ ],
651
+ [
652
+ 0.12265162914991379,
653
+ 0.2584792673587799,
654
+ 0.16736982762813568,
655
+ 0.2408720850944519,
656
+ 0.11210725456476212,
657
+ 0.3033398687839508,
658
+ 0.16198629140853882
659
+ ],
660
+ [
661
+ 0.1275392770767212,
662
+ 0.27235040068626404,
663
+ 0.17564959824085236,
664
+ 0.25575950741767883,
665
+ 0.11716651171445847,
666
+ 0.3216555714607239,
667
+ 0.1706080585718155
668
+ ],
669
+ [
670
+ 0.13233336806297302,
671
+ 0.2859433889389038,
672
+ 0.1838448941707611,
673
+ 0.2707005441188812,
674
+ 0.12200450152158737,
675
+ 0.33981001377105713,
676
+ 0.1790284812450409
677
+ ],
678
+ [
679
+ 0.13690054416656494,
680
+ 0.2992684543132782,
681
+ 0.1919122040271759,
682
+ 0.28575506806373596,
683
+ 0.12655234336853027,
684
+ 0.3577987253665924,
685
+ 0.18726085126399994
686
+ ],
687
+ [
688
+ 0.1411910057067871,
689
+ 0.3122430741786957,
690
+ 0.1998082548379898,
691
+ 0.3008229732513428,
692
+ 0.1307753324508667,
693
+ 0.3756433129310608,
694
+ 0.1953035145998001
695
+ ],
696
+ [
697
+ 0.14517177641391754,
698
+ 0.32497692108154297,
699
+ 0.20752082765102386,
700
+ 0.31603574752807617,
701
+ 0.1346835047006607,
702
+ 0.39332452416419983,
703
+ 0.2031596302986145
704
+ ],
705
+ [
706
+ 0.1488790065050125,
707
+ 0.33717432618141174,
708
+ 0.21507450938224792,
709
+ 0.33044007420539856,
710
+ 0.13834868371486664,
711
+ 0.41073474287986755,
712
+ 0.21088287234306335
713
+ ],
714
+ [
715
+ 0.15247905254364014,
716
+ 0.34908828139305115,
717
+ 0.22253793478012085,
718
+ 0.3444584906101227,
719
+ 0.1418810486793518,
720
+ 0.42792513966560364,
721
+ 0.218512162566185
722
+ ],
723
+ [
724
+ 0.1560245156288147,
725
+ 0.36060401797294617,
726
+ 0.22992275655269623,
727
+ 0.3577353358268738,
728
+ 0.14529705047607422,
729
+ 0.44483527541160583,
730
+ 0.22603793442249298
731
+ ],
732
+ [
733
+ 0.15951526165008545,
734
+ 0.37189415097236633,
735
+ 0.23725645244121552,
736
+ 0.371038019657135,
737
+ 0.14860472083091736,
738
+ 0.461593896150589,
739
+ 0.23349352180957794
740
+ ],
741
+ [
742
+ 0.1629764437675476,
743
+ 0.38295140862464905,
744
+ 0.2445494830608368,
745
+ 0.3841154873371124,
746
+ 0.15181609988212585,
747
+ 0.47810259461402893,
748
+ 0.24087539315223694
749
+ ]
750
+ ],
751
+ "q01": [
752
+ [
753
+ -0.19950662806630134,
754
+ -0.5267880302667618,
755
+ -0.2804043960571289,
756
+ -0.49720216274261475,
757
+ -0.24181631177663804,
758
+ -0.44567849397659304,
759
+ -0.25556061893701554
760
+ ],
761
+ [
762
+ -0.21852773502469064,
763
+ -0.5698291510343552,
764
+ -0.3015518325567246,
765
+ -0.5363495886325836,
766
+ -0.2647059428691864,
767
+ -0.48813892602920533,
768
+ -0.275542603135109
769
+ ],
770
+ [
771
+ -0.23660527691245078,
772
+ -0.6086035186052322,
773
+ -0.31789174526929853,
774
+ -0.5604154777526855,
775
+ -0.28393503457307817,
776
+ -0.5290071642398835,
777
+ -0.2913743835687637
778
+ ],
779
+ [
780
+ -0.24862138345837592,
781
+ -0.649602175951004,
782
+ -0.3364737406373024,
783
+ -0.5784401261806488,
784
+ -0.30646128237247466,
785
+ -0.5700734174251556,
786
+ -0.3095038095116615
787
+ ],
788
+ [
789
+ -0.26433300614356997,
790
+ -0.6882567131519318,
791
+ -0.352595399916172,
792
+ -0.5933414793014526,
793
+ -0.3249793803691864,
794
+ -0.6097909665107727,
795
+ -0.32609487652778624
796
+ ],
797
+ [
798
+ -0.27847526580095294,
799
+ -0.7230063188076019,
800
+ -0.3685854694247246,
801
+ -0.6150582671165467,
802
+ -0.33894465684890746,
803
+ -0.6511167442798614,
804
+ -0.33947302132844925
805
+ ],
806
+ [
807
+ -0.2881611752510071,
808
+ -0.7600984990596771,
809
+ -0.3851272436976433,
810
+ -0.6339384734630584,
811
+ -0.35804505556821825,
812
+ -0.6873469173908233,
813
+ -0.3513255763053894
814
+ ],
815
+ [
816
+ -0.29823750019073486,
817
+ -0.7952856153249741,
818
+ -0.40130406498909,
819
+ -0.6537419366836548,
820
+ -0.36884784877300264,
821
+ -0.7222859227657318,
822
+ -0.3663733446598053
823
+ ],
824
+ [
825
+ -0.3080375599861145,
826
+ -0.8278200089931488,
827
+ -0.4162969410419464,
828
+ -0.6719410765171051,
829
+ -0.3811878323554993,
830
+ -0.7592104160785675,
831
+ -0.3828606143593788
832
+ ],
833
+ [
834
+ -0.3192089283466339,
835
+ -0.8594429874420166,
836
+ -0.43057493746280673,
837
+ -0.6891207134723664,
838
+ -0.3899207302927971,
839
+ -0.7906776928901672,
840
+ -0.39594156324863433
841
+ ],
842
+ [
843
+ -0.3260902661085129,
844
+ -0.890479126572609,
845
+ -0.4381144392490387,
846
+ -0.713641117811203,
847
+ -0.4018076476454735,
848
+ -0.8239653241634369,
849
+ -0.40608411192893984
850
+ ],
851
+ [
852
+ -0.32998249888420106,
853
+ -0.9208912491798401,
854
+ -0.4485784482955933,
855
+ -0.7404101181030274,
856
+ -0.40892592787742615,
857
+ -0.8567238235473633,
858
+ -0.41712283045053483
859
+ ],
860
+ [
861
+ -0.337571017742157,
862
+ -0.9505359423160553,
863
+ -0.45878848373889924,
864
+ -0.7647261500358582,
865
+ -0.41907749682664874,
866
+ -0.8858703064918518,
867
+ -0.4311297929286957
868
+ ],
869
+ [
870
+ -0.344514417052269,
871
+ -0.978490937948227,
872
+ -0.4731087791919708,
873
+ -0.7942435812950134,
874
+ -0.42579659909009937,
875
+ -0.9157415616512299,
876
+ -0.4435725921392441
877
+ ],
878
+ [
879
+ -0.3521229174733162,
880
+ -1.0078155159950257,
881
+ -0.4874843668937683,
882
+ -0.8193191123008728,
883
+ -0.4365257340669632,
884
+ -0.9454274779558182,
885
+ -0.4541371762752533
886
+ ],
887
+ [
888
+ -0.35581389248371126,
889
+ -1.0338427817821503,
890
+ -0.5004701679944992,
891
+ -0.8494838178157806,
892
+ -0.442863190472126,
893
+ -0.9770041716098785,
894
+ -0.46435451209545137
895
+ ]
896
+ ],
897
+ "q99": [
898
+ [
899
+ 0.3228484025597576,
900
+ 0.40104085892438895,
901
+ 0.31244824022054674,
902
+ 0.2954720175266266,
903
+ 0.270292398929597,
904
+ 0.3568690168857576,
905
+ 0.32504342615604404
906
+ ],
907
+ [
908
+ 0.347237007021904,
909
+ 0.43345616728067404,
910
+ 0.3387280979752541,
911
+ 0.3265518689155581,
912
+ 0.2923547741770747,
913
+ 0.3882337927818299,
914
+ 0.35589420855045356
915
+ ],
916
+ [
917
+ 0.3646373689174653,
918
+ 0.46306476682424547,
919
+ 0.36461793124675757,
920
+ 0.3594550025463107,
921
+ 0.3067959910631185,
922
+ 0.41669229030609134,
923
+ 0.38290659368038193
924
+ ],
925
+ [
926
+ 0.3797282963991172,
927
+ 0.49183411687612544,
928
+ 0.3919186636805537,
929
+ 0.3934913563728333,
930
+ 0.32532002121210113,
931
+ 0.44333425402641313,
932
+ 0.41034477829933175
933
+ ],
934
+ [
935
+ 0.3966591441631323,
936
+ 0.5208547359704973,
937
+ 0.4143754762411119,
938
+ 0.42633920907974243,
939
+ 0.34047347754240076,
940
+ 0.4709657806158066,
941
+ 0.4371810677647591
942
+ ],
943
+ [
944
+ 0.4147697642445564,
945
+ 0.548696836233139,
946
+ 0.4355347976088526,
947
+ 0.459941817522049,
948
+ 0.3566160580515862,
949
+ 0.49860751807689674,
950
+ 0.4619476205110556
951
+ ],
952
+ [
953
+ 0.43306236445903784,
954
+ 0.5744219225645065,
955
+ 0.4582824614644051,
956
+ 0.49298112750053413,
957
+ 0.37070908635854743,
958
+ 0.5247364115715029,
959
+ 0.4946159166097642
960
+ ],
961
+ [
962
+ 0.4535762205719948,
963
+ 0.5974840182065965,
964
+ 0.4781889137625704,
965
+ 0.52674173116684,
966
+ 0.38307282924652125,
967
+ 0.551970843076706,
968
+ 0.5218617248535158
969
+ ],
970
+ [
971
+ 0.4752288824319842,
972
+ 0.6203914856910707,
973
+ 0.4968277835845948,
974
+ 0.563329246044159,
975
+ 0.3946968352794648,
976
+ 0.5789938712120056,
977
+ 0.5464925676584249
978
+ ],
979
+ [
980
+ 0.49233787536621126,
981
+ 0.6448995488882068,
982
+ 0.5179557728767397,
983
+ 0.5989310371875763,
984
+ 0.4044640159606941,
985
+ 0.6043756437301636,
986
+ 0.5733339744806294
987
+ ],
988
+ [
989
+ 0.5049607670307164,
990
+ 0.6641878437995912,
991
+ 0.5366499340534212,
992
+ 0.6363685309886934,
993
+ 0.4191509392857555,
994
+ 0.6278273916244507,
995
+ 0.5940367233753204
996
+ ],
997
+ [
998
+ 0.5195178943872457,
999
+ 0.6806331920623779,
1000
+ 0.5539186495542527,
1001
+ 0.6678686726093293,
1002
+ 0.4275676235556606,
1003
+ 0.652043970823288,
1004
+ 0.6186116337776186
1005
+ ],
1006
+ [
1007
+ 0.5356091660261156,
1008
+ 0.698597639799119,
1009
+ 0.571190173625946,
1010
+ 0.7009571266174317,
1011
+ 0.43485867321491284,
1012
+ 0.6771110093593598,
1013
+ 0.6389012908935552
1014
+ ],
1015
+ [
1016
+ 0.5494599288702018,
1017
+ 0.714040715694428,
1018
+ 0.5911411744356158,
1019
+ 0.7320740032196047,
1020
+ 0.44157062917947926,
1021
+ 0.7026675033569336,
1022
+ 0.6588078260421755
1023
+ ],
1024
+ [
1025
+ 0.5620473337173466,
1026
+ 0.7256977421045304,
1027
+ 0.6092195951938636,
1028
+ 0.7614367377758029,
1029
+ 0.446760193109514,
1030
+ 0.7281576597690583,
1031
+ 0.6745113229751587
1032
+ ],
1033
+ [
1034
+ 0.5714725697040565,
1035
+ 0.7397873222827912,
1036
+ 0.6257535284757625,
1037
+ 0.791651120185852,
1038
+ 0.4508011704683311,
1039
+ 0.752045361995697,
1040
+ 0.6951469552516938
1041
+ ]
1042
+ ]
1043
+ }
1044
+ }
1045
+ }
1046
+ }
experiment_cfg/final_model_config.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "Gr00tN1d6",
3
+ "model_dtype": "bfloat16",
4
+ "model_name": "nvidia/Eagle-Block2A-2B-v2",
5
+ "backbone_model_type": "eagle",
6
+ "model_revision": null,
7
+ "tune_top_llm_layers": 4,
8
+ "backbone_embedding_dim": 2048,
9
+ "tune_llm": false,
10
+ "tune_visual": false,
11
+ "select_layer": 16,
12
+ "reproject_vision": false,
13
+ "use_flash_attention": true,
14
+ "load_bf16": true,
15
+ "collator_overwrite_image_inputs": false,
16
+ "eagle_collator": true,
17
+ "backbone_trainable_params_fp32": true,
18
+ "apply_sincos_state_encoding": true,
19
+ "use_relative_action": true,
20
+ "max_state_dim": 128,
21
+ "max_action_dim": 128,
22
+ "action_horizon": 50,
23
+ "hidden_size": 1024,
24
+ "input_embedding_dim": 1536,
25
+ "add_pos_embed": true,
26
+ "attn_dropout": 0.2,
27
+ "use_vlln": true,
28
+ "max_seq_len": 1024,
29
+ "use_alternate_vl_dit": true,
30
+ "attend_text_every_n_blocks": 2,
31
+ "diffusion_model_cfg": {
32
+ "attention_head_dim": 48,
33
+ "dropout": 0.2,
34
+ "final_dropout": true,
35
+ "interleave_self_attention": true,
36
+ "norm_type": "ada_norm",
37
+ "num_attention_heads": 32,
38
+ "num_layers": 32,
39
+ "output_dim": 1024,
40
+ "positional_embeddings": null
41
+ },
42
+ "num_inference_timesteps": 4,
43
+ "noise_beta_alpha": 1.5,
44
+ "noise_beta_beta": 1.0,
45
+ "noise_s": 0.999,
46
+ "num_timestep_buckets": 1000,
47
+ "tune_projector": true,
48
+ "tune_diffusion_model": true,
49
+ "tune_vlln": true,
50
+ "state_dropout_prob": 0.0,
51
+ "state_additive_noise_scale": 0.0,
52
+ "max_num_embodiments": 32
53
+ }
experiment_cfg/final_processor_config.json ADDED
The diff for this file is too large to render. See raw diff
 
global_step1400/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:589b6f457eac67317b8b7c7fc62422099fbf157331f021eafe9545d1e3143c97
3
+ size 4859923697
global_step1400/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:014002cc4cef79ee278e33254f5b431a1b6d18429a7f4989fa397c994ca61fc2
3
+ size 4859923761
global_step1400/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c2402553b7ed20f37a005a525a0407293712e636d63bf84b2e8c3c7787373fc
3
+ size 4859923569
global_step1400/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64dd4b5b9ea05fcf557ba0d46d4c3b7645c79bbe49911782ec741aeffc378418
3
+ size 4859917873
global_step1400/mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf5695a3f780d71b3baf1d631d8eac8415b7063a6a3e0beec3bfc04324634a58
3
+ size 9907202435
latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step1400
model-00001-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f112a996275141637eab42270c2af08af50d50f2234e53119fcb4fa1306a70c2
3
+ size 4991091456
model-00002-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8a84d749fcfccf62bd1125c9b20eeefb8b945c141af77812302032b6a1966be
3
+ size 1582283096
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
processor_config.json ADDED
@@ -0,0 +1,456 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "processor_class": "Gr00tN1d6Processor",
3
+ "processor_kwargs": {
4
+ "modality_configs": {
5
+ "behavior_r1_pro": {
6
+ "video": {
7
+ "delta_indices": [
8
+ 0
9
+ ],
10
+ "modality_keys": [
11
+ "observation.images.rgb.head_256_256",
12
+ "observation.images.rgb.left_wrist_256_256",
13
+ "observation.images.rgb.right_wrist_256_256"
14
+ ],
15
+ "sin_cos_embedding_keys": null,
16
+ "mean_std_embedding_keys": null,
17
+ "action_configs": null
18
+ },
19
+ "state": {
20
+ "delta_indices": [
21
+ 0
22
+ ],
23
+ "modality_keys": [
24
+ "robot_pos",
25
+ "robot_ori_cos",
26
+ "robot_ori_sin",
27
+ "robot_2d_ori",
28
+ "robot_2d_ori_cos",
29
+ "robot_2d_ori_sin",
30
+ "robot_lin_vel",
31
+ "robot_ang_vel",
32
+ "arm_left_qpos",
33
+ "arm_left_qpos_sin",
34
+ "arm_left_qpos_cos",
35
+ "eef_left_pos",
36
+ "eef_left_quat",
37
+ "gripper_left_qpos",
38
+ "arm_right_qpos",
39
+ "arm_right_qpos_sin",
40
+ "arm_right_qpos_cos",
41
+ "eef_right_pos",
42
+ "eef_right_quat",
43
+ "gripper_right_qpos",
44
+ "trunk_qpos"
45
+ ],
46
+ "sin_cos_embedding_keys": null,
47
+ "mean_std_embedding_keys": null,
48
+ "action_configs": null
49
+ },
50
+ "action": {
51
+ "delta_indices": [
52
+ 0,
53
+ 1,
54
+ 2,
55
+ 3,
56
+ 4,
57
+ 5,
58
+ 6,
59
+ 7,
60
+ 8,
61
+ 9,
62
+ 10,
63
+ 11,
64
+ 12,
65
+ 13,
66
+ 14,
67
+ 15,
68
+ 16,
69
+ 17,
70
+ 18,
71
+ 19,
72
+ 20,
73
+ 21,
74
+ 22,
75
+ 23,
76
+ 24,
77
+ 25,
78
+ 26,
79
+ 27,
80
+ 28,
81
+ 29,
82
+ 30,
83
+ 31
84
+ ],
85
+ "modality_keys": [
86
+ "base",
87
+ "torso",
88
+ "left_arm",
89
+ "left_gripper",
90
+ "right_arm",
91
+ "right_gripper"
92
+ ],
93
+ "sin_cos_embedding_keys": null,
94
+ "mean_std_embedding_keys": null,
95
+ "action_configs": [
96
+ {
97
+ "rep": "ABSOLUTE",
98
+ "type": "NON_EEF",
99
+ "format": "DEFAULT",
100
+ "state_key": null
101
+ },
102
+ {
103
+ "rep": "RELATIVE",
104
+ "type": "NON_EEF",
105
+ "format": "DEFAULT",
106
+ "state_key": "trunk_qpos"
107
+ },
108
+ {
109
+ "rep": "RELATIVE",
110
+ "type": "NON_EEF",
111
+ "format": "DEFAULT",
112
+ "state_key": "arm_left_qpos"
113
+ },
114
+ {
115
+ "rep": "ABSOLUTE",
116
+ "type": "NON_EEF",
117
+ "format": "DEFAULT",
118
+ "state_key": null
119
+ },
120
+ {
121
+ "rep": "RELATIVE",
122
+ "type": "NON_EEF",
123
+ "format": "DEFAULT",
124
+ "state_key": "arm_right_qpos"
125
+ },
126
+ {
127
+ "rep": "ABSOLUTE",
128
+ "type": "NON_EEF",
129
+ "format": "DEFAULT",
130
+ "state_key": null
131
+ }
132
+ ]
133
+ },
134
+ "language": {
135
+ "delta_indices": [
136
+ 0
137
+ ],
138
+ "modality_keys": [
139
+ "annotation.human.coarse_action"
140
+ ],
141
+ "sin_cos_embedding_keys": null,
142
+ "mean_std_embedding_keys": null,
143
+ "action_configs": null
144
+ }
145
+ },
146
+ "gr1": {
147
+ "video": {
148
+ "delta_indices": [
149
+ 0
150
+ ],
151
+ "modality_keys": [
152
+ "ego_view_bg_crop_pad_res256_freq20"
153
+ ],
154
+ "sin_cos_embedding_keys": null,
155
+ "mean_std_embedding_keys": null,
156
+ "action_configs": null
157
+ },
158
+ "state": {
159
+ "delta_indices": [
160
+ 0
161
+ ],
162
+ "modality_keys": [
163
+ "left_arm",
164
+ "right_arm",
165
+ "left_hand",
166
+ "right_hand",
167
+ "waist"
168
+ ],
169
+ "sin_cos_embedding_keys": [
170
+ "left_arm",
171
+ "right_arm",
172
+ "left_hand",
173
+ "right_hand",
174
+ "waist"
175
+ ],
176
+ "mean_std_embedding_keys": null,
177
+ "action_configs": null
178
+ },
179
+ "action": {
180
+ "delta_indices": [
181
+ 0,
182
+ 1,
183
+ 2,
184
+ 3,
185
+ 4,
186
+ 5,
187
+ 6,
188
+ 7,
189
+ 8,
190
+ 9,
191
+ 10,
192
+ 11,
193
+ 12,
194
+ 13,
195
+ 14,
196
+ 15
197
+ ],
198
+ "modality_keys": [
199
+ "left_arm",
200
+ "right_arm",
201
+ "left_hand",
202
+ "right_hand",
203
+ "waist"
204
+ ],
205
+ "sin_cos_embedding_keys": null,
206
+ "mean_std_embedding_keys": null,
207
+ "action_configs": [
208
+ {
209
+ "rep": "RELATIVE",
210
+ "type": "NON_EEF",
211
+ "format": "DEFAULT",
212
+ "state_key": null
213
+ },
214
+ {
215
+ "rep": "RELATIVE",
216
+ "type": "NON_EEF",
217
+ "format": "DEFAULT",
218
+ "state_key": null
219
+ },
220
+ {
221
+ "rep": "RELATIVE",
222
+ "type": "NON_EEF",
223
+ "format": "DEFAULT",
224
+ "state_key": null
225
+ },
226
+ {
227
+ "rep": "RELATIVE",
228
+ "type": "NON_EEF",
229
+ "format": "DEFAULT",
230
+ "state_key": null
231
+ },
232
+ {
233
+ "rep": "ABSOLUTE",
234
+ "type": "NON_EEF",
235
+ "format": "DEFAULT",
236
+ "state_key": null
237
+ }
238
+ ]
239
+ },
240
+ "language": {
241
+ "delta_indices": [
242
+ 0
243
+ ],
244
+ "modality_keys": [
245
+ "task"
246
+ ],
247
+ "sin_cos_embedding_keys": null,
248
+ "mean_std_embedding_keys": null,
249
+ "action_configs": null
250
+ }
251
+ },
252
+ "robocasa_panda_omron": {
253
+ "video": {
254
+ "delta_indices": [
255
+ 0
256
+ ],
257
+ "modality_keys": [
258
+ "res256_image_side_0",
259
+ "res256_image_side_1",
260
+ "res256_image_wrist_0"
261
+ ],
262
+ "sin_cos_embedding_keys": null,
263
+ "mean_std_embedding_keys": null,
264
+ "action_configs": null
265
+ },
266
+ "state": {
267
+ "delta_indices": [
268
+ 0
269
+ ],
270
+ "modality_keys": [
271
+ "end_effector_position_relative",
272
+ "end_effector_rotation_relative",
273
+ "gripper_qpos",
274
+ "base_position",
275
+ "base_rotation"
276
+ ],
277
+ "sin_cos_embedding_keys": null,
278
+ "mean_std_embedding_keys": null,
279
+ "action_configs": null
280
+ },
281
+ "action": {
282
+ "delta_indices": [
283
+ 0,
284
+ 1,
285
+ 2,
286
+ 3,
287
+ 4,
288
+ 5,
289
+ 6,
290
+ 7,
291
+ 8,
292
+ 9,
293
+ 10,
294
+ 11,
295
+ 12,
296
+ 13,
297
+ 14,
298
+ 15
299
+ ],
300
+ "modality_keys": [
301
+ "end_effector_position",
302
+ "end_effector_rotation",
303
+ "gripper_close",
304
+ "base_motion",
305
+ "control_mode"
306
+ ],
307
+ "sin_cos_embedding_keys": null,
308
+ "mean_std_embedding_keys": null,
309
+ "action_configs": [
310
+ {
311
+ "rep": "ABSOLUTE",
312
+ "type": "NON_EEF",
313
+ "format": "DEFAULT",
314
+ "state_key": null
315
+ },
316
+ {
317
+ "rep": "ABSOLUTE",
318
+ "type": "NON_EEF",
319
+ "format": "DEFAULT",
320
+ "state_key": null
321
+ },
322
+ {
323
+ "rep": "ABSOLUTE",
324
+ "type": "NON_EEF",
325
+ "format": "DEFAULT",
326
+ "state_key": null
327
+ },
328
+ {
329
+ "rep": "ABSOLUTE",
330
+ "type": "NON_EEF",
331
+ "format": "DEFAULT",
332
+ "state_key": null
333
+ },
334
+ {
335
+ "rep": "ABSOLUTE",
336
+ "type": "NON_EEF",
337
+ "format": "DEFAULT",
338
+ "state_key": null
339
+ }
340
+ ]
341
+ },
342
+ "language": {
343
+ "delta_indices": [
344
+ 0
345
+ ],
346
+ "modality_keys": [
347
+ "annotation.human.action.task_description"
348
+ ],
349
+ "sin_cos_embedding_keys": null,
350
+ "mean_std_embedding_keys": null,
351
+ "action_configs": null
352
+ }
353
+ },
354
+ "new_embodiment": {
355
+ "video": {
356
+ "delta_indices": [
357
+ 0
358
+ ],
359
+ "modality_keys": [
360
+ "ego_view",
361
+ "left_view",
362
+ "right_view"
363
+ ],
364
+ "sin_cos_embedding_keys": null,
365
+ "mean_std_embedding_keys": null,
366
+ "action_configs": null
367
+ },
368
+ "state": {
369
+ "delta_indices": [
370
+ 0
371
+ ],
372
+ "modality_keys": [
373
+ "single_arm",
374
+ "gripper"
375
+ ],
376
+ "sin_cos_embedding_keys": null,
377
+ "mean_std_embedding_keys": null,
378
+ "action_configs": null
379
+ },
380
+ "action": {
381
+ "delta_indices": [
382
+ 0,
383
+ 1,
384
+ 2,
385
+ 3,
386
+ 4,
387
+ 5,
388
+ 6,
389
+ 7,
390
+ 8,
391
+ 9,
392
+ 10,
393
+ 11,
394
+ 12,
395
+ 13,
396
+ 14,
397
+ 15
398
+ ],
399
+ "modality_keys": [
400
+ "single_arm",
401
+ "gripper"
402
+ ],
403
+ "sin_cos_embedding_keys": null,
404
+ "mean_std_embedding_keys": null,
405
+ "action_configs": [
406
+ {
407
+ "rep": "RELATIVE",
408
+ "type": "NON_EEF",
409
+ "format": "DEFAULT",
410
+ "state_key": "single_arm"
411
+ },
412
+ {
413
+ "rep": "ABSOLUTE",
414
+ "type": "NON_EEF",
415
+ "format": "DEFAULT",
416
+ "state_key": null
417
+ }
418
+ ]
419
+ },
420
+ "language": {
421
+ "delta_indices": [
422
+ 0
423
+ ],
424
+ "modality_keys": [
425
+ "annotation.human.task_description"
426
+ ],
427
+ "sin_cos_embedding_keys": null,
428
+ "mean_std_embedding_keys": null,
429
+ "action_configs": null
430
+ }
431
+ }
432
+ },
433
+ "image_crop_size": null,
434
+ "image_target_size": null,
435
+ "use_albumentations": true,
436
+ "random_rotation_angle": null,
437
+ "color_jitter_params": {
438
+ "brightness": 0.3,
439
+ "contrast": 0.4,
440
+ "saturation": 0.5,
441
+ "hue": 0.08
442
+ },
443
+ "shortest_image_edge": 256,
444
+ "crop_fraction": 0.95,
445
+ "model_name": "nvidia/Eagle-Block2A-2B-v2",
446
+ "model_type": "eagle",
447
+ "formalize_language": true,
448
+ "max_state_dim": 128,
449
+ "max_action_dim": 128,
450
+ "max_action_horizon": 50,
451
+ "use_percentiles": false,
452
+ "clip_outliers": true,
453
+ "apply_sincos_state_encoding": true,
454
+ "use_relative_action": true
455
+ }
456
+ }
rng_state_0.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2ae8328bfcd9caec75ad95a65414ed5a7a5d05f86b2b7f2f1e3495ec4d581ac
3
+ size 15429
rng_state_1.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56bd7d3a38b53f9caefd474ef17181a618b190df886789a4373ee7200362df48
3
+ size 15429
rng_state_2.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:697208fba032129ad87ffe3d2cfd2cf533be72555f62540fee32fc497c2bb7c2
3
+ size 15429
rng_state_3.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7a2fbdaf7251212a443433f6341bc20f3ff551b7f5a81a040ed69ff94b7a461
3
+ size 15429
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01d5a4dee5b66e437551e6fb6cdd5404bad2ffd89d97f7b845865033e04f2cfd
3
+ size 1465
statistics.json ADDED
The diff for this file is too large to render. See raw diff
 
trainer_state.json ADDED
@@ -0,0 +1,874 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 0.14,
6
+ "eval_steps": 500,
7
+ "global_step": 1400,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "grad_norm": 2.7235865592956543,
14
+ "learning_rate": 1.8e-06,
15
+ "loss": 1.3062,
16
+ "step": 10
17
+ },
18
+ {
19
+ "grad_norm": 1.728572130203247,
20
+ "learning_rate": 3.8e-06,
21
+ "loss": 1.2836,
22
+ "step": 20
23
+ },
24
+ {
25
+ "grad_norm": 0.9103507995605469,
26
+ "learning_rate": 5.8e-06,
27
+ "loss": 1.2381,
28
+ "step": 30
29
+ },
30
+ {
31
+ "grad_norm": 0.5990565419197083,
32
+ "learning_rate": 7.8e-06,
33
+ "loss": 1.1586,
34
+ "step": 40
35
+ },
36
+ {
37
+ "grad_norm": 0.7476415634155273,
38
+ "learning_rate": 9.800000000000001e-06,
39
+ "loss": 1.1645,
40
+ "step": 50
41
+ },
42
+ {
43
+ "grad_norm": 0.779353141784668,
44
+ "learning_rate": 1.18e-05,
45
+ "loss": 1.1062,
46
+ "step": 60
47
+ },
48
+ {
49
+ "grad_norm": 1.5331050157546997,
50
+ "learning_rate": 1.3800000000000002e-05,
51
+ "loss": 1.0745,
52
+ "step": 70
53
+ },
54
+ {
55
+ "grad_norm": 0.8821016550064087,
56
+ "learning_rate": 1.58e-05,
57
+ "loss": 1.0459,
58
+ "step": 80
59
+ },
60
+ {
61
+ "grad_norm": 0.7069372534751892,
62
+ "learning_rate": 1.78e-05,
63
+ "loss": 1.0316,
64
+ "step": 90
65
+ },
66
+ {
67
+ "grad_norm": 0.8882275819778442,
68
+ "learning_rate": 1.9800000000000004e-05,
69
+ "loss": 1.0574,
70
+ "step": 100
71
+ },
72
+ {
73
+ "grad_norm": 0.7405692934989929,
74
+ "learning_rate": 2.18e-05,
75
+ "loss": 1.0404,
76
+ "step": 110
77
+ },
78
+ {
79
+ "grad_norm": 0.8989152908325195,
80
+ "learning_rate": 2.38e-05,
81
+ "loss": 1.0413,
82
+ "step": 120
83
+ },
84
+ {
85
+ "grad_norm": 0.7994363903999329,
86
+ "learning_rate": 2.58e-05,
87
+ "loss": 1.0046,
88
+ "step": 130
89
+ },
90
+ {
91
+ "grad_norm": 0.7832587361335754,
92
+ "learning_rate": 2.7800000000000005e-05,
93
+ "loss": 1.0432,
94
+ "step": 140
95
+ },
96
+ {
97
+ "grad_norm": 0.7279527187347412,
98
+ "learning_rate": 2.98e-05,
99
+ "loss": 1.0247,
100
+ "step": 150
101
+ },
102
+ {
103
+ "grad_norm": 0.5736011862754822,
104
+ "learning_rate": 3.18e-05,
105
+ "loss": 1.0226,
106
+ "step": 160
107
+ },
108
+ {
109
+ "grad_norm": 0.7875821590423584,
110
+ "learning_rate": 3.38e-05,
111
+ "loss": 1.0132,
112
+ "step": 170
113
+ },
114
+ {
115
+ "grad_norm": 1.9923306703567505,
116
+ "learning_rate": 3.58e-05,
117
+ "loss": 1.0068,
118
+ "step": 180
119
+ },
120
+ {
121
+ "grad_norm": 1.0174721479415894,
122
+ "learning_rate": 3.7800000000000004e-05,
123
+ "loss": 0.9882,
124
+ "step": 190
125
+ },
126
+ {
127
+ "grad_norm": 1.2093017101287842,
128
+ "learning_rate": 3.9800000000000005e-05,
129
+ "loss": 0.9596,
130
+ "step": 200
131
+ },
132
+ {
133
+ "grad_norm": 1.1982413530349731,
134
+ "learning_rate": 4.18e-05,
135
+ "loss": 0.9083,
136
+ "step": 210
137
+ },
138
+ {
139
+ "grad_norm": 1.0665863752365112,
140
+ "learning_rate": 4.38e-05,
141
+ "loss": 0.8807,
142
+ "step": 220
143
+ },
144
+ {
145
+ "grad_norm": 1.2544691562652588,
146
+ "learning_rate": 4.58e-05,
147
+ "loss": 0.839,
148
+ "step": 230
149
+ },
150
+ {
151
+ "grad_norm": 1.3970142602920532,
152
+ "learning_rate": 4.78e-05,
153
+ "loss": 0.8039,
154
+ "step": 240
155
+ },
156
+ {
157
+ "grad_norm": 1.375622034072876,
158
+ "learning_rate": 4.9800000000000004e-05,
159
+ "loss": 0.7449,
160
+ "step": 250
161
+ },
162
+ {
163
+ "grad_norm": 1.4242069721221924,
164
+ "learning_rate": 5.1800000000000005e-05,
165
+ "loss": 0.6853,
166
+ "step": 260
167
+ },
168
+ {
169
+ "grad_norm": 1.7568080425262451,
170
+ "learning_rate": 5.380000000000001e-05,
171
+ "loss": 0.6114,
172
+ "step": 270
173
+ },
174
+ {
175
+ "grad_norm": 2.0625576972961426,
176
+ "learning_rate": 5.580000000000001e-05,
177
+ "loss": 0.5084,
178
+ "step": 280
179
+ },
180
+ {
181
+ "grad_norm": 2.137798547744751,
182
+ "learning_rate": 5.7799999999999995e-05,
183
+ "loss": 0.4182,
184
+ "step": 290
185
+ },
186
+ {
187
+ "grad_norm": 1.4877147674560547,
188
+ "learning_rate": 5.9800000000000003e-05,
189
+ "loss": 0.3704,
190
+ "step": 300
191
+ },
192
+ {
193
+ "grad_norm": 1.568670630455017,
194
+ "learning_rate": 6.18e-05,
195
+ "loss": 0.3203,
196
+ "step": 310
197
+ },
198
+ {
199
+ "grad_norm": 1.2726070880889893,
200
+ "learning_rate": 6.38e-05,
201
+ "loss": 0.2442,
202
+ "step": 320
203
+ },
204
+ {
205
+ "grad_norm": 1.7254693508148193,
206
+ "learning_rate": 6.58e-05,
207
+ "loss": 0.226,
208
+ "step": 330
209
+ },
210
+ {
211
+ "grad_norm": 1.3184534311294556,
212
+ "learning_rate": 6.780000000000001e-05,
213
+ "loss": 0.179,
214
+ "step": 340
215
+ },
216
+ {
217
+ "grad_norm": 1.247791051864624,
218
+ "learning_rate": 6.98e-05,
219
+ "loss": 0.1607,
220
+ "step": 350
221
+ },
222
+ {
223
+ "grad_norm": 1.0366252660751343,
224
+ "learning_rate": 7.18e-05,
225
+ "loss": 0.1462,
226
+ "step": 360
227
+ },
228
+ {
229
+ "grad_norm": 1.5369986295700073,
230
+ "learning_rate": 7.38e-05,
231
+ "loss": 0.1731,
232
+ "step": 370
233
+ },
234
+ {
235
+ "grad_norm": 1.5386507511138916,
236
+ "learning_rate": 7.58e-05,
237
+ "loss": 0.169,
238
+ "step": 380
239
+ },
240
+ {
241
+ "grad_norm": 1.2936265468597412,
242
+ "learning_rate": 7.780000000000001e-05,
243
+ "loss": 0.1706,
244
+ "step": 390
245
+ },
246
+ {
247
+ "grad_norm": 1.420244574546814,
248
+ "learning_rate": 7.98e-05,
249
+ "loss": 0.1689,
250
+ "step": 400
251
+ },
252
+ {
253
+ "grad_norm": 1.0225824117660522,
254
+ "learning_rate": 8.18e-05,
255
+ "loss": 0.169,
256
+ "step": 410
257
+ },
258
+ {
259
+ "grad_norm": 0.8011528253555298,
260
+ "learning_rate": 8.38e-05,
261
+ "loss": 0.1387,
262
+ "step": 420
263
+ },
264
+ {
265
+ "grad_norm": 0.7911453247070312,
266
+ "learning_rate": 8.58e-05,
267
+ "loss": 0.1591,
268
+ "step": 430
269
+ },
270
+ {
271
+ "grad_norm": 0.9051388502120972,
272
+ "learning_rate": 8.78e-05,
273
+ "loss": 0.1456,
274
+ "step": 440
275
+ },
276
+ {
277
+ "grad_norm": 0.7053804397583008,
278
+ "learning_rate": 8.98e-05,
279
+ "loss": 0.1255,
280
+ "step": 450
281
+ },
282
+ {
283
+ "grad_norm": 1.1338269710540771,
284
+ "learning_rate": 9.180000000000001e-05,
285
+ "loss": 0.1367,
286
+ "step": 460
287
+ },
288
+ {
289
+ "grad_norm": 1.299891471862793,
290
+ "learning_rate": 9.38e-05,
291
+ "loss": 0.1254,
292
+ "step": 470
293
+ },
294
+ {
295
+ "grad_norm": 0.9713226556777954,
296
+ "learning_rate": 9.58e-05,
297
+ "loss": 0.13,
298
+ "step": 480
299
+ },
300
+ {
301
+ "grad_norm": 0.6963210701942444,
302
+ "learning_rate": 9.78e-05,
303
+ "loss": 0.1523,
304
+ "step": 490
305
+ },
306
+ {
307
+ "grad_norm": 0.9888042211532593,
308
+ "learning_rate": 9.98e-05,
309
+ "loss": 0.1221,
310
+ "step": 500
311
+ },
312
+ {
313
+ "grad_norm": 0.7608430981636047,
314
+ "learning_rate": 9.9999778549206e-05,
315
+ "loss": 0.1271,
316
+ "step": 510
317
+ },
318
+ {
319
+ "grad_norm": 1.088894248008728,
320
+ "learning_rate": 9.999901304280685e-05,
321
+ "loss": 0.1448,
322
+ "step": 520
323
+ },
324
+ {
325
+ "grad_norm": 0.7456501126289368,
326
+ "learning_rate": 9.999770075521164e-05,
327
+ "loss": 0.1395,
328
+ "step": 530
329
+ },
330
+ {
331
+ "grad_norm": 0.6787962317466736,
332
+ "learning_rate": 9.99958417007713e-05,
333
+ "loss": 0.1083,
334
+ "step": 540
335
+ },
336
+ {
337
+ "grad_norm": 0.7639486193656921,
338
+ "learning_rate": 9.999343589981615e-05,
339
+ "loss": 0.151,
340
+ "step": 550
341
+ },
342
+ {
343
+ "grad_norm": 0.7701183557510376,
344
+ "learning_rate": 9.999048337865568e-05,
345
+ "loss": 0.1162,
346
+ "step": 560
347
+ },
348
+ {
349
+ "grad_norm": 0.7873595356941223,
350
+ "learning_rate": 9.998698416957815e-05,
351
+ "loss": 0.1055,
352
+ "step": 570
353
+ },
354
+ {
355
+ "grad_norm": 0.5775970220565796,
356
+ "learning_rate": 9.998293831085037e-05,
357
+ "loss": 0.0935,
358
+ "step": 580
359
+ },
360
+ {
361
+ "grad_norm": 0.6811988353729248,
362
+ "learning_rate": 9.997834584671719e-05,
363
+ "loss": 0.1106,
364
+ "step": 590
365
+ },
366
+ {
367
+ "grad_norm": 0.8140270113945007,
368
+ "learning_rate": 9.997320682740107e-05,
369
+ "loss": 0.1104,
370
+ "step": 600
371
+ },
372
+ {
373
+ "grad_norm": 0.7332885265350342,
374
+ "learning_rate": 9.996752130910149e-05,
375
+ "loss": 0.0995,
376
+ "step": 610
377
+ },
378
+ {
379
+ "grad_norm": 0.8294130563735962,
380
+ "learning_rate": 9.99612893539944e-05,
381
+ "loss": 0.112,
382
+ "step": 620
383
+ },
384
+ {
385
+ "grad_norm": 0.8760542869567871,
386
+ "learning_rate": 9.995451103023144e-05,
387
+ "loss": 0.1088,
388
+ "step": 630
389
+ },
390
+ {
391
+ "grad_norm": 0.666292130947113,
392
+ "learning_rate": 9.994718641193928e-05,
393
+ "loss": 0.1078,
394
+ "step": 640
395
+ },
396
+ {
397
+ "grad_norm": 0.6352424025535583,
398
+ "learning_rate": 9.993931557921874e-05,
399
+ "loss": 0.1002,
400
+ "step": 650
401
+ },
402
+ {
403
+ "grad_norm": 0.6974917650222778,
404
+ "learning_rate": 9.993089861814402e-05,
405
+ "loss": 0.129,
406
+ "step": 660
407
+ },
408
+ {
409
+ "grad_norm": 0.8117634057998657,
410
+ "learning_rate": 9.992193562076166e-05,
411
+ "loss": 0.0894,
412
+ "step": 670
413
+ },
414
+ {
415
+ "grad_norm": 0.6594702005386353,
416
+ "learning_rate": 9.991242668508954e-05,
417
+ "loss": 0.1132,
418
+ "step": 680
419
+ },
420
+ {
421
+ "grad_norm": 0.6721746921539307,
422
+ "learning_rate": 9.990237191511587e-05,
423
+ "loss": 0.0971,
424
+ "step": 690
425
+ },
426
+ {
427
+ "grad_norm": 0.6974657773971558,
428
+ "learning_rate": 9.989177142079802e-05,
429
+ "loss": 0.1038,
430
+ "step": 700
431
+ },
432
+ {
433
+ "grad_norm": 0.6547107696533203,
434
+ "learning_rate": 9.988062531806126e-05,
435
+ "loss": 0.0993,
436
+ "step": 710
437
+ },
438
+ {
439
+ "grad_norm": 0.5421633720397949,
440
+ "learning_rate": 9.986893372879762e-05,
441
+ "loss": 0.1023,
442
+ "step": 720
443
+ },
444
+ {
445
+ "grad_norm": 0.5468288660049438,
446
+ "learning_rate": 9.985669678086443e-05,
447
+ "loss": 0.1001,
448
+ "step": 730
449
+ },
450
+ {
451
+ "grad_norm": 0.702468991279602,
452
+ "learning_rate": 9.984391460808298e-05,
453
+ "loss": 0.0896,
454
+ "step": 740
455
+ },
456
+ {
457
+ "grad_norm": 0.6491390466690063,
458
+ "learning_rate": 9.983058735023709e-05,
459
+ "loss": 0.1026,
460
+ "step": 750
461
+ },
462
+ {
463
+ "grad_norm": 0.5702087879180908,
464
+ "learning_rate": 9.98167151530715e-05,
465
+ "loss": 0.1,
466
+ "step": 760
467
+ },
468
+ {
469
+ "grad_norm": 0.5395886301994324,
470
+ "learning_rate": 9.980229816829034e-05,
471
+ "loss": 0.0921,
472
+ "step": 770
473
+ },
474
+ {
475
+ "grad_norm": 0.7115892767906189,
476
+ "learning_rate": 9.978733655355544e-05,
477
+ "loss": 0.1247,
478
+ "step": 780
479
+ },
480
+ {
481
+ "grad_norm": 0.5494698286056519,
482
+ "learning_rate": 9.977183047248464e-05,
483
+ "loss": 0.0917,
484
+ "step": 790
485
+ },
486
+ {
487
+ "grad_norm": 0.543135941028595,
488
+ "learning_rate": 9.975578009464992e-05,
489
+ "loss": 0.0863,
490
+ "step": 800
491
+ },
492
+ {
493
+ "grad_norm": 0.5769555568695068,
494
+ "learning_rate": 9.97391855955757e-05,
495
+ "loss": 0.0904,
496
+ "step": 810
497
+ },
498
+ {
499
+ "grad_norm": 0.8262929320335388,
500
+ "learning_rate": 9.972204715673669e-05,
501
+ "loss": 0.0851,
502
+ "step": 820
503
+ },
504
+ {
505
+ "grad_norm": 0.5591674447059631,
506
+ "learning_rate": 9.970436496555617e-05,
507
+ "loss": 0.1025,
508
+ "step": 830
509
+ },
510
+ {
511
+ "grad_norm": 0.5183696746826172,
512
+ "learning_rate": 9.968613921540373e-05,
513
+ "loss": 0.0941,
514
+ "step": 840
515
+ },
516
+ {
517
+ "grad_norm": 0.5633620023727417,
518
+ "learning_rate": 9.966737010559326e-05,
519
+ "loss": 0.0963,
520
+ "step": 850
521
+ },
522
+ {
523
+ "grad_norm": 0.6012111306190491,
524
+ "learning_rate": 9.964805784138072e-05,
525
+ "loss": 0.0751,
526
+ "step": 860
527
+ },
528
+ {
529
+ "grad_norm": 0.7718893885612488,
530
+ "learning_rate": 9.962820263396195e-05,
531
+ "loss": 0.1002,
532
+ "step": 870
533
+ },
534
+ {
535
+ "grad_norm": 0.43630078434944153,
536
+ "learning_rate": 9.960780470047033e-05,
537
+ "loss": 0.0739,
538
+ "step": 880
539
+ },
540
+ {
541
+ "grad_norm": 0.4448564052581787,
542
+ "learning_rate": 9.958686426397437e-05,
543
+ "loss": 0.0771,
544
+ "step": 890
545
+ },
546
+ {
547
+ "grad_norm": 0.47105884552001953,
548
+ "learning_rate": 9.956538155347534e-05,
549
+ "loss": 0.0833,
550
+ "step": 900
551
+ },
552
+ {
553
+ "grad_norm": 0.7328141927719116,
554
+ "learning_rate": 9.95433568039047e-05,
555
+ "loss": 0.0841,
556
+ "step": 910
557
+ },
558
+ {
559
+ "grad_norm": 0.45969247817993164,
560
+ "learning_rate": 9.952079025612162e-05,
561
+ "loss": 0.0719,
562
+ "step": 920
563
+ },
564
+ {
565
+ "grad_norm": 0.5842729210853577,
566
+ "learning_rate": 9.949768215691022e-05,
567
+ "loss": 0.0833,
568
+ "step": 930
569
+ },
570
+ {
571
+ "grad_norm": 0.6713224649429321,
572
+ "learning_rate": 9.9474032758977e-05,
573
+ "loss": 0.0975,
574
+ "step": 940
575
+ },
576
+ {
577
+ "grad_norm": 0.40328073501586914,
578
+ "learning_rate": 9.944984232094794e-05,
579
+ "loss": 0.0768,
580
+ "step": 950
581
+ },
582
+ {
583
+ "grad_norm": 0.4870326519012451,
584
+ "learning_rate": 9.942511110736584e-05,
585
+ "loss": 0.0797,
586
+ "step": 960
587
+ },
588
+ {
589
+ "grad_norm": 0.46975821256637573,
590
+ "learning_rate": 9.939983938868726e-05,
591
+ "loss": 0.1042,
592
+ "step": 970
593
+ },
594
+ {
595
+ "grad_norm": 0.4261704385280609,
596
+ "learning_rate": 9.93740274412797e-05,
597
+ "loss": 0.0757,
598
+ "step": 980
599
+ },
600
+ {
601
+ "grad_norm": 0.49296048283576965,
602
+ "learning_rate": 9.934767554741846e-05,
603
+ "loss": 0.07,
604
+ "step": 990
605
+ },
606
+ {
607
+ "grad_norm": 0.700587809085846,
608
+ "learning_rate": 9.932078399528361e-05,
609
+ "loss": 0.0773,
610
+ "step": 1000
611
+ },
612
+ {
613
+ "grad_norm": 0.48134827613830566,
614
+ "learning_rate": 9.929335307895689e-05,
615
+ "loss": 0.0712,
616
+ "step": 1010
617
+ },
618
+ {
619
+ "grad_norm": 0.48594099283218384,
620
+ "learning_rate": 9.926538309841839e-05,
621
+ "loss": 0.0887,
622
+ "step": 1020
623
+ },
624
+ {
625
+ "grad_norm": 0.6529817581176758,
626
+ "learning_rate": 9.923687435954334e-05,
627
+ "loss": 0.071,
628
+ "step": 1030
629
+ },
630
+ {
631
+ "grad_norm": 0.43099382519721985,
632
+ "learning_rate": 9.920782717409873e-05,
633
+ "loss": 0.0685,
634
+ "step": 1040
635
+ },
636
+ {
637
+ "grad_norm": 0.5061713457107544,
638
+ "learning_rate": 9.917824185973994e-05,
639
+ "loss": 0.0813,
640
+ "step": 1050
641
+ },
642
+ {
643
+ "grad_norm": 0.49007850885391235,
644
+ "learning_rate": 9.914811874000723e-05,
645
+ "loss": 0.0863,
646
+ "step": 1060
647
+ },
648
+ {
649
+ "grad_norm": 0.7527875900268555,
650
+ "learning_rate": 9.911745814432218e-05,
651
+ "loss": 0.0942,
652
+ "step": 1070
653
+ },
654
+ {
655
+ "grad_norm": 0.6349867582321167,
656
+ "learning_rate": 9.90862604079842e-05,
657
+ "loss": 0.0966,
658
+ "step": 1080
659
+ },
660
+ {
661
+ "grad_norm": 0.505797266960144,
662
+ "learning_rate": 9.90545258721667e-05,
663
+ "loss": 0.0783,
664
+ "step": 1090
665
+ },
666
+ {
667
+ "grad_norm": 0.7068039774894714,
668
+ "learning_rate": 9.90222548839135e-05,
669
+ "loss": 0.0747,
670
+ "step": 1100
671
+ },
672
+ {
673
+ "grad_norm": 0.4806417226791382,
674
+ "learning_rate": 9.898944779613495e-05,
675
+ "loss": 0.0969,
676
+ "step": 1110
677
+ },
678
+ {
679
+ "grad_norm": 0.5106626152992249,
680
+ "learning_rate": 9.89561049676041e-05,
681
+ "loss": 0.068,
682
+ "step": 1120
683
+ },
684
+ {
685
+ "grad_norm": 0.4418148994445801,
686
+ "learning_rate": 9.89222267629528e-05,
687
+ "loss": 0.0833,
688
+ "step": 1130
689
+ },
690
+ {
691
+ "grad_norm": 0.8706759810447693,
692
+ "learning_rate": 9.888781355266763e-05,
693
+ "loss": 0.107,
694
+ "step": 1140
695
+ },
696
+ {
697
+ "grad_norm": 0.5463252067565918,
698
+ "learning_rate": 9.885286571308598e-05,
699
+ "loss": 0.0902,
700
+ "step": 1150
701
+ },
702
+ {
703
+ "grad_norm": 0.3997989892959595,
704
+ "learning_rate": 9.881738362639182e-05,
705
+ "loss": 0.0878,
706
+ "step": 1160
707
+ },
708
+ {
709
+ "grad_norm": 0.46273931860923767,
710
+ "learning_rate": 9.878136768061154e-05,
711
+ "loss": 0.0846,
712
+ "step": 1170
713
+ },
714
+ {
715
+ "grad_norm": 0.5125852227210999,
716
+ "learning_rate": 9.874481826960979e-05,
717
+ "loss": 0.063,
718
+ "step": 1180
719
+ },
720
+ {
721
+ "grad_norm": 0.5445611476898193,
722
+ "learning_rate": 9.870773579308503e-05,
723
+ "loss": 0.0753,
724
+ "step": 1190
725
+ },
726
+ {
727
+ "grad_norm": 0.6660953760147095,
728
+ "learning_rate": 9.867012065656533e-05,
729
+ "loss": 0.0844,
730
+ "step": 1200
731
+ },
732
+ {
733
+ "grad_norm": 0.750414252281189,
734
+ "learning_rate": 9.863197327140376e-05,
735
+ "loss": 0.0946,
736
+ "step": 1210
737
+ },
738
+ {
739
+ "grad_norm": 0.6888939738273621,
740
+ "learning_rate": 9.859329405477403e-05,
741
+ "loss": 0.0792,
742
+ "step": 1220
743
+ },
744
+ {
745
+ "grad_norm": 0.47912099957466125,
746
+ "learning_rate": 9.855408342966585e-05,
747
+ "loss": 0.0813,
748
+ "step": 1230
749
+ },
750
+ {
751
+ "grad_norm": 0.36273863911628723,
752
+ "learning_rate": 9.851434182488033e-05,
753
+ "loss": 0.0791,
754
+ "step": 1240
755
+ },
756
+ {
757
+ "grad_norm": 0.6081685423851013,
758
+ "learning_rate": 9.84740696750253e-05,
759
+ "loss": 0.0687,
760
+ "step": 1250
761
+ },
762
+ {
763
+ "grad_norm": 0.4913078248500824,
764
+ "learning_rate": 9.843326742051055e-05,
765
+ "loss": 0.0788,
766
+ "step": 1260
767
+ },
768
+ {
769
+ "grad_norm": 0.5190815925598145,
770
+ "learning_rate": 9.839193550754297e-05,
771
+ "loss": 0.0606,
772
+ "step": 1270
773
+ },
774
+ {
775
+ "grad_norm": 0.35437485575675964,
776
+ "learning_rate": 9.835007438812177e-05,
777
+ "loss": 0.0743,
778
+ "step": 1280
779
+ },
780
+ {
781
+ "grad_norm": 0.39313238859176636,
782
+ "learning_rate": 9.830768452003341e-05,
783
+ "loss": 0.076,
784
+ "step": 1290
785
+ },
786
+ {
787
+ "grad_norm": 0.41886866092681885,
788
+ "learning_rate": 9.826476636684671e-05,
789
+ "loss": 0.0759,
790
+ "step": 1300
791
+ },
792
+ {
793
+ "grad_norm": 0.541922926902771,
794
+ "learning_rate": 9.822132039790773e-05,
795
+ "loss": 0.074,
796
+ "step": 1310
797
+ },
798
+ {
799
+ "grad_norm": 0.595855176448822,
800
+ "learning_rate": 9.817734708833461e-05,
801
+ "loss": 0.0819,
802
+ "step": 1320
803
+ },
804
+ {
805
+ "grad_norm": 0.4398232698440552,
806
+ "learning_rate": 9.813284691901243e-05,
807
+ "loss": 0.0591,
808
+ "step": 1330
809
+ },
810
+ {
811
+ "grad_norm": 0.4390011727809906,
812
+ "learning_rate": 9.808782037658792e-05,
813
+ "loss": 0.0582,
814
+ "step": 1340
815
+ },
816
+ {
817
+ "grad_norm": 0.6022183299064636,
818
+ "learning_rate": 9.804226795346411e-05,
819
+ "loss": 0.0868,
820
+ "step": 1350
821
+ },
822
+ {
823
+ "grad_norm": 0.6155015826225281,
824
+ "learning_rate": 9.799619014779503e-05,
825
+ "loss": 0.0823,
826
+ "step": 1360
827
+ },
828
+ {
829
+ "grad_norm": 0.6430284976959229,
830
+ "learning_rate": 9.794958746348013e-05,
831
+ "loss": 0.0624,
832
+ "step": 1370
833
+ },
834
+ {
835
+ "grad_norm": 0.46535441279411316,
836
+ "learning_rate": 9.790246041015896e-05,
837
+ "loss": 0.0621,
838
+ "step": 1380
839
+ },
840
+ {
841
+ "grad_norm": 0.41016414761543274,
842
+ "learning_rate": 9.785480950320538e-05,
843
+ "loss": 0.0729,
844
+ "step": 1390
845
+ },
846
+ {
847
+ "grad_norm": 0.48556017875671387,
848
+ "learning_rate": 9.78066352637221e-05,
849
+ "loss": 0.0603,
850
+ "step": 1400
851
+ }
852
+ ],
853
+ "logging_steps": 10,
854
+ "max_steps": 10000,
855
+ "num_input_tokens_seen": 0,
856
+ "num_train_epochs": 9223372036854775807,
857
+ "save_steps": 200,
858
+ "stateful_callbacks": {
859
+ "TrainerControl": {
860
+ "args": {
861
+ "should_epoch_stop": false,
862
+ "should_evaluate": false,
863
+ "should_log": false,
864
+ "should_save": true,
865
+ "should_training_stop": false
866
+ },
867
+ "attributes": {}
868
+ }
869
+ },
870
+ "total_flos": 0.0,
871
+ "train_batch_size": 8,
872
+ "trial_name": null,
873
+ "trial_params": null
874
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:782285ad74aaef2aad4e3e5daa440fd31ceb61526953366bc68d03be12e58f0b
3
+ size 7633
wandb_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"project": "finetune-gr00t-n1d6", "run_id": "models"}
zero_to_fp32.py ADDED
@@ -0,0 +1,760 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) Microsoft Corporation.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ # DeepSpeed Team
7
+
8
+ # This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
9
+ # copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
10
+ # the future. Once extracted, the weights don't require DeepSpeed and can be used in any
11
+ # application.
12
+ #
13
+ # example:
14
+ # python zero_to_fp32.py . output_dir/
15
+ # or
16
+ # python zero_to_fp32.py . output_dir/ --safe_serialization
17
+
18
+ import argparse
19
+ import torch
20
+ import glob
21
+ import math
22
+ import os
23
+ import re
24
+ import gc
25
+ import json
26
+ import numpy as np
27
+ from tqdm import tqdm
28
+ from collections import OrderedDict
29
+ from dataclasses import dataclass
30
+
31
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
32
+ # DeepSpeed data structures it has to be available in the current python environment.
33
+ from deepspeed.utils import logger
34
+ from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
35
+ FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
36
+ FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
37
+
38
+
39
+ @dataclass
40
+ class zero_model_state:
41
+ buffers: dict()
42
+ param_shapes: dict()
43
+ shared_params: list
44
+ ds_version: int
45
+ frozen_param_shapes: dict()
46
+ frozen_param_fragments: dict()
47
+
48
+
49
+ debug = 0
50
+
51
+ # load to cpu
52
+ device = torch.device('cpu')
53
+
54
+
55
+ def atoi(text):
56
+ return int(text) if text.isdigit() else text
57
+
58
+
59
+ def natural_keys(text):
60
+ '''
61
+ alist.sort(key=natural_keys) sorts in human order
62
+ http://nedbatchelder.com/blog/200712/human_sorting.html
63
+ (See Toothy's implementation in the comments)
64
+ '''
65
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
66
+
67
+
68
+ def get_model_state_file(checkpoint_dir, zero_stage):
69
+ if not os.path.isdir(checkpoint_dir):
70
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
71
+
72
+ # there should be only one file
73
+ if zero_stage <= 2:
74
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
75
+ elif zero_stage == 3:
76
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
77
+
78
+ if not os.path.exists(file):
79
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
80
+
81
+ return file
82
+
83
+
84
+ def get_checkpoint_files(checkpoint_dir, glob_pattern):
85
+ # XXX: need to test that this simple glob rule works for multi-node setup too
86
+ ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
87
+
88
+ if len(ckpt_files) == 0:
89
+ raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
90
+
91
+ return ckpt_files
92
+
93
+
94
+ def get_optim_files(checkpoint_dir):
95
+ return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
96
+
97
+
98
+ def get_model_state_files(checkpoint_dir):
99
+ return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
100
+
101
+
102
+ def parse_model_states(files):
103
+ zero_model_states = []
104
+ for file in files:
105
+ state_dict = torch.load(file, map_location=device, weights_only=False)
106
+
107
+ if BUFFER_NAMES not in state_dict:
108
+ raise ValueError(f"{file} is not a model state checkpoint")
109
+ buffer_names = state_dict[BUFFER_NAMES]
110
+ if debug:
111
+ print("Found buffers:", buffer_names)
112
+
113
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
114
+ buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
115
+ param_shapes = state_dict[PARAM_SHAPES]
116
+
117
+ # collect parameters that are included in param_shapes
118
+ param_names = []
119
+ for s in param_shapes:
120
+ for name in s.keys():
121
+ param_names.append(name)
122
+
123
+ # update with frozen parameters
124
+ frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
125
+ if frozen_param_shapes is not None:
126
+ if debug:
127
+ print(f"Found frozen_param_shapes: {frozen_param_shapes}")
128
+ param_names += list(frozen_param_shapes.keys())
129
+
130
+ # handle shared params
131
+ shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
132
+
133
+ ds_version = state_dict.get(DS_VERSION, None)
134
+
135
+ frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
136
+
137
+ z_model_state = zero_model_state(buffers=buffers,
138
+ param_shapes=param_shapes,
139
+ shared_params=shared_params,
140
+ ds_version=ds_version,
141
+ frozen_param_shapes=frozen_param_shapes,
142
+ frozen_param_fragments=frozen_param_fragments)
143
+ zero_model_states.append(z_model_state)
144
+
145
+ return zero_model_states
146
+
147
+
148
+ def parse_optim_states(files, ds_checkpoint_dir):
149
+ total_files = len(files)
150
+ state_dicts = []
151
+ for f in tqdm(files, desc='Loading checkpoint shards'):
152
+ state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
153
+ # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
154
+ # and also handle the case where it was already removed by another helper script
155
+ state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
156
+ state_dicts.append(state_dict)
157
+
158
+ if ZERO_STAGE not in state_dicts[0][OPTIMIZER_STATE_DICT]:
159
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
160
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
161
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
162
+
163
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
164
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
165
+ # use the max of the partition_count to get the dp world_size.
166
+
167
+ if type(world_size) is list:
168
+ world_size = max(world_size)
169
+
170
+ if world_size != total_files:
171
+ raise ValueError(
172
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
173
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
174
+ )
175
+
176
+ # the groups are named differently in each stage
177
+ if zero_stage <= 2:
178
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
179
+ elif zero_stage == 3:
180
+ fp32_groups_key = FP32_FLAT_GROUPS
181
+ else:
182
+ raise ValueError(f"unknown zero stage {zero_stage}")
183
+
184
+ fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
185
+ return zero_stage, world_size, fp32_flat_groups
186
+
187
+
188
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
189
+ """
190
+ Returns fp32 state_dict reconstructed from ds checkpoint
191
+
192
+ Args:
193
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
194
+
195
+ """
196
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
197
+
198
+ optim_files = get_optim_files(ds_checkpoint_dir)
199
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
200
+ print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
201
+
202
+ model_files = get_model_state_files(ds_checkpoint_dir)
203
+
204
+ zero_model_states = parse_model_states(model_files)
205
+ print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
206
+
207
+ if zero_stage <= 2:
208
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
209
+ exclude_frozen_parameters)
210
+ elif zero_stage == 3:
211
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
212
+ exclude_frozen_parameters)
213
+
214
+
215
+ def _zero2_merge_frozen_params(state_dict, zero_model_states):
216
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
217
+ return
218
+
219
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
220
+ frozen_param_fragments = zero_model_states[0].frozen_param_fragments
221
+
222
+ if debug:
223
+ num_elem = sum(s.numel() for s in frozen_param_shapes.values())
224
+ print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
225
+
226
+ wanted_params = len(frozen_param_shapes)
227
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
228
+ avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
229
+ print(f'Frozen params: Have {avail_numel} numels to process.')
230
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
231
+
232
+ total_params = 0
233
+ total_numel = 0
234
+ for name, shape in frozen_param_shapes.items():
235
+ total_params += 1
236
+ unpartitioned_numel = shape.numel()
237
+ total_numel += unpartitioned_numel
238
+
239
+ state_dict[name] = frozen_param_fragments[name]
240
+
241
+ if debug:
242
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
243
+
244
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
245
+
246
+
247
+ def _has_callable(obj, fn):
248
+ attr = getattr(obj, fn, None)
249
+ return callable(attr)
250
+
251
+
252
+ def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
253
+ param_shapes = zero_model_states[0].param_shapes
254
+
255
+ # Reconstruction protocol:
256
+ #
257
+ # XXX: document this
258
+
259
+ if debug:
260
+ for i in range(world_size):
261
+ for j in range(len(fp32_flat_groups[0])):
262
+ print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
263
+
264
+ # XXX: memory usage doubles here (zero2)
265
+ num_param_groups = len(fp32_flat_groups[0])
266
+ merged_single_partition_of_fp32_groups = []
267
+ for i in range(num_param_groups):
268
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
269
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
270
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
271
+ avail_numel = sum(
272
+ [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
273
+
274
+ if debug:
275
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
276
+ wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
277
+ # not asserting if there is a mismatch due to possible padding
278
+ print(f"Have {avail_numel} numels to process.")
279
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
280
+
281
+ # params
282
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
283
+ # out-of-core computing solution
284
+ total_numel = 0
285
+ total_params = 0
286
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
287
+ offset = 0
288
+ avail_numel = full_single_fp32_vector.numel()
289
+ for name, shape in shapes.items():
290
+
291
+ unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
292
+ total_numel += unpartitioned_numel
293
+ total_params += 1
294
+
295
+ if debug:
296
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
297
+ state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
298
+ offset += unpartitioned_numel
299
+
300
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
301
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
302
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
303
+ # live optimizer object, so we are checking that the numbers are within the right range
304
+ align_to = 2 * world_size
305
+
306
+ def zero2_align(x):
307
+ return align_to * math.ceil(x / align_to)
308
+
309
+ if debug:
310
+ print(f"original offset={offset}, avail_numel={avail_numel}")
311
+
312
+ offset = zero2_align(offset)
313
+ avail_numel = zero2_align(avail_numel)
314
+
315
+ if debug:
316
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
317
+
318
+ # Sanity check
319
+ if offset != avail_numel:
320
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
321
+
322
+ print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
323
+
324
+
325
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
326
+ exclude_frozen_parameters):
327
+ state_dict = OrderedDict()
328
+
329
+ # buffers
330
+ buffers = zero_model_states[0].buffers
331
+ state_dict.update(buffers)
332
+ if debug:
333
+ print(f"added {len(buffers)} buffers")
334
+
335
+ if not exclude_frozen_parameters:
336
+ _zero2_merge_frozen_params(state_dict, zero_model_states)
337
+
338
+ _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
339
+
340
+ # recover shared parameters
341
+ for pair in zero_model_states[0].shared_params:
342
+ if pair[1] in state_dict:
343
+ state_dict[pair[0]] = state_dict[pair[1]]
344
+
345
+ return state_dict
346
+
347
+
348
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
349
+ remainder = unpartitioned_numel % world_size
350
+ padding_numel = (world_size - remainder) if remainder else 0
351
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
352
+ return partitioned_numel, padding_numel
353
+
354
+
355
+ def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
356
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
357
+ return
358
+
359
+ if debug:
360
+ for i in range(world_size):
361
+ num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
362
+ print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
363
+
364
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
365
+ wanted_params = len(frozen_param_shapes)
366
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
367
+ avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
368
+ print(f'Frozen params: Have {avail_numel} numels to process.')
369
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
370
+
371
+ total_params = 0
372
+ total_numel = 0
373
+ for name, shape in zero_model_states[0].frozen_param_shapes.items():
374
+ total_params += 1
375
+ unpartitioned_numel = shape.numel()
376
+ total_numel += unpartitioned_numel
377
+
378
+ param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
379
+ state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
380
+
381
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
382
+
383
+ if debug:
384
+ print(
385
+ f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
386
+ )
387
+
388
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
389
+
390
+
391
+ class GatheredTensor:
392
+ """
393
+ A pseudo tensor that collects partitioned weights.
394
+ It is more memory efficient when there are multiple groups.
395
+ """
396
+
397
+ def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape):
398
+ self.flat_groups = flat_groups
399
+ self.flat_groups_offset = flat_groups_offset
400
+ self.offset = offset
401
+ self.partitioned_numel = partitioned_numel
402
+ self.shape = shape
403
+ self.dtype = self.flat_groups[0][0].dtype
404
+
405
+ def contiguous(self):
406
+ """
407
+ Merge partitioned weights from flat_groups into a single tensor.
408
+ """
409
+ end_idx = self.offset + self.partitioned_numel
410
+ world_size = len(self.flat_groups)
411
+ pad_flat_param_chunks = []
412
+
413
+ for rank_i in range(world_size):
414
+ # for each rank, we need to collect weights from related group/groups
415
+ flat_groups_at_rank_i = self.flat_groups[rank_i]
416
+ start_group_id = None
417
+ end_group_id = None
418
+ for group_id in range(len(self.flat_groups_offset)):
419
+ if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]:
420
+ start_group_id = group_id
421
+ if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]:
422
+ end_group_id = group_id
423
+ break
424
+ # collect weights from related group/groups
425
+ for group_id in range(start_group_id, end_group_id + 1):
426
+ flat_tensor = flat_groups_at_rank_i[group_id]
427
+ start_offset = self.offset - self.flat_groups_offset[group_id]
428
+ end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id]
429
+ pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset])
430
+
431
+ # collect weights from all ranks
432
+ pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0)
433
+ param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous()
434
+ return param
435
+
436
+
437
+ def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
438
+ param_shapes = zero_model_states[0].param_shapes
439
+ avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size
440
+
441
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
442
+ # param, re-consolidating each param, while dealing with padding if any
443
+
444
+ # merge list of dicts, preserving order
445
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
446
+
447
+ if debug:
448
+ for i in range(world_size):
449
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
450
+
451
+ wanted_params = len(param_shapes)
452
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
453
+ # not asserting if there is a mismatch due to possible padding
454
+ avail_numel = fp32_flat_groups[0].numel() * world_size
455
+ print(f"Trainable params: Have {avail_numel} numels to process.")
456
+ print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
457
+
458
+ # params
459
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
460
+ # out-of-core computing solution
461
+ offset = 0
462
+ total_numel = 0
463
+ total_params = 0
464
+ flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]]))
465
+ for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'):
466
+ unpartitioned_numel = shape.numel()
467
+ total_numel += unpartitioned_numel
468
+ total_params += 1
469
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
470
+
471
+ if debug:
472
+ print(
473
+ f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
474
+ )
475
+
476
+ # memory efficient tensor
477
+ tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape)
478
+ state_dict[name] = tensor
479
+ offset += partitioned_numel
480
+
481
+ offset *= world_size
482
+
483
+ # Sanity check
484
+ if offset != avail_numel:
485
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
486
+
487
+ print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
488
+
489
+
490
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
491
+ exclude_frozen_parameters):
492
+ state_dict = OrderedDict()
493
+
494
+ # buffers
495
+ buffers = zero_model_states[0].buffers
496
+ state_dict.update(buffers)
497
+ if debug:
498
+ print(f"added {len(buffers)} buffers")
499
+
500
+ if not exclude_frozen_parameters:
501
+ _zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
502
+
503
+ _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
504
+
505
+ # recover shared parameters
506
+ for pair in zero_model_states[0].shared_params:
507
+ if pair[1] in state_dict:
508
+ state_dict[pair[0]] = state_dict[pair[1]]
509
+
510
+ return state_dict
511
+
512
+
513
+ def to_torch_tensor(state_dict, return_empty_tensor=False):
514
+ """
515
+ Convert state_dict of GatheredTensor to torch tensor
516
+ """
517
+ torch_state_dict = {}
518
+ converted_tensors = {}
519
+ for name, tensor in state_dict.items():
520
+ tensor_id = id(tensor)
521
+ if tensor_id in converted_tensors: # shared tensors
522
+ shared_tensor = torch_state_dict[converted_tensors[tensor_id]]
523
+ torch_state_dict[name] = shared_tensor
524
+ else:
525
+ converted_tensors[tensor_id] = name
526
+ if return_empty_tensor:
527
+ torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype)
528
+ else:
529
+ torch_state_dict[name] = tensor.contiguous()
530
+ return torch_state_dict
531
+
532
+
533
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
534
+ tag=None,
535
+ exclude_frozen_parameters=False,
536
+ lazy_mode=False):
537
+ """
538
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
539
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
540
+ via a model hub.
541
+
542
+ Args:
543
+ - ``checkpoint_dir``: path to the desired checkpoint folder
544
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
545
+ - ``exclude_frozen_parameters``: exclude frozen parameters
546
+ - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient.
547
+ Convert the pesduo tensor to torch tensor by ``.contiguous()``
548
+
549
+ Returns:
550
+ - pytorch ``state_dict``
551
+
552
+ A typical usage might be ::
553
+
554
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
555
+ # do the training and checkpoint saving
556
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
557
+ model = model.cpu() # move to cpu
558
+ model.load_state_dict(state_dict)
559
+ # submit to model hub or save the model to share with others
560
+
561
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
562
+ application. i.e. you will need to re-initialize the deepspeed engine, since
563
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
564
+
565
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
566
+
567
+ Note: the above usage may not work if your application doesn't have sufficient free CPU memory.
568
+ You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
569
+ the checkpoint. Or you can load state_dict in lazy mode ::
570
+
571
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
572
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu
573
+ for name, lazy_tensor in state_dict.item():
574
+ tensor = lazy_tensor.contiguous() # to cpu
575
+ print(name, tensor)
576
+ # del tensor to release memory if it no longer in use
577
+ """
578
+ if tag is None:
579
+ latest_path = os.path.join(checkpoint_dir, 'latest')
580
+ if os.path.isfile(latest_path):
581
+ with open(latest_path, 'r') as fd:
582
+ tag = fd.read().strip()
583
+ else:
584
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
585
+
586
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
587
+
588
+ if not os.path.isdir(ds_checkpoint_dir):
589
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
590
+
591
+ state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
592
+ if lazy_mode:
593
+ return state_dict
594
+ else:
595
+ return to_torch_tensor(state_dict)
596
+
597
+
598
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
599
+ output_dir,
600
+ max_shard_size="5GB",
601
+ safe_serialization=False,
602
+ tag=None,
603
+ exclude_frozen_parameters=False):
604
+ """
605
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
606
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
607
+
608
+ Args:
609
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
610
+ - ``output_dir``: directory to the pytorch fp32 state_dict output files
611
+ - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
612
+ - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
613
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
614
+ - ``exclude_frozen_parameters``: exclude frozen parameters
615
+ """
616
+
617
+ # Dependency pre-check
618
+ if safe_serialization:
619
+ try:
620
+ from safetensors.torch import save_file
621
+ except ImportError:
622
+ print('If you want to use `safe_serialization`, please `pip install safetensors`')
623
+ raise
624
+ if max_shard_size is not None:
625
+ try:
626
+ from huggingface_hub import split_torch_state_dict_into_shards
627
+ except ImportError:
628
+ print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
629
+ raise
630
+
631
+ # Convert zero checkpoint to state_dict
632
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
633
+ tag,
634
+ exclude_frozen_parameters,
635
+ lazy_mode=True)
636
+
637
+ # Shard the model if it is too big.
638
+ weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
639
+ if max_shard_size is not None:
640
+ filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
641
+ # an memory-efficient approach for sharding
642
+ empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True)
643
+ state_dict_split = split_torch_state_dict_into_shards(empty_state_dict,
644
+ filename_pattern=filename_pattern,
645
+ max_shard_size=max_shard_size)
646
+ else:
647
+ from collections import namedtuple
648
+ StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
649
+ state_dict_split = StateDictSplit(is_sharded=False,
650
+ filename_to_tensors={weights_name: list(state_dict.keys())})
651
+
652
+ # Save the model by shard
653
+ os.makedirs(output_dir, exist_ok=True)
654
+ filename_to_tensors = state_dict_split.filename_to_tensors.items()
655
+ for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
656
+ shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors}
657
+ shard_state_dict = to_torch_tensor(shard_state_dict)
658
+ output_path = os.path.join(output_dir, shard_file)
659
+ if safe_serialization:
660
+ save_file(shard_state_dict, output_path, metadata={"format": "pt"})
661
+ else:
662
+ torch.save(shard_state_dict, output_path)
663
+ # release the memory of current shard
664
+ for tensor_name in list(shard_state_dict.keys()):
665
+ del state_dict[tensor_name]
666
+ del shard_state_dict[tensor_name]
667
+ del shard_state_dict
668
+ gc.collect()
669
+
670
+ # Save index if sharded
671
+ if state_dict_split.is_sharded:
672
+ index = {
673
+ "metadata": state_dict_split.metadata,
674
+ "weight_map": state_dict_split.tensor_to_filename,
675
+ }
676
+ save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
677
+ save_index_file = os.path.join(output_dir, save_index_file)
678
+ with open(save_index_file, "w", encoding="utf-8") as f:
679
+ content = json.dumps(index, indent=2, sort_keys=True) + "\n"
680
+ f.write(content)
681
+
682
+
683
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
684
+ """
685
+ 1. Put the provided model to cpu
686
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
687
+ 3. Load it into the provided model
688
+
689
+ Args:
690
+ - ``model``: the model object to update
691
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
692
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
693
+
694
+ Returns:
695
+ - ``model`: modified model
696
+
697
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
698
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
699
+ conveniently placed for you in the checkpoint folder.
700
+
701
+ A typical usage might be ::
702
+
703
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
704
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
705
+ # submit to model hub or save the model to share with others
706
+
707
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
708
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
709
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
710
+
711
+ """
712
+ logger.info("Extracting fp32 weights")
713
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
714
+
715
+ logger.info("Overwriting model with fp32 weights")
716
+ model = model.cpu()
717
+ model.load_state_dict(state_dict, strict=False)
718
+
719
+ return model
720
+
721
+
722
+ if __name__ == "__main__":
723
+ parser = argparse.ArgumentParser()
724
+ parser.add_argument("checkpoint_dir",
725
+ type=str,
726
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
727
+ parser.add_argument("output_dir",
728
+ type=str,
729
+ help="directory to the pytorch fp32 state_dict output files"
730
+ "(e.g. path/checkpoint-12-output/)")
731
+ parser.add_argument(
732
+ "--max_shard_size",
733
+ type=str,
734
+ default="5GB",
735
+ help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
736
+ "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
737
+ "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
738
+ "without CPU OOM issues.")
739
+ parser.add_argument(
740
+ "--safe_serialization",
741
+ default=False,
742
+ action='store_true',
743
+ help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
744
+ parser.add_argument("-t",
745
+ "--tag",
746
+ type=str,
747
+ default=None,
748
+ help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
749
+ parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
750
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
751
+ args = parser.parse_args()
752
+
753
+ debug = args.debug
754
+
755
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
756
+ args.output_dir,
757
+ max_shard_size=args.max_shard_size,
758
+ safe_serialization=args.safe_serialization,
759
+ tag=args.tag,
760
+ exclude_frozen_parameters=args.exclude_frozen_parameters)