mmmmmcyaaa commited on
Commit
46cc107
·
verified ·
1 Parent(s): e158ae8

Organize checkpoints by four experimental settings

Browse files
Files changed (43) hide show
  1. README.md +12 -1
  2. settings/ASSET_STATUS.md +10 -0
  3. settings/README.md +21 -0
  4. settings/florence_bridge/README.md +17 -0
  5. settings/florence_bridge/common_start/steps_20000_accelerate/checkpoint.json +48 -0
  6. settings/florence_bridge/common_start/steps_20000_accelerate/latest +1 -0
  7. settings/florence_bridge/common_start/steps_20000_accelerate/pytorch_model.pt +3 -0
  8. settings/florence_bridge/common_start/steps_20000_accelerate/pytorch_model/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
  9. settings/florence_bridge/common_start/steps_20000_accelerate/pytorch_model/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
  10. settings/florence_bridge/common_start/steps_20000_accelerate/pytorch_model/mp_rank_00_model_states.pt +3 -0
  11. settings/florence_bridge/common_start/steps_20000_accelerate/random_states_0.pkl +3 -0
  12. settings/florence_bridge/common_start/steps_20000_accelerate/random_states_1.pkl +3 -0
  13. settings/florence_bridge/common_start/steps_20000_accelerate/zero_to_fp32.py +760 -0
  14. settings/florence_bridge/configs/deepspeed_florence_2gpu.yaml +15 -0
  15. settings/florence_bridge/configs/ds_florence_zero2.json +19 -0
  16. settings/florence_bridge/configs/florence_bridge_20k_plus500.yaml +110 -0
  17. settings/florence_bridge/configs/reference/common_start_20k_full.yaml +113 -0
  18. settings/florence_bridge/configs/reference/residual_seed117465_full.yaml +118 -0
  19. settings/florence_bridge/configs/reference/uniform_seed117465_full.yaml +118 -0
  20. settings/florence_bridge/frameskip/steps_20500_pytorch_model.pt +3 -0
  21. settings/florence_bridge/keyframe/steps_20500_pytorch_model.pt +3 -0
  22. settings/florence_bridge/loss_is/steps_20500_pytorch_model.pt +3 -0
  23. settings/florence_bridge/residual/steps_20500_pytorch_model.pt +3 -0
  24. settings/florence_bridge/uniform/steps_20500_pytorch_model.pt +3 -0
  25. settings/florence_robotwin/README.md +17 -0
  26. settings/florence_robotwin/frameskip/steps_10500_pytorch_model.pt +3 -0
  27. settings/florence_robotwin/keyframe/steps_10500_pytorch_model.pt +3 -0
  28. settings/florence_robotwin/loss_is/steps_10500_pytorch_model.pt +3 -0
  29. settings/qwen_bridge/README.md +16 -0
  30. settings/qwen_bridge/common_start/steps_29000_pytorch_model.pt +3 -0
  31. settings/qwen_bridge/common_start/steps_29000_training_state.pt +3 -0
  32. settings/qwen_bridge/dependencies/AGENTS.md +26 -0
  33. settings/qwen_bridge/dependencies/ENVIRONMENT.md +72 -0
  34. settings/qwen_bridge/dependencies/MULTISEED_PROTOCOL.md +9 -0
  35. settings/qwen_bridge/dependencies/config.full.yaml +122 -0
  36. settings/qwen_bridge/dependencies/requirements-qwen-bridge.txt +21 -0
  37. settings/qwen_bridge/frameskip/steps_29500_pytorch_model.pt +3 -0
  38. settings/qwen_bridge/keyframe/steps_29500_pytorch_model.pt +3 -0
  39. settings/qwen_bridge/loss_is/steps_29500_pytorch_model.pt +3 -0
  40. settings/qwen_robotwin/README.md +17 -0
  41. settings/qwen_robotwin/frameskip/steps_11500_pytorch_model.pt +3 -0
  42. settings/qwen_robotwin/keyframe/steps_11500_pytorch_model.pt +3 -0
  43. settings/qwen_robotwin/loss_is/steps_11500_pytorch_model.pt +3 -0
README.md CHANGED
@@ -10,10 +10,21 @@ tags:
10
  - importance-sampling
11
  ---
12
 
13
- # ReTime / OPTR — Florence–Bridge and Qwen–Bridge handoff
14
 
15
  This package contains the server-authoritative Florence–Bridge OPTR code, its complete 20K common-start state and Uniform/Residual-OPTR 20.5K evaluation snapshots. It also contains the complete Qwen3-VL-4B–Bridge 29K common-start state and the environment/seed contract needed for paired multi-seed continuation experiments.
16
 
 
 
 
 
 
 
 
 
 
 
 
17
  ## Rebuttal 训练与测评种子
18
 
19
  | 设置 | Common-start 训练 seed | Continuation 训练 seed | Evaluation policy seeds |
 
10
  - importance-sampling
11
  ---
12
 
13
+ # ReTime / OPTR — four-setting handoff
14
 
15
  This package contains the server-authoritative Florence–Bridge OPTR code, its complete 20K common-start state and Uniform/Residual-OPTR 20.5K evaluation snapshots. It also contains the complete Qwen3-VL-4B–Bridge 29K common-start state and the environment/seed contract needed for paired multi-seed continuation experiments.
16
 
17
+ ## Unified checkpoint layout
18
+
19
+ The release is being normalized under [`settings/`](settings/README.md). Each of the four settings has the same entries: `common_start`, `uniform`, `residual`, `keyframe`, `frameskip`, `loss_is`, `configs`, and `dependencies`.
20
+
21
+ - [`settings/florence_bridge/`](settings/florence_bridge/README.md)
22
+ - [`settings/florence_robotwin/`](settings/florence_robotwin/README.md)
23
+ - [`settings/qwen_bridge/`](settings/qwen_bridge/README.md)
24
+ - [`settings/qwen_robotwin/`](settings/qwen_robotwin/README.md)
25
+
26
+ The common-start entry is the resumable branch point. Method endpoints are evaluation-ready model snapshots. Shared source code is kept once at repository root and referenced by each setting to avoid four inconsistent copies.
27
+
28
  ## Rebuttal 训练与测评种子
29
 
30
  | 设置 | Common-start 训练 seed | Continuation 训练 seed | Evaluation policy seeds |
settings/ASSET_STATUS.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Asset status
2
+
3
+ The organized tree is populated in two stages:
4
+
5
+ - Existing Hub objects are copied server-side into their setting directories.
6
+ - Missing common-start or Uniform/Residual artifacts are uploaded directly from the server that owns the authoritative checkpoint.
7
+
8
+ Expected final entries for every setting are `common_start`, `uniform`, `residual`, `keyframe`, `frameskip`, `loss_is`, `configs`, and `dependencies`.
9
+
10
+ `common_start` means a resumable training state. The five method directories contain evaluation-ready endpoint weights. Training configs, proposal/cache metadata and environment notes live beside the corresponding setting and point to shared code rather than duplicating the whole source tree four times.
settings/README.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Four-setting checkpoint index
2
+
3
+ This directory groups the release assets by experimental setting. Each setting uses the same six logical entries:
4
+
5
+ 1. `common_start/`: the branch point used by all continuation methods;
6
+ 2. `uniform/`: the Uniform continuation checkpoint;
7
+ 3. `residual/`: the Residual-OPTR (ReTime) continuation checkpoint;
8
+ 4. `keyframe/`: the KF-Weight continuation checkpoint;
9
+ 5. `frameskip/`: the FrameSkip continuation checkpoint;
10
+ 6. `loss_is/`: the active Loss-IS continuation checkpoint.
11
+
12
+ The `common_start` entry is the resumable training state. Method endpoints are evaluation-ready model snapshots unless a setting README explicitly lists additional training-state files. Shared source code remains at repository root; each setting README records the corresponding step, model family, environment and method dependencies.
13
+
14
+ | Setting | Common start | Continuation endpoint |
15
+ |---|---:|---:|
16
+ | Florence–Bridge | 20,000 | 20,500 |
17
+ | Florence–RoboTwin | 10,000 | 10,500 |
18
+ | Qwen3-VL-4B–Bridge | 29,000 | 29,500 |
19
+ | Qwen3-VL-4B–RoboTwin | 11,000 | 11,500 |
20
+
21
+ No implementation-path or self-referential checksum gate is required for launch. Reproduction should still validate the model family, dataset, episode/anchor support, proposal semantics, batch contract and training budget.
settings/florence_bridge/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Florence–Bridge
2
+
3
+ - Backbone: Florence-2-large with DiT-B flow-matching action head.
4
+ - Common start: step 20,000; full two-rank resumable state.
5
+ - Continuation endpoint: step 20,500 (+500 optimizer updates).
6
+ - Main continuation seed: `117465`; common-start seed: `42`.
7
+ - Evaluation: SimplerEnv WidowX, tasks Stack/Carrot/Spoon/Eggplant, policy seeds `518957, 765353, 686765, 516408`, 24 episodes per task and seed, no video.
8
+ - Training contract: two GPUs, BF16, ZeRO-2, micro-batch 4/GPU, gradient accumulation 8, global batch 64.
9
+
10
+ Method endpoints under this directory are model-only evaluation snapshots. Resume new branches from `common_start/steps_20000_accelerate/`.
11
+
12
+ Method dependencies:
13
+
14
+ - Residual: frozen K=8, alpha=0.2 temporal proposal and ordinary p/q correction.
15
+ - FrameSkip: FrameSkip cache and adapter under the shared external-baseline source tree.
16
+ - Keyframe: KF-Weight/APE cache and adapter under the shared external-baseline source tree.
17
+ - Loss-IS: active always-on candidate sampling implementation; candidate factor 3 and ordinary importance correction.
settings/florence_bridge/common_start/steps_20000_accelerate/checkpoint.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "completed_steps": 20000,
3
+ "files": [
4
+ {
5
+ "bytes": 13,
6
+ "name": "latest"
7
+ },
8
+ {
9
+ "bytes": 5514449457,
10
+ "name": "pytorch_model/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt"
11
+ },
12
+ {
13
+ "bytes": 5514463601,
14
+ "name": "pytorch_model/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt"
15
+ },
16
+ {
17
+ "bytes": 1839089981,
18
+ "name": "pytorch_model/mp_rank_00_model_states.pt"
19
+ },
20
+ {
21
+ "bytes": 2154184469,
22
+ "name": "pytorch_model.pt"
23
+ },
24
+ {
25
+ "bytes": 15017,
26
+ "name": "random_states_0.pkl"
27
+ },
28
+ {
29
+ "bytes": 15081,
30
+ "name": "random_states_1.pkl"
31
+ },
32
+ {
33
+ "bytes": 33270,
34
+ "name": "zero_to_fp32.py"
35
+ }
36
+ ],
37
+ "resume_identity": {
38
+ "config_sha256": "1c394b6043c323133b0512d3efd761ae8332e5098969864f410b71651aa56f44",
39
+ "manifest_sha256": "a1627df8ff110c7298eaf025ffcd4f48d9ca17117cfcfb3926b962d0bb19c0ca",
40
+ "model_structure_sha256": "e055e3fa0085edc6a9bf6cdb1605a05e61ae289957e24e37cfe2cfce2dc94c39",
41
+ "proposal_alpha": null,
42
+ "proposal_sha256": null,
43
+ "seed": 42,
44
+ "total_batch_size": 64
45
+ },
46
+ "schema_version": 1,
47
+ "world_size": 2
48
+ }
settings/florence_bridge/common_start/steps_20000_accelerate/latest ADDED
@@ -0,0 +1 @@
 
 
1
+ pytorch_model
settings/florence_bridge/common_start/steps_20000_accelerate/pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4f39cd339271347b1ab83ddc9c8dae7e07e315bea8cf86812b2e0b6772abd42
3
+ size 2154184469
settings/florence_bridge/common_start/steps_20000_accelerate/pytorch_model/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:42263278dd16848dd50fd159f430bb40efa541d8b62aba5d608531d3af90f1d4
3
+ size 5514449457
settings/florence_bridge/common_start/steps_20000_accelerate/pytorch_model/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:c6e21653b454605b3cb3db62bf9b1bae90ddf63eea1389cc0a0dd351f1f0839c
3
+ size 5514463601
settings/florence_bridge/common_start/steps_20000_accelerate/pytorch_model/mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:822f82ffa3ebb7f8e1e9cb15f7c24dafb4054d9fb2b63646fb81ba63172c09b6
3
+ size 1839089981
settings/florence_bridge/common_start/steps_20000_accelerate/random_states_0.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29e1b8cf5838519c544dfe660c71c064b59cd35d8f5c5ae9fa1e63e9cfd3e773
3
+ size 15017
settings/florence_bridge/common_start/steps_20000_accelerate/random_states_1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fed527bb36c43639d19411c7da8f3eb3eca04543ed7eb06f62c1fa978f3bdf31
3
+ size 15081
settings/florence_bridge/common_start/steps_20000_accelerate/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)
settings/florence_bridge/configs/deepspeed_florence_2gpu.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ compute_environment: LOCAL_MACHINE
2
+ debug: false
3
+ deepspeed_config:
4
+ deepspeed_config_file: configs/ds_florence_zero2.json
5
+ distributed_type: DEEPSPEED
6
+ downcast_bf16: "no"
7
+ enable_cpu_affinity: false
8
+ machine_rank: 0
9
+ main_training_function: main
10
+ mixed_precision: bf16
11
+ num_machines: 1
12
+ num_processes: 2
13
+ rdzv_backend: static
14
+ same_network: true
15
+ use_cpu: false
settings/florence_bridge/configs/ds_florence_zero2.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fp16": {"enabled": false},
3
+ "bf16": {"enabled": true},
4
+ "train_micro_batch_size_per_gpu": "auto",
5
+ "train_batch_size": "auto",
6
+ "gradient_accumulation_steps": "auto",
7
+ "zero_optimization": {
8
+ "stage": 2,
9
+ "allgather_partitions": true,
10
+ "allgather_bucket_size": 50000000,
11
+ "reduce_scatter": true,
12
+ "reduce_bucket_size": 50000000,
13
+ "overlap_comm": true,
14
+ "contiguous_gradients": true,
15
+ "cpu_offload": false
16
+ },
17
+ "gradient_clipping": 1.0,
18
+ "steps_per_print": 10
19
+ }
settings/florence_bridge/configs/florence_bridge_20k_plus500.yaml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ run_id: florence-bridge-20k-plus500
2
+ run_root_dir: ${oc.env:OPTR_RUN_ROOT}
3
+ seed: 117465
4
+ wandb_entity: null
5
+ wandb_project: OPTR-Florence-Bridge
6
+ is_debug: false
7
+ version_id: "0.21"
8
+
9
+ framework:
10
+ name: QwenGR00T
11
+ qwenvl:
12
+ base_vlm: ${oc.env:FLORENCE_MODEL_PATH}
13
+ attn_implementation: flash_attention_2
14
+ vl_hidden_dim: 2048
15
+ dino:
16
+ dino_backbone: dinov2_vits14
17
+ action_model:
18
+ action_model_type: DiT-B
19
+ action_hidden_dim: 1024
20
+ hidden_size: 1024
21
+ add_pos_embed: true
22
+ max_seq_len: 1024
23
+ action_dim: 7
24
+ state_dim: 7
25
+ action_horizon: 16
26
+ future_action_window_size: 15
27
+ past_action_window_size: 0
28
+ repeated_diffusion_steps: 8
29
+ noise_beta_alpha: 1.5
30
+ noise_beta_beta: 1.0
31
+ noise_s: 0.999
32
+ num_timestep_buckets: 1000
33
+ num_inference_timesteps: 4
34
+ num_target_vision_tokens: 32
35
+ diffusion_model_cfg:
36
+ cross_attention_dim: 1024
37
+ dropout: 0.2
38
+ final_dropout: true
39
+ interleave_self_attention: true
40
+ norm_type: ada_norm
41
+ num_layers: 16
42
+ output_dim: 1024
43
+ positional_embeddings: null
44
+
45
+ datasets:
46
+ vla_data:
47
+ dataset_py: lerobot_datasets
48
+ data_root_dir: ${oc.env:BRIDGE_DATA_ROOT}
49
+ data_mix: bridge_rt_infoflow
50
+ action_type: delta_ee
51
+ action_mode: abs
52
+ precomputed_statistics_path: ${oc.env:BRIDGE_STATISTICS_PATH}
53
+ precomputed_statistics_key_map:
54
+ bridge_orig_lerobot: oxe_bridge
55
+ fractal20220817_data_lerobot: oxe_rt1
56
+ CoT_prompt: Your task is {instruction}. To identify the key objects for your task. Locate their bounding boxes in [x1,y1,x2,y2] format.
57
+ per_device_batch_size: 4
58
+ load_all_data_for_training: true
59
+ obs_image_size: [224, 224]
60
+ video_backend: torchvision_av
61
+ num_workers: 4
62
+ balance_dataset_weights: false
63
+ balance_trajectory_weights: false
64
+ traceable_sampling: true
65
+ expected_world_size: 2
66
+ dataset_provenance_path: ${oc.env:BRIDGE_PROVENANCE_PATH}
67
+ dataset_content_fingerprint_path: ${oc.env:BRIDGE_FINGERPRINT_PATH}
68
+ valid_anchor_manifest_path: ${oc.env:BRIDGE_MANIFEST_PATH}
69
+ temporal_proposal_path: null
70
+ transform_rng_seed: 298226
71
+
72
+ trainer:
73
+ use_deepspeed: true
74
+ max_train_steps: 100000
75
+ num_warmup_steps: 5000
76
+ save_interval: null
77
+ save_steps: [20500]
78
+ evaluation_snapshot_interval: null
79
+ eval_interval: 100001
80
+ repeated_diffusion_steps: 4
81
+ pretrained_checkpoint: null
82
+ is_resume: true
83
+ allow_model_only_resume: false
84
+ learning_rate:
85
+ base: 3.0e-05
86
+ qwen_vl_interface: 1.0e-05
87
+ action_model: 1.0e-04
88
+ lr_scheduler_type: cosine_with_min_lr
89
+ scheduler_specific_kwargs:
90
+ min_lr: 5.0e-07
91
+ freeze_modules: ""
92
+ trainable_modules: ""
93
+ frozen_modules_eval: false
94
+ logging_frequency: 10
95
+ gradient_clipping: 1.0
96
+ gradient_accumulation_steps: 8
97
+ save_format: pt
98
+ save_final_checkpoint: false
99
+ optimizer:
100
+ name: AdamW
101
+ betas: [0.9, 0.95]
102
+ eps: 1.0e-08
103
+ weight_decay: 1.0e-08
104
+ resume_accelerate_checkpoint: ${oc.env:COMMON_START_20K}
105
+ branch_parent_seed: 42
106
+ branch_rng_seed: 117465
107
+ model_rng_seed: 588643
108
+ stop_after_steps: 20500
109
+
110
+ output_dir: ${oc.env:OPTR_RUN_ROOT}/florence-bridge-20k-plus500
settings/florence_bridge/configs/reference/common_start_20k_full.yaml ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ run_id: florence-scratch-uniform-seed-42-official100k-mb4-eval1k-20260726
2
+ run_root_dir: /mnt/miaochengyu/starvla-infoflow-runtime/runs/florence-scratch-official-100k
3
+ seed: 42
4
+ wandb_entity: null
5
+ wandb_project: InfoFlow-StarVLA-BridgeRT
6
+ is_debug: false
7
+ version_id: '0.21'
8
+ framework:
9
+ name: QwenGR00T
10
+ qwenvl:
11
+ base_vlm: /mnt/miaochengyu/starvla-infoflow-runtime/playground/Pretrained_models/Florence-2-large
12
+ attn_implementation: flash_attention_2
13
+ vl_hidden_dim: 2048
14
+ action_model:
15
+ action_model_type: DiT-B
16
+ action_hidden_dim: 1024
17
+ hidden_size: 1024
18
+ add_pos_embed: true
19
+ max_seq_len: 1024
20
+ action_dim: 7
21
+ state_dim: 7
22
+ action_horizon: 16
23
+ repeated_diffusion_steps: 8
24
+ noise_beta_alpha: 1.5
25
+ noise_beta_beta: 1.0
26
+ noise_s: 0.999
27
+ num_timestep_buckets: 1000
28
+ num_inference_timesteps: 4
29
+ num_target_vision_tokens: 32
30
+ diffusion_model_cfg:
31
+ cross_attention_dim: 1024
32
+ dropout: 0.2
33
+ final_dropout: true
34
+ interleave_self_attention: true
35
+ norm_type: ada_norm
36
+ num_layers: 16
37
+ output_dim: 1024
38
+ positional_embeddings: null
39
+ future_action_window_size: 15
40
+ past_action_window_size: 0
41
+ dino:
42
+ dino_backbone: dinov2_vits14
43
+ datasets:
44
+ vla_data:
45
+ dataset_py: lerobot_datasets
46
+ data_root_dir: /mnt/miaochengyu/starvla-infoflow-runtime/playground/Datasets/OXE_LEROBOT_DATASET
47
+ data_mix: bridge_rt_infoflow
48
+ action_type: delta_ee
49
+ action_mode: abs
50
+ precomputed_statistics_path: /mnt/miaochengyu/starvla-infoflow-runtime/playground/Pretrained_models/Florence-GR00T-Bridge-RT-1/dataset_statistics.json
51
+ precomputed_statistics_key_map:
52
+ bridge_orig_lerobot: oxe_bridge
53
+ fractal20220817_data_lerobot: oxe_rt1
54
+ CoT_prompt: Your task is {instruction}. To identify the key objects for your task.
55
+ Locate their bounding boxes in [x1,y1,x2,y2] format.
56
+ per_device_batch_size: 4
57
+ load_all_data_for_training: true
58
+ obs_image_size:
59
+ - 224
60
+ - 224
61
+ video_backend: torchvision_av
62
+ num_workers: 4
63
+ balance_dataset_weights: false
64
+ balance_trajectory_weights: false
65
+ traceable_sampling: true
66
+ expected_world_size: 2
67
+ dataset_provenance_path: /home/miaochengyu/starVLA-infoflow-codex/protocols/bridgert/data_provenance.json
68
+ dataset_content_fingerprint_path: /mnt/miaochengyu/starvla-infoflow-runtime/manifests/bridgert/content_fingerprints.json
69
+ valid_anchor_manifest_path: /mnt/miaochengyu/starvla-infoflow-runtime/manifests/bridgert/valid_anchor_manifest_florence_scratch_v1.json
70
+ temporal_proposal_path: null
71
+ trainer:
72
+ use_deepspeed: true
73
+ max_train_steps: 100000
74
+ num_warmup_steps: 5000
75
+ save_interval: null
76
+ save_steps:
77
+ - 5000
78
+ - 10000
79
+ - 20000
80
+ - 30000
81
+ - 50000
82
+ - 75000
83
+ - 100000
84
+ evaluation_snapshot_interval: 1000
85
+ eval_interval: 100001
86
+ repeated_diffusion_steps: 4
87
+ pretrained_checkpoint: null
88
+ is_resume: false
89
+ allow_model_only_resume: false
90
+ learning_rate:
91
+ base: 3.0e-05
92
+ qwen_vl_interface: 1.0e-05
93
+ action_model: 0.0001
94
+ lr_scheduler_type: cosine_with_min_lr
95
+ scheduler_specific_kwargs:
96
+ min_lr: 5.0e-07
97
+ freeze_modules: ''
98
+ trainable_modules: ''
99
+ frozen_modules_eval: false
100
+ logging_frequency: 50
101
+ gradient_clipping: 1.0
102
+ gradient_accumulation_steps: 8
103
+ save_format: pt
104
+ save_final_checkpoint: false
105
+ optimizer:
106
+ name: AdamW
107
+ betas:
108
+ - 0.9
109
+ - 0.95
110
+ eps: 1.0e-08
111
+ weight_decay: 1.0e-08
112
+ config_yaml: examples/InfoFlow/train_files/server/bridgert_florence_scratch_official_100k_mb4_eval1k.yaml
113
+ output_dir: /mnt/miaochengyu/starvla-infoflow-runtime/runs/florence-scratch-official-100k/florence-scratch-uniform-seed-42-official100k-mb4-eval1k-20260726
settings/florence_bridge/configs/reference/residual_seed117465_full.yaml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ run_id: infoflow-confirmatory-residual-seed-117465
2
+ run_root_dir: /mnt/miaochengyu/starvla-infoflow-runtime/runs/infoflow-confirmatory-22k-20260730
3
+ seed: 117465
4
+ wandb_entity: null
5
+ wandb_project: InfoFlow-StarVLA-BridgeRT
6
+ is_debug: false
7
+ version_id: '0.21'
8
+ framework:
9
+ name: QwenGR00T
10
+ qwenvl:
11
+ base_vlm: /mnt/miaochengyu/starvla-infoflow-runtime/playground/Pretrained_models/Florence-2-large
12
+ attn_implementation: flash_attention_2
13
+ vl_hidden_dim: 2048
14
+ action_model:
15
+ action_model_type: DiT-B
16
+ action_hidden_dim: 1024
17
+ hidden_size: 1024
18
+ add_pos_embed: true
19
+ max_seq_len: 1024
20
+ action_dim: 7
21
+ state_dim: 7
22
+ action_horizon: 16
23
+ repeated_diffusion_steps: 8
24
+ noise_beta_alpha: 1.5
25
+ noise_beta_beta: 1.0
26
+ noise_s: 0.999
27
+ num_timestep_buckets: 1000
28
+ num_inference_timesteps: 4
29
+ num_target_vision_tokens: 32
30
+ diffusion_model_cfg:
31
+ cross_attention_dim: 1024
32
+ dropout: 0.2
33
+ final_dropout: true
34
+ interleave_self_attention: true
35
+ norm_type: ada_norm
36
+ num_layers: 16
37
+ output_dim: 1024
38
+ positional_embeddings: null
39
+ future_action_window_size: 15
40
+ past_action_window_size: 0
41
+ dino:
42
+ dino_backbone: dinov2_vits14
43
+ datasets:
44
+ vla_data:
45
+ dataset_py: lerobot_datasets
46
+ data_root_dir: /mnt/miaochengyu/starvla-infoflow-runtime/playground/Datasets/OXE_LEROBOT_DATASET
47
+ data_mix: bridge_rt_infoflow
48
+ action_type: delta_ee
49
+ action_mode: abs
50
+ precomputed_statistics_path: /mnt/miaochengyu/starvla-infoflow-runtime/playground/Pretrained_models/Florence-GR00T-Bridge-RT-1/dataset_statistics.json
51
+ precomputed_statistics_key_map:
52
+ bridge_orig_lerobot: oxe_bridge
53
+ fractal20220817_data_lerobot: oxe_rt1
54
+ CoT_prompt: Your task is {instruction}. To identify the key objects for your task.
55
+ Locate their bounding boxes in [x1,y1,x2,y2] format.
56
+ per_device_batch_size: 4
57
+ load_all_data_for_training: true
58
+ obs_image_size:
59
+ - 224
60
+ - 224
61
+ video_backend: torchvision_av
62
+ num_workers: 4
63
+ balance_dataset_weights: false
64
+ balance_trajectory_weights: false
65
+ traceable_sampling: true
66
+ expected_world_size: 2
67
+ dataset_provenance_path: /home/miaochengyu/starVLA-infoflow-codex/protocols/bridgert/data_provenance.json
68
+ dataset_content_fingerprint_path: /mnt/miaochengyu/starvla-infoflow-runtime/manifests/bridgert/content_fingerprints.json
69
+ valid_anchor_manifest_path: /mnt/miaochengyu/starvla-infoflow-runtime/manifests/bridgert/valid_anchor_manifest_florence_scratch_v1.json
70
+ valid_anchor_manifest_migration_path: /home/miaochengyu/starVLA-infoflow-codex/protocols/bridgert/valid_anchor_manifest_rng_migration_20260729.json
71
+ temporal_proposal_path: /mnt/miaochengyu/starvla-infoflow-runtime/runs/infoflow-proposals/scratch20k_residual_grid8_gate42f_batch1_20260729/residual_temporal_proposal.json
72
+ transform_rng_seed: 298226
73
+ trainer:
74
+ use_deepspeed: true
75
+ max_train_steps: 100000
76
+ num_warmup_steps: 5000
77
+ save_interval: null
78
+ save_steps:
79
+ - 20500
80
+ - 21000
81
+ - 22000
82
+ evaluation_snapshot_interval: 1000
83
+ eval_interval: 100001
84
+ repeated_diffusion_steps: 4
85
+ pretrained_checkpoint: null
86
+ is_resume: true
87
+ allow_model_only_resume: false
88
+ learning_rate:
89
+ base: 3.0e-05
90
+ qwen_vl_interface: 1.0e-05
91
+ action_model: 0.0001
92
+ lr_scheduler_type: cosine_with_min_lr
93
+ scheduler_specific_kwargs:
94
+ min_lr: 5.0e-07
95
+ freeze_modules: ''
96
+ trainable_modules: ''
97
+ frozen_modules_eval: false
98
+ logging_frequency: 50
99
+ gradient_clipping: 1.0
100
+ gradient_accumulation_steps: 8
101
+ save_format: pt
102
+ save_final_checkpoint: false
103
+ optimizer:
104
+ name: AdamW
105
+ betas:
106
+ - 0.9
107
+ - 0.95
108
+ eps: 1.0e-08
109
+ weight_decay: 1.0e-08
110
+ resume_accelerate_checkpoint: /mnt/miaochengyu/starvla-infoflow-runtime/runs/florence-scratch-official-100k/florence-scratch-uniform-seed-42-official100k-mb4-eval1k-20260726/checkpoints/steps_20000_accelerate
111
+ resume_checkpoint_integrity_manifest: /home/miaochengyu/starVLA-infoflow-codex/protocols/bridgert/common_start_accelerate_integrity_20260730.json
112
+ resume_checkpoint_integrity_manifest_sha256: 899d2cef3f73191e11f7a1628afc05b60c80af5816b8fd77c1c69e90d5c9ff39
113
+ branch_parent_seed: 42
114
+ branch_rng_seed: 117465
115
+ model_rng_seed: 588643
116
+ stop_after_steps: 22000
117
+ config_yaml: /home/miaochengyu/starVLA-infoflow-codex/examples/InfoFlow/train_files/server/generated/infoflow_confirmatory_20k_20260730/confirmatory_residual_seed_117465.yaml
118
+ output_dir: /mnt/miaochengyu/starvla-infoflow-runtime/runs/infoflow-confirmatory-22k-20260730/infoflow-confirmatory-residual-seed-117465
settings/florence_bridge/configs/reference/uniform_seed117465_full.yaml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ run_id: infoflow-confirmatory-uniform-seed-117465
2
+ run_root_dir: /mnt/miaochengyu/starvla-infoflow-runtime/runs/infoflow-confirmatory-22k-20260730
3
+ seed: 117465
4
+ wandb_entity: null
5
+ wandb_project: InfoFlow-StarVLA-BridgeRT
6
+ is_debug: false
7
+ version_id: '0.21'
8
+ framework:
9
+ name: QwenGR00T
10
+ qwenvl:
11
+ base_vlm: /mnt/miaochengyu/starvla-infoflow-runtime/playground/Pretrained_models/Florence-2-large
12
+ attn_implementation: flash_attention_2
13
+ vl_hidden_dim: 2048
14
+ action_model:
15
+ action_model_type: DiT-B
16
+ action_hidden_dim: 1024
17
+ hidden_size: 1024
18
+ add_pos_embed: true
19
+ max_seq_len: 1024
20
+ action_dim: 7
21
+ state_dim: 7
22
+ action_horizon: 16
23
+ repeated_diffusion_steps: 8
24
+ noise_beta_alpha: 1.5
25
+ noise_beta_beta: 1.0
26
+ noise_s: 0.999
27
+ num_timestep_buckets: 1000
28
+ num_inference_timesteps: 4
29
+ num_target_vision_tokens: 32
30
+ diffusion_model_cfg:
31
+ cross_attention_dim: 1024
32
+ dropout: 0.2
33
+ final_dropout: true
34
+ interleave_self_attention: true
35
+ norm_type: ada_norm
36
+ num_layers: 16
37
+ output_dim: 1024
38
+ positional_embeddings: null
39
+ future_action_window_size: 15
40
+ past_action_window_size: 0
41
+ dino:
42
+ dino_backbone: dinov2_vits14
43
+ datasets:
44
+ vla_data:
45
+ dataset_py: lerobot_datasets
46
+ data_root_dir: /mnt/miaochengyu/starvla-infoflow-runtime/playground/Datasets/OXE_LEROBOT_DATASET
47
+ data_mix: bridge_rt_infoflow
48
+ action_type: delta_ee
49
+ action_mode: abs
50
+ precomputed_statistics_path: /mnt/miaochengyu/starvla-infoflow-runtime/playground/Pretrained_models/Florence-GR00T-Bridge-RT-1/dataset_statistics.json
51
+ precomputed_statistics_key_map:
52
+ bridge_orig_lerobot: oxe_bridge
53
+ fractal20220817_data_lerobot: oxe_rt1
54
+ CoT_prompt: Your task is {instruction}. To identify the key objects for your task.
55
+ Locate their bounding boxes in [x1,y1,x2,y2] format.
56
+ per_device_batch_size: 4
57
+ load_all_data_for_training: true
58
+ obs_image_size:
59
+ - 224
60
+ - 224
61
+ video_backend: torchvision_av
62
+ num_workers: 4
63
+ balance_dataset_weights: false
64
+ balance_trajectory_weights: false
65
+ traceable_sampling: true
66
+ expected_world_size: 2
67
+ dataset_provenance_path: /home/miaochengyu/starVLA-infoflow-codex/protocols/bridgert/data_provenance.json
68
+ dataset_content_fingerprint_path: /mnt/miaochengyu/starvla-infoflow-runtime/manifests/bridgert/content_fingerprints.json
69
+ valid_anchor_manifest_path: /mnt/miaochengyu/starvla-infoflow-runtime/manifests/bridgert/valid_anchor_manifest_florence_scratch_v1.json
70
+ valid_anchor_manifest_migration_path: /home/miaochengyu/starVLA-infoflow-codex/protocols/bridgert/valid_anchor_manifest_rng_migration_20260729.json
71
+ temporal_proposal_path: null
72
+ transform_rng_seed: 298226
73
+ trainer:
74
+ use_deepspeed: true
75
+ max_train_steps: 100000
76
+ num_warmup_steps: 5000
77
+ save_interval: null
78
+ save_steps:
79
+ - 20500
80
+ - 21000
81
+ - 22000
82
+ evaluation_snapshot_interval: 1000
83
+ eval_interval: 100001
84
+ repeated_diffusion_steps: 4
85
+ pretrained_checkpoint: null
86
+ is_resume: true
87
+ allow_model_only_resume: false
88
+ learning_rate:
89
+ base: 3.0e-05
90
+ qwen_vl_interface: 1.0e-05
91
+ action_model: 0.0001
92
+ lr_scheduler_type: cosine_with_min_lr
93
+ scheduler_specific_kwargs:
94
+ min_lr: 5.0e-07
95
+ freeze_modules: ''
96
+ trainable_modules: ''
97
+ frozen_modules_eval: false
98
+ logging_frequency: 50
99
+ gradient_clipping: 1.0
100
+ gradient_accumulation_steps: 8
101
+ save_format: pt
102
+ save_final_checkpoint: false
103
+ optimizer:
104
+ name: AdamW
105
+ betas:
106
+ - 0.9
107
+ - 0.95
108
+ eps: 1.0e-08
109
+ weight_decay: 1.0e-08
110
+ resume_accelerate_checkpoint: /mnt/miaochengyu/starvla-infoflow-runtime/runs/florence-scratch-official-100k/florence-scratch-uniform-seed-42-official100k-mb4-eval1k-20260726/checkpoints/steps_20000_accelerate
111
+ resume_checkpoint_integrity_manifest: /home/miaochengyu/starVLA-infoflow-codex/protocols/bridgert/common_start_accelerate_integrity_20260730.json
112
+ resume_checkpoint_integrity_manifest_sha256: 899d2cef3f73191e11f7a1628afc05b60c80af5816b8fd77c1c69e90d5c9ff39
113
+ branch_parent_seed: 42
114
+ branch_rng_seed: 117465
115
+ model_rng_seed: 588643
116
+ stop_after_steps: 22000
117
+ config_yaml: /home/miaochengyu/starVLA-infoflow-codex/examples/InfoFlow/train_files/server/generated/infoflow_confirmatory_20k_20260730/confirmatory_uniform_seed_117465.yaml
118
+ output_dir: /mnt/miaochengyu/starvla-infoflow-runtime/runs/infoflow-confirmatory-22k-20260730/infoflow-confirmatory-uniform-seed-117465
settings/florence_bridge/frameskip/steps_20500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48667f000750716c82b5ee1cebf67f8b6ab1c282d5b06588485daf577d7c0701
3
+ size 2154184469
settings/florence_bridge/keyframe/steps_20500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:560ba3cc4ff1649280d7acb559f7392f4b611c4416849c5cc17e236092c6f6cb
3
+ size 2154184469
settings/florence_bridge/loss_is/steps_20500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c12d8e09042f3b24720c0bf7345e8facb920d8db095804c7a24ff25f34a8d36
3
+ size 2154184469
settings/florence_bridge/residual/steps_20500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d443c8d9cc3caf1ffab4d75a9e35d849d79ed1abe01626e8a93757d64cb3d97e
3
+ size 2154184469
settings/florence_bridge/uniform/steps_20500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e363c4a70f64868f1cad77479f3f06f906fd3fe47a2f40174fd78afafff32147
3
+ size 2154184469
settings/florence_robotwin/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Florence–RoboTwin
2
+
3
+ - Backbone: Florence-2-large with the RoboTwin three-view, 14D action interface.
4
+ - Common start: step 10,000; full two-rank resumable state.
5
+ - Continuation endpoint: step 10,500 (+500 optimizer updates).
6
+ - Continuation seed: `484370`.
7
+ - Evaluation: the fixed 20-task RoboTwin panel, Easy (`demo_clean`) and Hard (`demo_randomized`), 25 episodes per task and condition.
8
+ - Training contract: two GPUs and the server-authoritative Florence–RoboTwin batch/optimizer configuration shipped with the setting assets.
9
+
10
+ Method endpoints are model-only evaluation snapshots. Resume new branches from `common_start/steps_10000_accelerate/`.
11
+
12
+ Method dependencies:
13
+
14
+ - Residual: RoboTwin K=8 residual proposal, 14D trajectory support and ordinary p/q correction.
15
+ - FrameSkip: RoboTwin cache; the selected physical timestep is applied consistently across all camera modalities.
16
+ - Keyframe: RoboTwin 14D KF cache and action-statistics adapter.
17
+ - Loss-IS: active Loss-IS candidate sampler with the RoboTwin model interface and paired flow-noise/time reuse.
settings/florence_robotwin/frameskip/steps_10500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03745fecff8f7e98da348cb95d38ed27e840f4d6856d63b299a3468e30e73c55
3
+ size 2152621885
settings/florence_robotwin/keyframe/steps_10500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f2fcde1201f78dd169c9da1b2c07cc8e5e54720a5d613f9e34dffb2dd194010
3
+ size 2152621885
settings/florence_robotwin/loss_is/steps_10500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2b0d1c85f74ac1d72b2f6704e3d6acd1fd7595a5801629d6f96ba2246028ec7
3
+ size 2152621885
settings/qwen_bridge/README.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Qwen3-VL-4B–Bridge
2
+
3
+ - Backbone: Qwen3-VL-4B-Instruct with DiT-B flow-matching action head.
4
+ - Common start: step 29,000; paired model and training-state files are both required for exact continuation.
5
+ - Continuation endpoint: step 29,500 (+500 optimizer updates).
6
+ - Common-start training seed: `42`; the historical continuation inherits the saved 29K RNG/data-order state.
7
+ - Evaluation: SimplerEnv WidowX, tasks Stack/Carrot/Spoon/Eggplant, policy seeds `518957, 765353, 686765, 516408`, 24 episodes per task and seed, no video.
8
+
9
+ Method endpoints are model-only evaluation snapshots. Exact continuation from 29K requires both files under `common_start/` plus the included configuration and environment description.
10
+
11
+ Method dependencies:
12
+
13
+ - Residual: Qwen–Bridge K=8 residual proposal and ordinary p/q correction.
14
+ - FrameSkip: Qwen–Bridge FrameSkip cache and adapter.
15
+ - Keyframe: Qwen–Bridge KF cache and 7D action-statistics adapter.
16
+ - Loss-IS: active candidate sampling, candidate factor 3, replacement sampling and ordinary importance correction.
settings/qwen_bridge/common_start/steps_29000_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d23a05fbe874a7cf5e100378c29aa043dd4594e2777a10c6306d32c493f35f61
3
+ size 9199045796
settings/qwen_bridge/common_start/steps_29000_training_state.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd81e7a88a5a4fc06ed8d445e002d00a236e16385d617c94cf101e6f944cf276
3
+ size 9346430417
settings/qwen_bridge/dependencies/AGENTS.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Qwen–Bridge 29K Common Start 操作约束
2
+
3
+ 本目录用于从固定 29K common start 开展 continuation 实验。操作前阅读 `README.md`、`ENVIRONMENT.md`、`MULTISEED_PROTOCOL.md` 和 [Bridge 训练与测评种子总表](https://huggingface.co/mmmmmcyaaa/ReTime/blob/main/BRIDGE_SEED_PROTOCOL.md)。
4
+
5
+ ## 不可改变
6
+
7
+ - 起点必须同时加载 `steps_29000_pytorch_model.pt` 与 `steps_29000_training_state.pt`。
8
+ - common-start 历史训练 seed 是 `42`。
9
+ - 每个主动 reseed realization 下,各比较方法必须共享同一个 continuation training seed。
10
+ - 新的 Qwen paired continuation seed 清单待定。
11
+ - 29K 与 29.5K checkpoint 的 Rebuttal 测评固定使用 policy seeds `518957, 765353, 686765, 516408`。
12
+ - 每个 checkpoint 的正式测评是 4 seeds × 4 tasks × 24 episodes = 384 rollouts。
13
+ - global batch、学习率、scheduler、训练预算、world size、数据与 support 合同必须在方法间保持一致。
14
+
15
+ ## 禁止
16
+
17
+ - 禁止把 evaluation seed 当成 training seed。
18
+ - 区分历史 `seed=42` 的完整恢复与未来主动 reseed。
19
+ - 禁止只恢复模型而丢弃 optimizer、scheduler、RNG 或 data-order。
20
+ - 禁止新增代码、实现、绝对路径、manifest 自指等工程哈希启动门。
21
+
22
+ ## 允许的可移植性修改
23
+
24
+ - 可修改本机数据、基础模型与输出目录的绝对路径。
25
+ - 可按目标硬件调整启动器,但不得改变方法间的 global batch 或训练预算。
26
+ - 可记录普通传输审计信息,但不得让它成为训练启动条件。
settings/qwen_bridge/dependencies/ENVIRONMENT.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Qwen–Bridge 29K Common Start 环境
2
+
3
+ ## 系统与硬件
4
+
5
+ - Ubuntu 22.04
6
+ - Linux kernel 6.8.0-138
7
+ - NVIDIA driver 570.211.01
8
+ - 历史训练硬件:RTX 4090
9
+ - Python 3.11.13
10
+
11
+ ## 核心软件
12
+
13
+ | 包 | 版本 |
14
+ |---|---|
15
+ | PyTorch | 2.7.1+cu126 |
16
+ | CUDA runtime | 12.6 |
17
+ | cuDNN | 9.5.0.1 |
18
+ | torchvision | 0.22.1 |
19
+ | transformers | 4.57.0 |
20
+ | accelerate | 1.13.0 |
21
+ | bitsandbytes | 0.50.0 |
22
+ | deepspeed | 0.19.2(本历史 run 未启用) |
23
+ | flash-attn | 2.7.4.post1 |
24
+ | huggingface-hub | 0.36.2 |
25
+ | omegaconf | 2.3.0 |
26
+ | peft | 0.19.1 |
27
+ | safetensors | 0.5.3 |
28
+ | tokenizers | 0.22.2 |
29
+ | wandb | 0.23.1 |
30
+ | numpy | 1.26.4 |
31
+ | pandas | 2.2.3 |
32
+ | polars | 1.30.0 |
33
+ | datasets | 3.6.0 |
34
+ | lerobot | 0.1.0 |
35
+ | einops | 0.8.1 |
36
+ | timm | 1.0.24 |
37
+ | av | 17.0.0 |
38
+
39
+ ## 外部依赖(不重复上传)
40
+
41
+ - Base VLM:`Qwen3-VL-4B-Instruct`。需单独从官方模型源取得 tokenizer、processor 和基础权重。
42
+ - Bridge/OXE 数据:`bridge_rt_infoflow` 对应的 OXE LeRobot 数据及 statistics。
43
+ - StarVLA/OPTR 源码:使用交接仓库中与本配置匹配的 QwenGR00T、DiT-B action head、dataset 和 trainer 实现。
44
+
45
+ ## 历史训练合同
46
+
47
+ - framework:QwenGR00T。
48
+ - action model:DiT-B,16 layers,dropout 0.2。
49
+ - action/state dim:7/7。
50
+ - action horizon:16。
51
+ - BF16。
52
+ - 单卡训练。
53
+ - per-device batch:2。
54
+ - gradient accumulation:24。
55
+ - global batch:48。
56
+ - optimizer:AdamW8bit,betas=(0.9, 0.95),eps=1e-8,weight decay=1e-8。
57
+ - base LR:3e-5;VLM interface LR:1e-5;action model LR:1e-4。
58
+ - cosine scheduler,minimum LR=5e-7,100K scheduler horizon,10K warmup。
59
+ - gradient clipping:1.0。
60
+ - 日志频率:每 10 updates。
61
+ - 29K checkpoint 训练时全部约 4.599B 参数可训练,`freeze_modules` 为空。
62
+
63
+ ## 恢复要求
64
+
65
+ 必须同时加载:
66
+
67
+ 1. `steps_29000_pytorch_model.pt`;
68
+ 2. `steps_29000_training_state.pt`。
69
+
70
+ 后者包含 optimizer、scheduler、RNG 与 data-order counter。只载入模型权重不是完整 common-start 恢复。
71
+
72
+ 不得新增 implementation/code/path/current-manifest SHA 启动门。启动前只核对文件存在且可加载、step=29000、数据与 support 语义一致、global batch 与训练预算正确。
settings/qwen_bridge/dependencies/MULTISEED_PROTOCOL.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Qwen–Bridge continuation 与测评种子
2
+
3
+ Florence 和 Qwen 的 Rebuttal 训练、测评种子统一登记在 [Bridge 训练与测评种子总表](https://huggingface.co/mmmmmcyaaa/ReTime/blob/main/BRIDGE_SEED_PROTOCOL.md)。
4
+
5
+ 29K common start 的基础训练 seed 为 `42`。历史 29K → 29.5K continuation 配置为 `seed: 42`,继承 checkpoint 中保存的 RNG 与数据抽取位置。
6
+
7
+ Rebuttal 若新增主动 reseed 的 Qwen continuation,训练 seed 清单待定。同一组的配对运行共享 continuation seed,并以相同方式初始化 Python、NumPy、PyTorch CPU/CUDA、dataloader、采样和模型 RNG。模型、optimizer、scheduler、起始 step、batch、学习率和训练预算沿用共同协议。
8
+
9
+ 29K 与 29.5K checkpoint 的 Rebuttal 测评统一使用 `518957, 765353, 686765, 516408`。每组评测为四个 policy seeds × Stack、Carrot、Spoon、Eggplant 四任务 × 24 episodes,共 384 rollouts,BF16、无视频。
settings/qwen_bridge/dependencies/config.full.yaml ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ run_id: qwen3vl-groot-bridge-commonstart-scratch-15k-seed42
2
+ run_root_dir: /data/yanfei/qwen_bridge_commonstart_20k_to30k_20260911/runs
3
+ seed: 42
4
+ wandb_entity: null
5
+ wandb_project: QwenBridge-CommonStart
6
+ is_debug: false
7
+ version_id: '0.21'
8
+ framework:
9
+ name: QwenGR00T
10
+ qwenvl:
11
+ base_vlm: /home/yanfei/miaochengyu/robotwin-infoflow/legacy_bridge_runtime/compat/mnt/miaochengyu/starvla-infoflow-runtime/playground/Pretrained_models/Qwen3-VL-4B-Instruct
12
+ attn_implementation: flash_attention_2
13
+ vl_hidden_dim: 2048
14
+ enable_gradient_checkpointing: true
15
+ action_model:
16
+ action_model_type: DiT-B
17
+ action_hidden_dim: 2048
18
+ hidden_size: 1024
19
+ add_pos_embed: true
20
+ max_seq_len: 1024
21
+ action_dim: 7
22
+ state_dim: 7
23
+ action_horizon: 16
24
+ repeated_diffusion_steps: 8
25
+ noise_beta_alpha: 1.5
26
+ noise_beta_beta: 1.0
27
+ noise_s: 0.999
28
+ num_timestep_buckets: 1000
29
+ num_inference_timesteps: 4
30
+ num_target_vision_tokens: 32
31
+ diffusion_model_cfg:
32
+ cross_attention_dim: 2560
33
+ dropout: 0.2
34
+ final_dropout: true
35
+ interleave_self_attention: true
36
+ norm_type: ada_norm
37
+ num_layers: 16
38
+ output_dim: 1024
39
+ positional_embeddings: null
40
+ future_action_window_size: 15
41
+ past_action_window_size: 0
42
+ datasets:
43
+ vla_data:
44
+ dataset_py: lerobot_datasets
45
+ data_root_dir: /data/yanfei/qwen_bridge_assets/OXE_LEROBOT_DATASET
46
+ data_mix: bridge_rt_infoflow
47
+ action_type: delta_ee
48
+ action_mode: abs
49
+ precomputed_statistics_path: /home/yanfei/miaochengyu/robotwin-infoflow/legacy_bridge_runtime/compat/mnt/miaochengyu/starvla-infoflow-runtime/playground/Pretrained_models/Florence-GR00T-Bridge-RT-1/dataset_statistics.json
50
+ precomputed_statistics_key_map:
51
+ bridge_orig_lerobot: oxe_bridge
52
+ fractal20220817_data_lerobot: oxe_rt1
53
+ CoT_prompt: Your task is {instruction}. To identify the key objects for your task.
54
+ Locate their bounding boxes in [x1,y1,x2,y2] format.
55
+ per_device_batch_size: 2
56
+ load_all_data_for_training: true
57
+ obs:
58
+ - image_0
59
+ obs_image_size:
60
+ - 224
61
+ - 224
62
+ video_backend: torchvision_av
63
+ num_workers: 1
64
+ balance_dataset_weights: false
65
+ balance_trajectory_weights: false
66
+ traceable_sampling: true
67
+ expected_world_size: 1
68
+ dataset_provenance_path: /home/yanfei/miaochengyu/robotwin-infoflow/legacy_bridge_runtime/compat/home/miaochengyu/starVLA-infoflow-codex/protocols/bridgert/data_provenance.json
69
+ dataset_content_fingerprint_path: /home/yanfei/miaochengyu/robotwin-infoflow/legacy_bridge_runtime/compat/mnt/miaochengyu/starvla-infoflow-runtime/manifests/bridgert/content_fingerprints.json
70
+ valid_anchor_manifest_path: /home/yanfei/miaochengyu/robotwin-infoflow/legacy_bridge_runtime/compat/mnt/miaochengyu/starvla-infoflow-runtime/manifests/bridgert/valid_anchor_manifest_florence_scratch_v1.json
71
+ valid_anchor_manifest_migration_path: /home/yanfei/miaochengyu/robotwin-infoflow/legacy_bridge_runtime/compat/home/miaochengyu/starVLA-infoflow-codex/protocols/bridgert/valid_anchor_manifest_rng_migration_20260729.json
72
+ temporal_proposal_path: null
73
+ trainer:
74
+ use_deepspeed: false
75
+ model_dtype: bfloat16
76
+ max_train_steps: 100000
77
+ stop_after_steps: 15000
78
+ initial_completed_steps: 0
79
+ num_warmup_steps: 10000
80
+ repeated_diffusion_steps: 4
81
+ evaluation_snapshot_interval: null
82
+ save_interval: null
83
+ save_steps:
84
+ - 21000
85
+ - 22000
86
+ - 23000
87
+ - 24000
88
+ - 25000
89
+ - 26000
90
+ - 27000
91
+ - 28000
92
+ - 29000
93
+ - 30000
94
+ save_final_checkpoint: false
95
+ eval_interval: null
96
+ pretrained_checkpoint: null
97
+ is_resume: true
98
+ allow_model_only_resume: false
99
+ learning_rate:
100
+ base: 3.0e-05
101
+ qwen_vl_interface: 1.0e-05
102
+ action_model: 0.0001
103
+ lr_scheduler_type: cosine_with_min_lr
104
+ scheduler_specific_kwargs:
105
+ min_lr: 5.0e-07
106
+ freeze_modules: ''
107
+ trainable_modules: ''
108
+ frozen_modules_eval: false
109
+ logging_frequency: 10
110
+ gradient_clipping: 1.0
111
+ gradient_accumulation_steps: 24
112
+ save_format: pt
113
+ optimizer:
114
+ name: AdamW8bit
115
+ betas:
116
+ - 0.9
117
+ - 0.95
118
+ eps: 1.0e-08
119
+ weight_decay: 1.0e-08
120
+ operational_stop_after_steps: 30000
121
+ config_yaml: /home/yanfei/miaochengyu/qwen_bridge_commonstart_4090_20260910/configs/qwen_bridge_commonstart_scratch_15k.yaml
122
+ output_dir: /data/yanfei/qwen_bridge_commonstart_20k_to30k_20260911/runs/qwen3vl-groot-bridge-commonstart-scratch-15k-seed42
settings/qwen_bridge/dependencies/requirements-qwen-bridge.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ torch==2.7.1
2
+ torchvision==0.22.1
3
+ transformers==4.57.0
4
+ accelerate==1.13.0
5
+ bitsandbytes==0.50.0
6
+ deepspeed==0.19.2
7
+ flash-attn==2.7.4.post1
8
+ huggingface-hub==0.36.2
9
+ omegaconf==2.3.0
10
+ peft==0.19.1
11
+ safetensors==0.5.3
12
+ tokenizers==0.22.2
13
+ wandb==0.23.1
14
+ numpy==1.26.4
15
+ pandas==2.2.3
16
+ polars==1.30.0
17
+ datasets==3.6.0
18
+ lerobot==0.1.0
19
+ einops==0.8.1
20
+ timm==1.0.24
21
+ av==17.0.0
settings/qwen_bridge/frameskip/steps_29500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4bb2fdbc798a64ee8d648ae55ed7bd620279e1165db39da73b2d4d34c0ab24cb
3
+ size 9199045796
settings/qwen_bridge/keyframe/steps_29500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d68f460d5eae83e38be8ca10958f624d25b99939212ba933ce4d0c8fe6470604
3
+ size 9199045796
settings/qwen_bridge/loss_is/steps_29500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26ec40656e644374fac557c19e9344681391989d448cfc023e9391f02f1b7068
3
+ size 9199045796
settings/qwen_robotwin/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Qwen3-VL-4B–RoboTwin
2
+
3
+ - Backbone: Qwen3-VL-4B-Instruct with the RoboTwin three-view, 14D action interface.
4
+ - Common start: step 11,000; full two-rank ZeRO resumable state.
5
+ - Continuation endpoint: step 11,500 (+500 optimizer updates).
6
+ - Continuation seed: `484370`; transform seed `289726`; model seed `721927`.
7
+ - Evaluation: the fixed 20-task RoboTwin panel, Easy (`demo_clean`) and Hard (`demo_randomized`), 25 episodes per task and condition.
8
+ - Training contract: two GPUs, per-device batch 5, gradient accumulation 4, global batch 40.
9
+
10
+ Method endpoints are consolidated model-only evaluation snapshots. Resume new branches from `common_start/steps_11000_accelerate/`.
11
+
12
+ Method dependencies:
13
+
14
+ - Residual: RoboTwin K=8 residual proposal, 14D support and ordinary p/q correction.
15
+ - FrameSkip: RoboTwin cache with synchronized temporal remapping for all camera views.
16
+ - Keyframe: 14D KF cache/action-statistics implementation.
17
+ - Loss-IS: active candidate sampling with paired flow-noise/time reuse and the Qwen–RoboTwin model interface.
settings/qwen_robotwin/frameskip/steps_11500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:018797073168650b9db654c04be89818f8bd188821ffdb29122a427497755ad9
3
+ size 18394366619
settings/qwen_robotwin/keyframe/steps_11500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7adca3f3032ab4e105e0b9cda7b54cf6052fbcb5e038d56bc413dc42c5cb0fcb
3
+ size 18394384980
settings/qwen_robotwin/loss_is/steps_11500_pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9219baf845811fe6a7f4ddccf762e289aed7fa3a6873bf2d25b8d3e3091d8cbc
3
+ size 18394384980