Orangerl commited on
Commit
4e5af0f
·
verified ·
1 Parent(s): 654a560

Publish Multi-WAM step 17700 reproducible continuation

Browse files
Files changed (26) hide show
  1. PROGRESS_20261014.md +88 -0
  2. README.md +12 -12
  3. release-20261014/README.md +10 -0
  4. release-20261014/RELEASE_MANIFEST.json +142 -0
  5. release-20261014/SHA256SUMS +24 -0
  6. release-20261014/cluster-scripts/hold_8gpu_memory.py +109 -0
  7. release-20261014/cluster-scripts/launch_joint_8gpu_04.sh +70 -0
  8. release-20261014/cluster-scripts/launch_joint_8gpu_09.sh +69 -0
  9. release-20261014/cluster-scripts/launch_joint_8gpu_idle.sh +70 -0
  10. release-20261014/cluster-scripts/occupy_gpu_memory.py +63 -0
  11. release-20261014/cluster-scripts/probe_joint_idle_4gpu.sh +35 -0
  12. release-20261014/cluster-scripts/probe_joint_idle_single_gpu.sh +34 -0
  13. release-20261014/cluster-scripts/wait_for_8gpu_node.py +75 -0
  14. release-20261014/cluster-scripts/wait_idle8_migrate.py +470 -0
  15. release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/best_validation.json +10 -0
  16. release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/metrics.jsonl +0 -0
  17. release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/qwen_online_identity.json +9 -0
  18. release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/resolved_config.json +469 -0
  19. release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/validation.jsonl +24 -0
  20. release-20261014/patches/step12531_to_step17700_code.patch +174 -0
  21. release-20261014/scripts/download_release.sh +22 -0
  22. release-20261014/scripts/relocate_checkpoint_identity.py +66 -0
  23. release-20261014/scripts/restore_release.sh +42 -0
  24. release-20261014/scripts/resume_8gpu.sh +62 -0
  25. release-20261014/scripts/verify_release.py +93 -0
  26. skills/multi-wam-joint-continue/SKILL.md +45 -0
PROGRESS_20261014.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Multi-WAM joint continuation, 2026-10-14
2
+
3
+ The most recent **complete and resumable** checkpoint is joint World+Action
4
+ **step 17700 / 55000**. The 8-GPU run logged metrics through step 17710, then
5
+ received SIGTERM while its DataLoader workers were active. Step 17710 is an
6
+ observation only; the release resumes from step 17700. Training has not
7
+ completed, and no new closed-loop evaluation is claimed.
8
+
9
+ ## Lineage and training contract
10
+
11
+ The frozen starting assets are World-v12 step 25066, Action-v13 step 23016,
12
+ LingBot codec step 125000, and Qwen3-VL-2B-Instruct from the October 10 release.
13
+ The published joint step 12531 used 24 ranks. The continuation changed to 8 ranks,
14
+ then to per-device batch 15 and accumulation 1, retaining the full optimizer,
15
+ scheduler, sampler and RNG state through those migrations. The latest checkpoint
16
+ records world size 8, global batch 120, target 55000 steps, World LR 1e-5,
17
+ Action LR 3e-5, warmup 500, 10 differentiable World rollout steps, and
18
+ `1 × World FM + 1 × Action FM` with latent and pixel loss weights zero.
19
+ Qwen and codec remain frozen. Exact source, manifests and other inputs are
20
+ bound by SHA-256 values in `trainer_state.json`.
21
+
22
+ | Observation | Value |
23
+ |---|---:|
24
+ | Complete checkpoint | 17700 |
25
+ | Last logged optimizer step | 17710 |
26
+ | Checkpoint 17700 step time | 35.92 s/step |
27
+ | Checkpoint 17700 throughput | 3.34 samples/s across 8 GPUs |
28
+ | Peak reserved GPU memory, max rank | 157.94 GiB |
29
+ | Checkpoint 17700 training World FM / Action FM | 0.16577 / 0.00218 |
30
+ | Latest validation, step 17600, World FM / Action FM | 0.24060 / 0.00770 |
31
+ | Best fixed-seed Action FM validation | 0.00664 at step 16600 |
32
+
33
+ Training used eight NVIDIA B20Z GPUs on one node, task/domain-balanced
34
+ RoboTwin 2.0 ALOHA data, three synchronized views, 20 Hz sampled RGB/action,
35
+ and 10 Hz codec latents. The raw dataset is external; the pinned dataset
36
+ revision and its download script are carried forward from the October 10 layer.
37
+ The October 10 closed-loop observation (4437/9600 on 96/100 completed
38
+ task-domain groups) belongs to step 12531 and is **not** an evaluation of
39
+ step 17700.
40
+
41
+ ## What is published
42
+
43
+ `release-20261014/archives/joint-checkpoint-17700.tar.zst` contains all eight
44
+ FSDP shards, eight rank-local sampler/RNG states and the trainer metadata.
45
+ `source-code-joint17700.tar.zst` contains the exact current `mira_09` source;
46
+ `cluster-scripts/` records the node-specific launch and migration code.
47
+ The new release also includes resolved config, metrics, validation history,
48
+ integrity checks, a path relocation helper, and an 8-GPU resume launcher.
49
+ The older `release-20261010/` supplies packed environments and frozen assets;
50
+ the earlier snapshot tags remain unchanged. No credential or raw RoboTwin
51
+ archive is published.
52
+
53
+ ## Restore and resume
54
+
55
+ On a new machine, install the Hugging Face `hf` CLI, download the pinned
56
+ snapshot, restore it into an **empty** workspace, download the pinned external
57
+ dataset, then run the static verifier with `--require-dataset`:
58
+
59
+ ```bash
60
+ bash release-20261014/scripts/download_release.sh /path/to/download
61
+ bash /path/to/download/release-20261014/scripts/restore_release.sh \
62
+ /path/to/download /path/to/empty/workspace
63
+ bash /path/to/download/skills/multi-wam-joint-reproduce/scripts/download_dataset.sh \
64
+ /path/to/empty/workspace
65
+ /path/to/empty/workspace/conda/envs/mira/bin/python \
66
+ /path/to/download/release-20261014/scripts/verify_release.py \
67
+ /path/to/empty/workspace --require-dataset
68
+ JOINT_PREFLIGHT_ONLY=1 bash /path/to/download/release-20261014/scripts/resume_8gpu.sh \
69
+ /path/to/empty/workspace
70
+ bash /path/to/download/release-20261014/scripts/resume_8gpu.sh \
71
+ /path/to/empty/workspace
72
+ ```
73
+
74
+ The last two commands require one node with eight compatible GPUs. The
75
+ preflight restores the published optimizer state without advancing a step.
76
+ For SwanLab online tracking, set `SWANLAB_TOKEN_FILE` to a destination-local
77
+ credential file before the final command; without it, metrics are still saved
78
+ locally. The published checkpoint metadata records an absolute Qwen path;
79
+ `restore_release.sh` checks the original identity and changes only that path
80
+ in the restored copy, leaving the published archive untouched.
81
+ It stores the stopped run's full metric history under
82
+ `release_history/joint17700/`; the resumed output retains history through
83
+ step 17700 and the prior best-validation criterion. The uncheckpointed
84
+ step-17710 observation is excluded from the resumed metric sequence.
85
+
86
+ Use the included exact batch, accumulation and 55000-step schedule when
87
+ resuming. The launcher reads the checkpoint in the output directory by
88
+ automatic resume; it does not invoke another batch or world-size migration.
README.md CHANGED
@@ -10,28 +10,28 @@ tags:
10
 
11
  # Multi-WAM reproducible handoff
12
 
13
- **Latest: 2026-10-10, joint World+Action step 12531.** The exact 24-rank training checkpoint (including optimizer, scheduler, sampler and RNG), its deploy export, source, two packed conda environments, split/statistics, eval code/evidence and videos are in [`release-20261010/`](release-20261010/). The earlier `snapshot-20260902-full` remains immutable and supplies four reused upstream assets: World-v12 step 25066, Action-v13 step 23016, codec step 125000 and Qwen3-VL-2B-Instruct. Raw RoboTwin data is external and **not** packaged.
14
 
15
- Read [progress](PROGRESS_20261010.md), the [reproduction skill](skills/multi-wam-joint-reproduce/SKILL.md), [release manifest](release-20261010/RELEASE_MANIFEST.json), and [checksums](release-20261010/SHA256SUMS). The old September training skill has been updated to route to the new protocol; old release files are historical, not the latest objective.
16
 
17
- This model trained on 50 RoboTwin 2.0 tasks, 26,950 train episodes (clean and randomized), three synchronized views, 20 Hz sampled RGB/action, and 10 Hz codec latents. World+Action are trainable; Qwen and codec are frozen. The run migrated per-GPU batch 3→5 at step 2449 with optimizer state retained, then stopped at step 12531 of a configured 55000 steps. The observed closed-loop result is **4437/9600 = 46.22% on 96/100 completed task-domain groups**, not a full paper-comparable C2C/C2R number; see progress for the four simulator failures and protocol caveats.
18
 
19
  ## Bootstrap on another machine (direct connection)
20
 
21
  ```bash
22
  unset http_proxy https_proxy all_proxy ftp_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY FTP_PROXY
23
  export NO_PROXY='*' no_proxy='*' HF_XET_HIGH_PERFORMANCE=1
24
- hf download Orangerl/multi-wam --revision snapshot-20261010-joint12531 \
25
- --include 'README.md' --include 'PROGRESS_20261010.md' \
26
- --include 'skills/multi-wam-joint-reproduce/**' \
27
- --local-dir multi-wam-hf
28
  cd multi-wam-hf
29
- bash skills/multi-wam-joint-reproduce/scripts/download_release.sh "$PWD"
30
- bash skills/multi-wam-joint-reproduce/scripts/restore_release.sh "$PWD" /path/to/empty/workspace
31
- bash skills/multi-wam-joint-reproduce/scripts/verify_release.sh /path/to/workspace
32
- bash skills/multi-wam-joint-reproduce/scripts/download_dataset.sh /path/to/workspace
 
33
  ```
34
 
35
- No credentials are in the payload. Set destination-local SwanLab/HF credentials yourself. The eval environment still needs a compatible NVIDIA driver and Vulkan renderer. Never treat the 96-group score as a complete official benchmark result.
36
 
37
  The 2026-09-02 historical summary remains in [PROGRESS_20260902.md](PROGRESS_20260902.md); its release and other earlier snapshots are preserved.
 
10
 
11
  # Multi-WAM reproducible handoff
12
 
13
+ **Latest: 2026-10-14, joint World+Action resumable step 17700.** The exact 8-rank checkpoint (including optimizer, scheduler, sampler and RNG), current source, run metadata and 8-GPU resume scripts are in [`release-20261014/`](release-20261014/). Training logged through step 17710 before stopping; step 17700 is the newest complete checkpoint. The earlier [`release-20261010/`](release-20261010/) supplies the packed environments and reused upstream assets: World-v12 step 25066, Action-v13 step 23016, codec step 125000 and Qwen3-VL-2B-Instruct. Raw RoboTwin data is external and **not** packaged.
14
 
15
+ Read the [latest progress and reproduction guide](PROGRESS_20261014.md), [continuation skill](skills/multi-wam-joint-continue/SKILL.md), [release manifest](release-20261014/RELEASE_MANIFEST.json), and [checksums](release-20261014/SHA256SUMS). The [October 10 progress report](PROGRESS_20261010.md) and its 24-rank release remain historical evidence.
16
 
17
+ This model trained on 50 RoboTwin 2.0 tasks, 26,950 train episodes (clean and randomized), three synchronized views, 20 Hz sampled RGB/action, and 10 Hz codec latents. World+Action are trainable; Qwen and codec are frozen. The latest continuation uses 8 GPUs, batch 15/GPU and a global batch of 120. The observed closed-loop result **4437/9600 = 46.22% on 96/100 completed task-domain groups** was measured on the older step-12531 model, not on step 17700; it is not a full paper-comparable C2C/C2R number.
18
 
19
  ## Bootstrap on another machine (direct connection)
20
 
21
  ```bash
22
  unset http_proxy https_proxy all_proxy ftp_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY FTP_PROXY
23
  export NO_PROXY='*' no_proxy='*' HF_XET_HIGH_PERFORMANCE=1
24
+ hf download Orangerl/multi-wam --revision snapshot-20261014-joint17700 \
25
+ --include 'README.md' --include 'PROGRESS_20261014.md' \
26
+ --include 'release-20261014/scripts/**' --local-dir multi-wam-hf
 
27
  cd multi-wam-hf
28
+ bash release-20261014/scripts/download_release.sh "$PWD"
29
+ bash release-20261014/scripts/restore_release.sh "$PWD" /path/to/empty/workspace
30
+ bash skills/multi-wam-joint-reproduce/scripts/download_dataset.sh /path/to/empty/workspace
31
+ /path/to/empty/workspace/conda/envs/mira/bin/python \
32
+ release-20261014/scripts/verify_release.py /path/to/empty/workspace --require-dataset
33
  ```
34
 
35
+ No credentials are in the payload. Set destination-local SwanLab/HF credentials yourself. The 8-GPU preflight and resume commands are in the [latest progress guide](PROGRESS_20261014.md). The eval environment still needs a compatible NVIDIA driver and Vulkan renderer. Never treat the 96-group score as a complete official benchmark result.
36
 
37
  The 2026-09-02 historical summary remains in [PROGRESS_20260902.md](PROGRESS_20260902.md); its release and other earlier snapshots are preserved.
release-20261014/README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Multi-WAM step-17700 continuation
2
+
3
+ The complete 8-rank joint World+Action checkpoint, exact current source,
4
+ run metadata and portable restore/resume scripts are in this directory.
5
+ See [progress](../PROGRESS_20261014.md) for the lineage, verified status and
6
+ commands. Verify every file against [SHA256SUMS](SHA256SUMS) before extraction.
7
+
8
+ This release depends on the unchanged October 10 bundle for its frozen model
9
+ assets, packed environments and pinned dataset instructions. The last logged
10
+ step was 17710; the last recoverable step is 17700.
release-20261014/RELEASE_MANIFEST.json ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "base_snapshot_tag": "snapshot-20261010-joint12531",
3
+ "credentials_included": false,
4
+ "external_raw_dataset_required": true,
5
+ "files": [
6
+ {
7
+ "bytes": 546,
8
+ "path": "release-20261014/README.md",
9
+ "sha256": "c71dce11fb9378f67a93960fba848b51d46fa427b81606a6604645886acfc7ec"
10
+ },
11
+ {
12
+ "bytes": 20599449877,
13
+ "path": "release-20261014/archives/joint-checkpoint-17700.tar.zst",
14
+ "sha256": "88abbd2fc5c8dbaf8f52d09234aacf392441ff772000227f683c0a3eb62a4c05"
15
+ },
16
+ {
17
+ "bytes": 1279062,
18
+ "path": "release-20261014/archives/source-code-joint17700.tar.zst",
19
+ "sha256": "d8d0a63c87135551988ca4d9a80031023a453fcebdfe4ca90b5217ef2c2d1eae"
20
+ },
21
+ {
22
+ "bytes": 3812,
23
+ "path": "release-20261014/cluster-scripts/hold_8gpu_memory.py",
24
+ "sha256": "e11a581498fa2fef2cf9c97f1ada76b283d4397caf1b1ad1c08280448bf9a220"
25
+ },
26
+ {
27
+ "bytes": 3423,
28
+ "path": "release-20261014/cluster-scripts/launch_joint_8gpu_04.sh",
29
+ "sha256": "ee5d4fad1fde21c20e624e236545d43f4bb7085f18d8e6aa8ed20faf22d1cafc"
30
+ },
31
+ {
32
+ "bytes": 3443,
33
+ "path": "release-20261014/cluster-scripts/launch_joint_8gpu_09.sh",
34
+ "sha256": "2cceba0528a9dbaf23ef9f5871e8d193f5c0db23aa9ff88f56733ed91ac30da4"
35
+ },
36
+ {
37
+ "bytes": 3519,
38
+ "path": "release-20261014/cluster-scripts/launch_joint_8gpu_idle.sh",
39
+ "sha256": "35aa2dd171fd95b12f66b8f983c36e663d9dadb6960c946c3cfcfd194aa565a2"
40
+ },
41
+ {
42
+ "bytes": 1823,
43
+ "path": "release-20261014/cluster-scripts/occupy_gpu_memory.py",
44
+ "sha256": "cd3f025cd444ecff33cce8c433e5e16e3c2acac3f436e60565b3e6f6f2bfe9a0"
45
+ },
46
+ {
47
+ "bytes": 1882,
48
+ "path": "release-20261014/cluster-scripts/probe_joint_idle_4gpu.sh",
49
+ "sha256": "624b8cd6195633991cddcd2e3770b4a10c3ca6457f88960dd167ee0e68cdde4d"
50
+ },
51
+ {
52
+ "bytes": 1824,
53
+ "path": "release-20261014/cluster-scripts/probe_joint_idle_single_gpu.sh",
54
+ "sha256": "e14b8cf88e14e714da20b570207b7ce73649fb7caeab7df2c7802737d063dd9f"
55
+ },
56
+ {
57
+ "bytes": 2275,
58
+ "path": "release-20261014/cluster-scripts/wait_for_8gpu_node.py",
59
+ "sha256": "52ad4d8842bfd1c36d75d52897c480bef9ff2f528cd6020d3f95428e7ba33515"
60
+ },
61
+ {
62
+ "bytes": 21050,
63
+ "path": "release-20261014/cluster-scripts/wait_idle8_migrate.py",
64
+ "sha256": "5828545f4e6d33c56db7b078e4cf9c2458309d10cc746a05de6c966a9e37a16e"
65
+ },
66
+ {
67
+ "bytes": 276,
68
+ "path": "release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/best_validation.json",
69
+ "sha256": "8efd777e0dfd3009abb16fa217dfbe9a063c4482f862302804663bb1a05aedbe"
70
+ },
71
+ {
72
+ "bytes": 329950,
73
+ "path": "release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/metrics.jsonl",
74
+ "sha256": "88d01f697dd195c64c54c2de580e724d3122b10ad1d611c443e8ac96b331978c"
75
+ },
76
+ {
77
+ "bytes": 303,
78
+ "path": "release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/qwen_online_identity.json",
79
+ "sha256": "559c5fc13929b47d5a3dfaef0db39dc12876c8345506d93fa1ff6e3186834f8a"
80
+ },
81
+ {
82
+ "bytes": 12852,
83
+ "path": "release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/resolved_config.json",
84
+ "sha256": "f1b86e45ceafdeea6c0e11ec2675737c7b6b1119344add6f46aeda9bca083d6c"
85
+ },
86
+ {
87
+ "bytes": 4311,
88
+ "path": "release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/validation.jsonl",
89
+ "sha256": "9a7cc576274ae90941361a8f5b0aa552ff81be3b409f3209f37d2e8527979348"
90
+ },
91
+ {
92
+ "bytes": 9312,
93
+ "path": "release-20261014/patches/step12531_to_step17700_code.patch",
94
+ "sha256": "d9b5b909cec809ce85c01b57208f2cea6f7c21b7c39b3cb589e98857fc83d946"
95
+ },
96
+ {
97
+ "bytes": 1207,
98
+ "path": "release-20261014/scripts/download_release.sh",
99
+ "sha256": "c55a9cc91801091590224fded32cadfee45d67032ab058b13bb6e449ef466676"
100
+ },
101
+ {
102
+ "bytes": 2713,
103
+ "path": "release-20261014/scripts/relocate_checkpoint_identity.py",
104
+ "sha256": "609abe6528ff64650f7333d62c251d6f2dcb8b7b461d325672b2ab35a5795323"
105
+ },
106
+ {
107
+ "bytes": 2038,
108
+ "path": "release-20261014/scripts/restore_release.sh",
109
+ "sha256": "454227c974fb59a8a0abf9593a771c08ac0ca5be2110100c6b46a506eb61980e"
110
+ },
111
+ {
112
+ "bytes": 3043,
113
+ "path": "release-20261014/scripts/resume_8gpu.sh",
114
+ "sha256": "e233ee090b94d1a066b4cb7603b03daed38f4ff6c0339838d82f65b2c1b8e5c2"
115
+ },
116
+ {
117
+ "bytes": 4503,
118
+ "path": "release-20261014/scripts/verify_release.py",
119
+ "sha256": "349f6f38e84d3c948f254f1769a4d2606fd7a970577b7c95d7fcd3a0cf099c09"
120
+ }
121
+ ],
122
+ "format_version": 1,
123
+ "hub_repository": "Orangerl/multi-wam",
124
+ "joint_checkpoint": {
125
+ "archive_path": "release-20261014/archives/joint-checkpoint-17700.tar.zst",
126
+ "artifact_identity_sha256": "74250186f7e6e3d8e8e5c78f5830207ff14bcea32b3fbf6bfb9b2a5d34c16cc7",
127
+ "completed_steps": 17700,
128
+ "gradient_accumulation": 1,
129
+ "last_logged_step": 17710,
130
+ "per_device_batch": 15,
131
+ "target_steps": 55000,
132
+ "world_size": 8
133
+ },
134
+ "release": "joint-world-action-step17700-20261014",
135
+ "snapshot_tag": "snapshot-20261014-joint17700",
136
+ "source_archive_path": "release-20261014/archives/source-code-joint17700.tar.zst",
137
+ "source_patch_path": "release-20261014/patches/step12531_to_step17700_code.patch",
138
+ "source_revisions": {
139
+ "robotwin_dataset": "9dc9299c163db059931898a9f0852098a61155a1"
140
+ },
141
+ "swanlab_run": "https://swanlab.cn/@Oranger/Multi_WAM/runs/a2899881563c4bcc8f53f"
142
+ }
release-20261014/SHA256SUMS ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ c71dce11fb9378f67a93960fba848b51d46fa427b81606a6604645886acfc7ec release-20261014/README.md
2
+ e3fc8fc05c535fb044638353d22cb6a04855fbdd86098da40d9a7b7776036dea release-20261014/RELEASE_MANIFEST.json
3
+ 88abbd2fc5c8dbaf8f52d09234aacf392441ff772000227f683c0a3eb62a4c05 release-20261014/archives/joint-checkpoint-17700.tar.zst
4
+ d8d0a63c87135551988ca4d9a80031023a453fcebdfe4ca90b5217ef2c2d1eae release-20261014/archives/source-code-joint17700.tar.zst
5
+ e11a581498fa2fef2cf9c97f1ada76b283d4397caf1b1ad1c08280448bf9a220 release-20261014/cluster-scripts/hold_8gpu_memory.py
6
+ ee5d4fad1fde21c20e624e236545d43f4bb7085f18d8e6aa8ed20faf22d1cafc release-20261014/cluster-scripts/launch_joint_8gpu_04.sh
7
+ 2cceba0528a9dbaf23ef9f5871e8d193f5c0db23aa9ff88f56733ed91ac30da4 release-20261014/cluster-scripts/launch_joint_8gpu_09.sh
8
+ 35aa2dd171fd95b12f66b8f983c36e663d9dadb6960c946c3cfcfd194aa565a2 release-20261014/cluster-scripts/launch_joint_8gpu_idle.sh
9
+ cd3f025cd444ecff33cce8c433e5e16e3c2acac3f436e60565b3e6f6f2bfe9a0 release-20261014/cluster-scripts/occupy_gpu_memory.py
10
+ 624b8cd6195633991cddcd2e3770b4a10c3ca6457f88960dd167ee0e68cdde4d release-20261014/cluster-scripts/probe_joint_idle_4gpu.sh
11
+ e14b8cf88e14e714da20b570207b7ce73649fb7caeab7df2c7802737d063dd9f release-20261014/cluster-scripts/probe_joint_idle_single_gpu.sh
12
+ 52ad4d8842bfd1c36d75d52897c480bef9ff2f528cd6020d3f95428e7ba33515 release-20261014/cluster-scripts/wait_for_8gpu_node.py
13
+ 5828545f4e6d33c56db7b078e4cf9c2458309d10cc746a05de6c966a9e37a16e release-20261014/cluster-scripts/wait_idle8_migrate.py
14
+ 8efd777e0dfd3009abb16fa217dfbe9a063c4482f862302804663bb1a05aedbe release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/best_validation.json
15
+ 88d01f697dd195c64c54c2de580e724d3122b10ad1d611c443e8ac96b331978c release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/metrics.jsonl
16
+ 559c5fc13929b47d5a3dfaef0db39dc12876c8345506d93fa1ff6e3186834f8a release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/qwen_online_identity.json
17
+ f1b86e45ceafdeea6c0e11ec2675737c7b6b1119344add6f46aeda9bca083d6c release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/resolved_config.json
18
+ 9a7cc576274ae90941361a8f5b0aa552ff81be3b409f3209f37d2e8527979348 release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/validation.jsonl
19
+ d9b5b909cec809ce85c01b57208f2cea6f7c21b7c39b3cb589e98857fc83d946 release-20261014/patches/step12531_to_step17700_code.patch
20
+ c55a9cc91801091590224fded32cadfee45d67032ab058b13bb6e449ef466676 release-20261014/scripts/download_release.sh
21
+ 609abe6528ff64650f7333d62c251d6f2dcb8b7b461d325672b2ab35a5795323 release-20261014/scripts/relocate_checkpoint_identity.py
22
+ 454227c974fb59a8a0abf9593a771c08ac0ca5be2110100c6b46a506eb61980e release-20261014/scripts/restore_release.sh
23
+ e233ee090b94d1a066b4cb7603b03daed38f4ff6c0339838d82f65b2c1b8e5c2 release-20261014/scripts/resume_8gpu.sh
24
+ 349f6f38e84d3c948f254f1769a4d2606fd7a970577b7c95d7fcd3a0cf099c09 release-20261014/scripts/verify_release.py
release-20261014/cluster-scripts/hold_8gpu_memory.py ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Temporarily reserve all eight GPUs by holding CUDA memory on each card.
3
+
4
+ Stop the supervisor with SIGTERM to release all eight workers and their memory.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import argparse
10
+ import json
11
+ import os
12
+ import signal
13
+ import subprocess
14
+ import sys
15
+ import time
16
+ from pathlib import Path
17
+
18
+
19
+ ROOT = Path(__file__).resolve().parents[1]
20
+ DEFAULT_STATUS = ROOT / "workspace_joint/outputs/hold_07_8gpu"
21
+ GIB = 1024**3
22
+ STOP = False
23
+
24
+
25
+ def stop(_signum: int, _frame: object) -> None:
26
+ global STOP
27
+ STOP = True
28
+
29
+
30
+ def worker(index: int, free_gib: float, status_dir: Path) -> int:
31
+ import torch
32
+
33
+ torch.cuda.set_device(0)
34
+ held = []
35
+ target = int(free_gib * GIB)
36
+ while True:
37
+ free, _ = torch.cuda.mem_get_info(0)
38
+ # Allow headroom for allocation rounding and CUDA context activity.
39
+ chunk = min(2 * GIB, free - target - 512 * 1024**2)
40
+ if chunk < 256 * 1024**2:
41
+ break
42
+ tensor = torch.empty((chunk,), dtype=torch.uint8, device="cuda:0")
43
+ tensor.zero_()
44
+ held.append(tensor)
45
+ torch.cuda.synchronize(0)
46
+ free, total = torch.cuda.mem_get_info(0)
47
+ status = {"gpu": index, "pid": os.getpid(), "free_gib": round(free / GIB, 2),
48
+ "total_gib": round(total / GIB, 2), "held_gib": round(sum(t.numel() for t in held) / GIB, 2)}
49
+ (status_dir / f"gpu{index}.json").write_text(json.dumps(status) + "\n")
50
+ print(json.dumps(status), flush=True)
51
+ while not STOP:
52
+ time.sleep(1)
53
+ return 0
54
+
55
+
56
+ def supervisor(free_gib: float, status_dir: Path) -> int:
57
+ visible = os.environ.get("CUDA_VISIBLE_DEVICES", "")
58
+ if sorted(visible.split(",")) != [str(i) for i in range(8)]:
59
+ raise RuntimeError(f"expected physical GPUs 0-7, got CUDA_VISIBLE_DEVICES={visible!r}")
60
+ status_dir.mkdir(parents=True, exist_ok=True)
61
+ for old in status_dir.glob("gpu*.json"):
62
+ old.unlink()
63
+ children: list[subprocess.Popen] = []
64
+ try:
65
+ for index in range(8):
66
+ env = os.environ.copy()
67
+ env["CUDA_VISIBLE_DEVICES"] = str(index)
68
+ children.append(subprocess.Popen(
69
+ [sys.executable, "-u", __file__, "--worker", str(index),
70
+ "--free-gib", str(free_gib), "--status-dir", str(status_dir)],
71
+ env=env, start_new_session=True))
72
+ (status_dir / "supervisor.pid").write_text(str(os.getpid()) + "\n")
73
+ print(f"holding GPUs 0-7; supervisor={os.getpid()}; status={status_dir}", flush=True)
74
+ while not STOP:
75
+ failed = [(i, p.returncode) for i, p in enumerate(children) if p.poll() is not None]
76
+ if failed:
77
+ raise RuntimeError(f"GPU holder exited: {failed}")
78
+ time.sleep(1)
79
+ return 0
80
+ finally:
81
+ for child in children:
82
+ if child.poll() is None:
83
+ child.terminate()
84
+ for child in children:
85
+ try:
86
+ child.wait(timeout=15)
87
+ except subprocess.TimeoutExpired:
88
+ child.kill()
89
+ child.wait()
90
+ (status_dir / "supervisor.pid").unlink(missing_ok=True)
91
+
92
+
93
+ def main() -> int:
94
+ parser = argparse.ArgumentParser(description=__doc__)
95
+ parser.add_argument("--worker", type=int)
96
+ parser.add_argument("--free-gib", type=float, default=20)
97
+ parser.add_argument("--status-dir", type=Path, default=DEFAULT_STATUS)
98
+ args = parser.parse_args()
99
+ if not 15 <= args.free_gib <= 25:
100
+ parser.error("--free-gib must be between 15 and 25")
101
+ signal.signal(signal.SIGTERM, stop)
102
+ signal.signal(signal.SIGINT, stop)
103
+ if args.worker is not None:
104
+ return worker(args.worker, args.free_gib, args.status_dir)
105
+ return supervisor(args.free_gib, args.status_dir)
106
+
107
+
108
+ if __name__ == "__main__":
109
+ sys.exit(main())
release-20261014/cluster-scripts/launch_joint_8gpu_04.sh ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
+ WORKSPACE="$ROOT/workspace_joint"
6
+ PYTHON="$WORKSPACE/conda/envs/mira/bin/python"
7
+ DATASET="$WORKSPACE/datasets/RoboTwin2.0"
8
+ PUBLISHED="$WORKSPACE/outputs/joint_anchor_v2_24gpu_long_20260930/joint-checkpoint-12531"
9
+ OUTPUT="${JOINT_OUTPUT_DIR:-$WORKSPACE/outputs/joint_8gpu_04_resume12531_20261010}"
10
+ BATCH="${JOINT_PER_DEVICE_BATCH:-4}"
11
+ ACCUMULATION="${JOINT_GRADIENT_ACCUMULATION:-4}"
12
+
13
+ GPU_SET="$(tr ',' '\n' <<< "${CUDA_VISIBLE_DEVICES:-}" | sort -n | paste -sd, -)"
14
+ [[ "$GPU_SET" == "0,1,2,3,4,5,6,7" ]] || {
15
+ echo "Expected a scheduler lease on physical GPUs 0 through 7" >&2; exit 2;
16
+ }
17
+ [[ -x "$PYTHON" && -s "$PUBLISHED/trainer_state.json" ]] || {
18
+ echo "Joint environment or published checkpoint is missing" >&2; exit 2;
19
+ }
20
+ [[ -s "$WORKSPACE/z_oranger/token.txt" ]] || {
21
+ echo "SwanLab token file is missing" >&2; exit 2;
22
+ }
23
+ if [[ "${JOINT_PREFLIGHT_ONLY:-0}" != 1 ]]; then
24
+ count="$(find "$DATASET/dataset" -mindepth 2 -maxdepth 2 -name 'aloha-agilex_*.zip' | wc -l)"
25
+ [[ "$count" -eq 100 ]] || { echo "Expected 100 RoboTwin archives, found $count" >&2; exit 2; }
26
+ fi
27
+
28
+ export PYTHONPATH="$WORKSPACE/mira_8gpu/src${PYTHONPATH:+:$PYTHONPATH}"
29
+ export PYTHONUNBUFFERED=1 TOKENIZERS_PARALLELISM=false
30
+ export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 TORCH_NCCL_ASYNC_ERROR_HANDLING=1
31
+ export OMP_NUM_THREADS=4 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
32
+ # This node's existing proxy reaches SwanLab; the workspace-mapped proxy rejects that host.
33
+ export http_proxy=http://127.0.0.1:7897 https_proxy=http://127.0.0.1:7897
34
+ export HTTP_PROXY="$http_proxy" HTTPS_PROXY="$https_proxy"
35
+ export all_proxy="$http_proxy" ALL_PROXY="$http_proxy"
36
+ unset SWANLAB_PROJECT SWANLAB_API_KEY
37
+
38
+ args=(
39
+ "$DATASET"
40
+ --manifest-dir "$DATASET/mira_manifests/joint_anchor_v2"
41
+ --world-checkpoint "$WORKSPACE/outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066"
42
+ --action-checkpoint "$WORKSPACE/outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016"
43
+ --codec-checkpoint "$WORKSPACE/outputs/mira_robotwin_codec/checkpoint-125000/checkpoint.pth"
44
+ --qwen-root "$WORKSPACE/models/Qwen3-VL-2B-Instruct"
45
+ --output-dir "$OUTPUT" --resume-from "$PUBLISHED"
46
+ --steps 55000 --per-device-batch "$BATCH" --gradient-accumulation "$ACCUMULATION"
47
+ --num-workers 4 --shard-group-size 8 --world-rollout-steps 10
48
+ --world-activation-checkpoint-blocks -1 --action-activation-checkpoint-blocks 7
49
+ --lr-world 1e-5 --lr-action 3e-5 --warmup-steps 500
50
+ --weight-world-flow 1 --weight-latent 0 --weight-pixel 0 --weight-action 1
51
+ --log-every 10 --save-every 100 --validate-every 200 --validation-batches 3
52
+ --keep-last 3 --keep-every 5000
53
+ --swanlab-project Multi_WAM
54
+ --swanlab-experiment-name Joint-World-Action-8GPU04-Resume12531
55
+ --swanlab-token-file "$WORKSPACE/z_oranger/token.txt"
56
+ )
57
+ if [[ "${JOINT_PREFLIGHT_ONLY:-0}" == 1 ]]; then
58
+ args+=(--resume-preflight-only --swanlab-mode disabled)
59
+ elif [[ "${JOINT_PROBE_ONLY:-0}" == 1 ]]; then
60
+ args+=(--probe-only --max-steps 12532 --swanlab-mode disabled)
61
+ else
62
+ args+=(--swanlab-mode online)
63
+ fi
64
+ if [[ -n "${JOINT_MAX_STEPS:-}" ]]; then
65
+ args+=(--max-steps "$JOINT_MAX_STEPS")
66
+ fi
67
+
68
+ cd "$WORKSPACE"
69
+ exec "$PYTHON" -m torch.distributed.run --standalone --nproc_per_node=8 \
70
+ "$WORKSPACE/mira_8gpu/scripts/train_joint_world_action.py" "${args[@]}"
release-20261014/cluster-scripts/launch_joint_8gpu_09.sh ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
+ WORKSPACE="$ROOT/workspace_joint"
6
+ PYTHON="$WORKSPACE/conda/envs/mira/bin/python"
7
+ DATASET="$WORKSPACE/datasets/RoboTwin2.0"
8
+ SOURCE="${JOINT_RESUME_FROM:?Set JOINT_RESUME_FROM to the completed 04 checkpoint}"
9
+ OUTPUT="${JOINT_OUTPUT_DIR:?Set JOINT_OUTPUT_DIR for the 09 continuation}"
10
+ BATCH="${JOINT_PER_DEVICE_BATCH:-15}"
11
+ ACCUMULATION="${JOINT_GRADIENT_ACCUMULATION:-1}"
12
+
13
+ GPU_SET="$(tr ',' '\n' <<< "${CUDA_VISIBLE_DEVICES:-}" | sort -n | paste -sd, -)"
14
+ [[ "$GPU_SET" == "0,1,2,3,4,5,6,7" ]] || {
15
+ echo "Expected a scheduler lease on physical GPUs 0 through 7" >&2; exit 2;
16
+ }
17
+ [[ -x "$PYTHON" && -s "$SOURCE/trainer_state.json" ]] || {
18
+ echo "Joint environment or source checkpoint is missing" >&2; exit 2;
19
+ }
20
+ [[ -s "$WORKSPACE/z_oranger/token.txt" ]] || {
21
+ echo "SwanLab token file is missing" >&2; exit 2;
22
+ }
23
+ if [[ "${JOINT_PREFLIGHT_ONLY:-0}" != 1 ]]; then
24
+ count="$(find "$DATASET/dataset" -mindepth 2 -maxdepth 2 -name 'aloha-agilex_*.zip' | wc -l)"
25
+ [[ "$count" -eq 100 ]] || { echo "Expected 100 RoboTwin archives, found $count" >&2; exit 2; }
26
+ fi
27
+
28
+ export PYTHONPATH="$WORKSPACE/mira_09/src${PYTHONPATH:+:$PYTHONPATH}"
29
+ export PYTHONUNBUFFERED=1 TOKENIZERS_PARALLELISM=false
30
+ export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 TORCH_NCCL_ASYNC_ERROR_HANDLING=1
31
+ export OMP_NUM_THREADS=4 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
32
+ # Node 09 reaches SwanLab directly; the workspace-mapped proxy rejects that host.
33
+ unset http_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY
34
+ unset SWANLAB_PROJECT SWANLAB_API_KEY
35
+
36
+ args=(
37
+ "$DATASET"
38
+ --manifest-dir "$DATASET/mira_manifests/joint_anchor_v2"
39
+ --world-checkpoint "$WORKSPACE/outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066"
40
+ --action-checkpoint "$WORKSPACE/outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016"
41
+ --codec-checkpoint "$WORKSPACE/outputs/mira_robotwin_codec/checkpoint-125000/checkpoint.pth"
42
+ --qwen-root "$WORKSPACE/models/Qwen3-VL-2B-Instruct"
43
+ --output-dir "$OUTPUT" --resume-from "$SOURCE" --allow-batch-migration
44
+ --steps 55000 --per-device-batch "$BATCH" --gradient-accumulation "$ACCUMULATION"
45
+ --num-workers 4 --shard-group-size 8 --world-rollout-steps 10
46
+ --world-activation-checkpoint-blocks -1 --action-activation-checkpoint-blocks 7
47
+ --lr-world 1e-5 --lr-action 3e-5 --warmup-steps 500
48
+ --weight-world-flow 1 --weight-latent 0 --weight-pixel 0 --weight-action 1
49
+ --log-every 10 --save-every 100 --validate-every 200 --validation-batches 3
50
+ --keep-last 3 --keep-every 5000
51
+ --swanlab-project Multi_WAM
52
+ --swanlab-experiment-name Joint-World-Action-8GPU09-Resume04
53
+ --swanlab-token-file "$WORKSPACE/z_oranger/token.txt"
54
+ )
55
+ if [[ "${JOINT_PREFLIGHT_ONLY:-0}" == 1 ]]; then
56
+ args+=(--resume-preflight-only --swanlab-mode disabled)
57
+ elif [[ "${JOINT_PROBE_ONLY:-0}" == 1 ]]; then
58
+ SOURCE_STEP="$("$PYTHON" -c 'import json,sys; print(json.load(open(sys.argv[1]))["completed_steps"])' "$SOURCE/trainer_state.json")"
59
+ args+=(--probe-only --max-steps "$((SOURCE_STEP + 1))" --swanlab-mode disabled)
60
+ else
61
+ args+=(--swanlab-mode online)
62
+ fi
63
+ if [[ -n "${JOINT_MAX_STEPS:-}" ]]; then
64
+ args+=(--max-steps "$JOINT_MAX_STEPS")
65
+ fi
66
+
67
+ cd "$WORKSPACE"
68
+ exec "$PYTHON" -m torch.distributed.run --standalone --nproc_per_node=8 \
69
+ "$WORKSPACE/mira_09/scripts/train_joint_world_action.py" "${args[@]}"
release-20261014/cluster-scripts/launch_joint_8gpu_idle.sh ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
+ WORKSPACE="$ROOT/workspace_joint"
6
+ PYTHON="$WORKSPACE/conda/envs/mira/bin/python"
7
+ DATASET="$WORKSPACE/datasets/RoboTwin2.0"
8
+ SOURCE="${JOINT_RESUME_FROM:?Set JOINT_RESUME_FROM to the completed source checkpoint}"
9
+ OUTPUT="${JOINT_OUTPUT_DIR:?Set JOINT_OUTPUT_DIR for this continuation}"
10
+ BATCH="${JOINT_PER_DEVICE_BATCH:-15}"
11
+ ACCUMULATION="${JOINT_GRADIENT_ACCUMULATION:-1}"
12
+
13
+ GPU_SET="$(tr ',' '\n' <<< "${CUDA_VISIBLE_DEVICES:-}" | sort -n | paste -sd, -)"
14
+ [[ "$GPU_SET" == "0,1,2,3,4,5,6,7" ]] || {
15
+ echo "Expected physical GPUs 0 through 7" >&2; exit 2;
16
+ }
17
+ [[ -x "$PYTHON" && -s "$SOURCE/trainer_state.json" ]] || {
18
+ echo "Joint environment or source checkpoint is missing" >&2; exit 2;
19
+ }
20
+ [[ -s "$WORKSPACE/z_oranger/token.txt" ]] || {
21
+ echo "SwanLab token file is missing" >&2; exit 2;
22
+ }
23
+ if [[ "${JOINT_PREFLIGHT_ONLY:-0}" != 1 ]]; then
24
+ count="$(find "$DATASET/dataset" -mindepth 2 -maxdepth 2 -name 'aloha-agilex_*.zip' | wc -l)"
25
+ [[ "$count" -eq 100 ]] || { echo "Expected 100 RoboTwin archives, found $count" >&2; exit 2; }
26
+ fi
27
+
28
+ export PYTHONPATH="$WORKSPACE/mira_09/src${PYTHONPATH:+:$PYTHONPATH}"
29
+ export PYTHONUNBUFFERED=1 TOKENIZERS_PARALLELISM=false
30
+ export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 TORCH_NCCL_ASYNC_ERROR_HANDLING=1
31
+ export OMP_NUM_THREADS=4 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
32
+ # Compute nodes may reach SwanLab directly; the workspace-mapped proxy rejects that host.
33
+ unset http_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY
34
+ export SWANLAB_FORCE_DIRECT=1 NO_PROXY='*' no_proxy='*'
35
+ unset SWANLAB_PROJECT SWANLAB_API_KEY
36
+
37
+ args=(
38
+ "$DATASET"
39
+ --manifest-dir "$DATASET/mira_manifests/joint_anchor_v2"
40
+ --world-checkpoint "$WORKSPACE/outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066"
41
+ --action-checkpoint "$WORKSPACE/outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016"
42
+ --codec-checkpoint "$WORKSPACE/outputs/mira_robotwin_codec/checkpoint-125000/checkpoint.pth"
43
+ --qwen-root "$WORKSPACE/models/Qwen3-VL-2B-Instruct"
44
+ --output-dir "$OUTPUT" --resume-from "$SOURCE" --allow-batch-migration
45
+ --steps 55000 --per-device-batch "$BATCH" --gradient-accumulation "$ACCUMULATION"
46
+ --num-workers 4 --shard-group-size 8 --world-rollout-steps 10
47
+ --world-activation-checkpoint-blocks -1 --action-activation-checkpoint-blocks 7
48
+ --lr-world 1e-5 --lr-action 3e-5 --warmup-steps 500
49
+ --weight-world-flow 1 --weight-latent 0 --weight-pixel 0 --weight-action 1
50
+ --log-every 10 --save-every 100 --validate-every 200 --validation-batches 3
51
+ --keep-last 3 --keep-every 5000
52
+ --swanlab-project Multi_WAM
53
+ --swanlab-experiment-name "${JOINT_EXPERIMENT_NAME:-Joint-World-Action-8GPU-Idle-Resume04}"
54
+ --swanlab-token-file "$WORKSPACE/z_oranger/token.txt"
55
+ )
56
+ if [[ "${JOINT_PREFLIGHT_ONLY:-0}" == 1 ]]; then
57
+ args+=(--resume-preflight-only --swanlab-mode disabled)
58
+ elif [[ "${JOINT_PROBE_ONLY:-0}" == 1 ]]; then
59
+ SOURCE_STEP="$("$PYTHON" -c 'import json,sys; print(json.load(open(sys.argv[1]))["completed_steps"])' "$SOURCE/trainer_state.json")"
60
+ args+=(--probe-only --max-steps "$((SOURCE_STEP + 1))" --swanlab-mode disabled)
61
+ else
62
+ args+=(--swanlab-mode online)
63
+ fi
64
+ if [[ -n "${JOINT_MAX_STEPS:-}" ]]; then
65
+ args+=(--max-steps "$JOINT_MAX_STEPS")
66
+ fi
67
+
68
+ cd "$WORKSPACE"
69
+ exec "$PYTHON" -m torch.distributed.run --standalone --nproc_per_node=8 \
70
+ "$WORKSPACE/mira_09/scripts/train_joint_world_action.py" "${args[@]}"
release-20261014/cluster-scripts/occupy_gpu_memory.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Hold most VRAM on all eight scheduler-assigned GPUs until interrupted."""
3
+
4
+ import signal
5
+ import sys
6
+ import time
7
+
8
+ try:
9
+ import torch
10
+ except ImportError as exc:
11
+ raise SystemExit("PyTorch is required on the GPU host") from exc
12
+
13
+ if not torch.cuda.is_available() or torch.cuda.device_count() != 8:
14
+ raise SystemExit(
15
+ f"Expected exactly 8 scheduler-assigned CUDA devices; found "
16
+ f"{torch.cuda.device_count() if torch.cuda.is_available() else 0}"
17
+ )
18
+
19
+ MiB = 1024 * 1024
20
+ SAFETY_MARGIN_MIB = 1024
21
+ CHUNK_MIB = 256
22
+ reservations = [[] for _ in range(8)]
23
+ stopping = False
24
+
25
+
26
+ def request_stop(_signum, _frame):
27
+ global stopping
28
+ stopping = True
29
+
30
+
31
+ signal.signal(signal.SIGTERM, request_stop)
32
+ signal.signal(signal.SIGINT, request_stop)
33
+
34
+ for index in range(8):
35
+ torch.cuda.set_device(index)
36
+ free_bytes, total_bytes = torch.cuda.mem_get_info(index)
37
+ target_bytes = max(0, free_bytes - SAFETY_MARGIN_MIB * MiB)
38
+ allocated = 0
39
+ while allocated < target_bytes:
40
+ chunk_bytes = min(CHUNK_MIB * MiB, target_bytes - allocated)
41
+ try:
42
+ block = torch.empty(chunk_bytes, dtype=torch.uint8, device=f"cuda:{index}")
43
+ block.zero_()
44
+ torch.cuda.synchronize(index)
45
+ reservations[index].append(block)
46
+ allocated += chunk_bytes
47
+ except torch.cuda.OutOfMemoryError:
48
+ break
49
+ print(
50
+ f"GPU {index}: held {allocated / MiB:.0f} MiB; "
51
+ f"total {total_bytes / MiB:.0f} MiB",
52
+ flush=True,
53
+ )
54
+
55
+ print("Holding reservations. Stop this scheduler job to release GPU memory.", flush=True)
56
+ while not stopping:
57
+ time.sleep(1)
58
+
59
+ reservations.clear()
60
+ for index in range(8):
61
+ with torch.cuda.device(index):
62
+ torch.cuda.empty_cache()
63
+ print("Released GPU memory.", flush=True)
release-20261014/cluster-scripts/probe_joint_idle_4gpu.sh ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
+ WORKSPACE="$ROOT/workspace_joint"
6
+ PYTHON="$WORKSPACE/conda/envs/mira/bin/python"
7
+ DATASET="$WORKSPACE/datasets/RoboTwin2.0"
8
+ OUTPUT="${JOINT_OUTPUT_DIR:?Set JOINT_OUTPUT_DIR for the probe}"
9
+ BATCH="${JOINT_PER_DEVICE_BATCH:-15}"
10
+ [[ "${CUDA_VISIBLE_DEVICES:-}" == "0,5,6,7" ]] || {
11
+ echo "Probe requires the four idle physical GPUs 0,5,6,7" >&2; exit 2;
12
+ }
13
+
14
+ export PYTHONPATH="$WORKSPACE/mira_09/src${PYTHONPATH:+:$PYTHONPATH}"
15
+ export PYTHONUNBUFFERED=1 TOKENIZERS_PARALLELISM=false
16
+ export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 TORCH_NCCL_ASYNC_ERROR_HANDLING=1
17
+ export OMP_NUM_THREADS=4 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
18
+ unset http_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY
19
+
20
+ cd "$WORKSPACE"
21
+ exec "$PYTHON" -m torch.distributed.run --standalone --nproc_per_node=4 \
22
+ "$WORKSPACE/mira_09/scripts/train_joint_world_action.py" \
23
+ "$DATASET" \
24
+ --manifest-dir "$DATASET/mira_manifests/joint_anchor_v2" \
25
+ --world-checkpoint "$WORKSPACE/outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066" \
26
+ --action-checkpoint "$WORKSPACE/outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016" \
27
+ --codec-checkpoint "$WORKSPACE/outputs/mira_robotwin_codec/checkpoint-125000/checkpoint.pth" \
28
+ --qwen-root "$WORKSPACE/models/Qwen3-VL-2B-Instruct" \
29
+ --output-dir "$OUTPUT" --steps 55000 --max-steps 1 \
30
+ --per-device-batch "$BATCH" --gradient-accumulation 1 \
31
+ --num-workers 4 --shard-group-size 4 --world-rollout-steps 10 \
32
+ --world-activation-checkpoint-blocks -1 --action-activation-checkpoint-blocks 7 \
33
+ --lr-world 1e-5 --lr-action 3e-5 --warmup-steps 500 \
34
+ --weight-world-flow 1 --weight-latent 0 --weight-pixel 0 --weight-action 1 \
35
+ --validation-batches 3 --probe-only --swanlab-mode disabled
release-20261014/cluster-scripts/probe_joint_idle_single_gpu.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
+ WORKSPACE="$ROOT/workspace_joint"
6
+ PYTHON="$WORKSPACE/conda/envs/mira/bin/python"
7
+ DATASET="$WORKSPACE/datasets/RoboTwin2.0"
8
+ OUTPUT="${JOINT_OUTPUT_DIR:?Set JOINT_OUTPUT_DIR for the probe}"
9
+ BATCH="${JOINT_PER_DEVICE_BATCH:-14}"
10
+ [[ "${CUDA_VISIBLE_DEVICES:-}" =~ ^[0-7]$ ]] || {
11
+ echo "Probe requires one physical GPU in CUDA_VISIBLE_DEVICES" >&2; exit 2;
12
+ }
13
+
14
+ export PYTHONPATH="$WORKSPACE/mira_09/src${PYTHONPATH:+:$PYTHONPATH}"
15
+ export PYTHONUNBUFFERED=1 TOKENIZERS_PARALLELISM=false
16
+ export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 TORCH_NCCL_ASYNC_ERROR_HANDLING=1
17
+ export OMP_NUM_THREADS=4 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
18
+ unset http_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY
19
+
20
+ cd "$WORKSPACE"
21
+ exec "$PYTHON" "$WORKSPACE/mira_09/scripts/train_joint_world_action.py" \
22
+ "$DATASET" \
23
+ --manifest-dir "$DATASET/mira_manifests/joint_anchor_v2" \
24
+ --world-checkpoint "$WORKSPACE/outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066" \
25
+ --action-checkpoint "$WORKSPACE/outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016" \
26
+ --codec-checkpoint "$WORKSPACE/outputs/mira_robotwin_codec/checkpoint-125000/checkpoint.pth" \
27
+ --qwen-root "$WORKSPACE/models/Qwen3-VL-2B-Instruct" \
28
+ --output-dir "$OUTPUT" --steps 55000 --max-steps 1 \
29
+ --per-device-batch "$BATCH" --gradient-accumulation 1 \
30
+ --num-workers 4 --shard-group-size 0 --world-rollout-steps 10 \
31
+ --world-activation-checkpoint-blocks -1 --action-activation-checkpoint-blocks 7 \
32
+ --lr-world 1e-5 --lr-action 3e-5 --warmup-steps 500 \
33
+ --weight-world-flow 1 --weight-latent 0 --weight-pixel 0 --weight-action 1 \
34
+ --validation-batches 3 --probe-only --swanlab-mode disabled
release-20261014/cluster-scripts/wait_for_8gpu_node.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Wait for a whole eligible 8-GPU host, then submit the VRAM holder."""
3
+
4
+ import json
5
+ import os
6
+ import subprocess
7
+ import sys
8
+ import time
9
+ from datetime import datetime
10
+ from pathlib import Path
11
+
12
+ ROOT = Path("/pfs/pfs-7jnepv/zkw")
13
+ PROJECT = Path("/pfs/pfs-7jnepv/zkw/project/multi_wam")
14
+ SCHEDULER = ROOT / "bin/cluster-gpu"
15
+ GPU_PYTHON = PROJECT / "workspace_joint/conda/envs/mira/bin/python"
16
+ POLL_SECONDS = 60
17
+
18
+ env = os.environ.copy()
19
+ for key in (
20
+ "HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY",
21
+ "http_proxy", "https_proxy", "all_proxy",
22
+ ):
23
+ env.pop(key, None)
24
+
25
+
26
+ def log(message):
27
+ stamp = datetime.now().astimezone().isoformat(timespec="seconds")
28
+ print(f"[{stamp}] {message}", flush=True)
29
+
30
+
31
+ while True:
32
+ probe = subprocess.run(
33
+ [str(SCHEDULER), "find", "--gpus", "8", "--json"],
34
+ cwd=ROOT,
35
+ env=env,
36
+ capture_output=True,
37
+ text=True,
38
+ )
39
+ try:
40
+ selection = json.loads(probe.stdout).get("selection") or {}
41
+ except (json.JSONDecodeError, AttributeError):
42
+ selection = {}
43
+ host = selection.get("host")
44
+ if host:
45
+ log(f"8-card host is eligible: {host}; submitting VRAM holder")
46
+ submit = subprocess.run(
47
+ [
48
+ str(SCHEDULER), "submit",
49
+ "--name", "multiwam-vram-hold-8gpu",
50
+ "--gpus", "8",
51
+ "--host", host,
52
+ "--min-free-mb", "120000",
53
+ "--max-util", "20",
54
+ "--cwd", str(PROJECT),
55
+ "--", str(GPU_PYTHON), "occupy_gpu_memory.py",
56
+ ],
57
+ cwd=ROOT,
58
+ env=env,
59
+ capture_output=True,
60
+ text=True,
61
+ )
62
+ if submit.returncode == 0:
63
+ for line in submit.stdout.splitlines():
64
+ log(line)
65
+ log("VRAM holder submitted; watcher exiting")
66
+ break
67
+ log(
68
+ "allocation raced or submission failed; will retry: "
69
+ + (submit.stderr.strip() or submit.stdout.strip())
70
+ )
71
+ elif probe.returncode not in (0, 2):
72
+ log(f"GPU query failed; retrying: {probe.stderr.strip() or 'invalid status response'}")
73
+
74
+ log(f"No whole eligible 8-GPU host; checking again in {POLL_SECONDS}s")
75
+ time.sleep(POLL_SECONDS)
release-20261014/cluster-scripts/wait_idle8_migrate.py ADDED
@@ -0,0 +1,470 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Wait for eight physically idle GPUs, probe them, then migrate the joint run.
3
+
4
+ The existing 04 training is left alone until an eight-rank optimizer step has
5
+ passed on the destination and its measured free memory is acceptable.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import argparse
11
+ import datetime as dt
12
+ import fcntl
13
+ import json
14
+ import logging
15
+ import os
16
+ import re
17
+ import shlex
18
+ import subprocess
19
+ import sys
20
+ import time
21
+ from pathlib import Path
22
+
23
+
24
+ ROOT = Path(__file__).resolve().parents[1]
25
+ WORKSPACE = ROOT / "workspace_joint"
26
+ SOURCE_OUTPUT = WORKSPACE / "outputs/joint_8gpu_04_resume12531_20261010"
27
+ STATE_DIR = WORKSPACE / "outputs/joint_idle8_migration_20261010"
28
+ SSH = Path("/pfs/pfs-7jnepv/zkw/bin/cluster-ssh")
29
+ SCHEDULER = Path("/pfs/pfs-7jnepv/zkw/bin/cluster-gpu")
30
+ SOURCE_HOST = "instance-de10opsf-04"
31
+ GPU_IDS = list(range(8))
32
+ MIN_FREE_MB = 15 * 1024
33
+ MAX_FREE_MB = 25 * 1024
34
+ LOGGER = logging.getLogger("idle8-migration")
35
+
36
+
37
+ def stamp() -> str:
38
+ return dt.datetime.now(dt.timezone.utc).astimezone().strftime("%Y%m%d-%H%M%S")
39
+
40
+
41
+ def write_state(**values: object) -> None:
42
+ STATE_DIR.mkdir(parents=True, exist_ok=True)
43
+ path = STATE_DIR / "state.json"
44
+ old = json.loads(path.read_text()) if path.exists() else {}
45
+ old.update(values)
46
+ old["updated_at"] = dt.datetime.now(dt.timezone.utc).isoformat()
47
+ temporary = path.with_suffix(".json.tmp")
48
+ temporary.write_text(json.dumps(old, indent=2, sort_keys=True) + "\n")
49
+ temporary.replace(path)
50
+
51
+
52
+ def command(argv: list[str], *, timeout: int = 20) -> str:
53
+ result = subprocess.run(argv, capture_output=True, text=True, timeout=timeout)
54
+ if result.returncode:
55
+ raise RuntimeError(f"command failed ({result.returncode}): {argv[0]} {result.stderr[-800:]}")
56
+ return result.stdout
57
+
58
+
59
+ def remote(host: str, script: str, *, timeout: int = 20) -> str:
60
+ if host == os.uname().nodename:
61
+ return command(["bash", "-lc", script], timeout=timeout)
62
+ return command([str(SSH), "-o", "ConnectTimeout=5", host, script], timeout=timeout)
63
+
64
+
65
+ def hosts() -> list[str]:
66
+ rows = command([str(SCHEDULER), "hosts"]).splitlines()
67
+ return [row.split("\t")[0] for row in rows
68
+ if len(row.split("\t")) >= 4 and row.split("\t")[3] == "enabled"
69
+ and row.split("\t")[0] != SOURCE_HOST]
70
+
71
+
72
+ def gpu_state(host: str) -> dict:
73
+ raw = remote(host,
74
+ "nvidia-smi --query-gpu=index,memory.total,memory.used,memory.free,utilization.gpu "
75
+ "--format=csv,noheader,nounits && printf '\\nAPPS\\n' && "
76
+ "nvidia-smi --query-compute-apps=pid --format=csv,noheader",
77
+ timeout=15)
78
+ first, _, applications = raw.partition("APPS\n")
79
+ gpus = []
80
+ for row in first.splitlines():
81
+ if not row.strip():
82
+ continue
83
+ fields = [int(field.strip()) for field in row.split(",")]
84
+ if len(fields) == 5:
85
+ gpus.append(dict(zip(("index", "total_mb", "used_mb", "free_mb", "util"), fields)))
86
+ apps = [line.strip() for line in applications.splitlines() if line.strip()]
87
+ idle = (len(gpus) == 8 and [g["index"] for g in gpus] == GPU_IDS
88
+ and all(g["total_mb"] >= 180000 and g["used_mb"] <= 1024
89
+ and g["util"] <= 5 for g in gpus) and not apps)
90
+ return {"host": host, "idle": idle, "gpus": gpus, "compute_pids": apps}
91
+
92
+
93
+ def current_checkpoint() -> tuple[int, Path]:
94
+ complete: list[tuple[int, Path]] = []
95
+ for path in SOURCE_OUTPUT.glob("joint-checkpoint-*"):
96
+ match = re.fullmatch(r"joint-checkpoint-(\d+)", path.name)
97
+ metadata_path = path / "trainer_state.json"
98
+ if not match or not metadata_path.is_file():
99
+ continue
100
+ try:
101
+ metadata = json.loads(metadata_path.read_text())
102
+ step = int(match.group(1))
103
+ if (metadata["completed_steps"] == step and metadata["next_step"] == step
104
+ and metadata["artifact_identity"]["world_size"] == 8
105
+ and len(list(path.glob("rank-*.pth"))) == 8
106
+ and len(list((path / "distributed").glob("*.distcp"))) == 8
107
+ and (path / "distributed/.metadata").is_file()):
108
+ complete.append((step, path))
109
+ except (KeyError, OSError, ValueError, json.JSONDecodeError):
110
+ pass
111
+ if not complete:
112
+ raise RuntimeError(f"no complete eight-rank checkpoint in {SOURCE_OUTPUT}")
113
+ return max(complete)
114
+
115
+
116
+ def controller_pid() -> int | None:
117
+ raw = remote(SOURCE_HOST, "ps -eo pid=,ppid=,args=ww")
118
+ found = []
119
+ for line in raw.splitlines():
120
+ parts = line.strip().split(None, 2)
121
+ if len(parts) != 3:
122
+ continue
123
+ pid, _, args = parts
124
+ if ("-m torch.distributed.run" in args
125
+ and "mira_8gpu/scripts/train_joint_world_action.py" in args
126
+ and f"--output-dir {SOURCE_OUTPUT}" in args):
127
+ found.append(int(pid))
128
+ if len(found) > 1:
129
+ raise RuntimeError(f"multiple 04 training controllers: {found}")
130
+ return found[0] if found else None
131
+
132
+
133
+ def free_memory(host: str) -> list[int]:
134
+ raw = remote(host, "nvidia-smi --query-gpu=index,memory.free --format=csv,noheader,nounits")
135
+ rows = [[int(value.strip()) for value in line.split(",")] for line in raw.splitlines()]
136
+ if len(rows) != 8 or [row[0] for row in rows] != GPU_IDS:
137
+ raise RuntimeError(f"unexpected GPU inventory on {host}")
138
+ return [row[1] for row in rows]
139
+
140
+
141
+ def probe_controller_pids(host: str, output: Path) -> list[int]:
142
+ raw = remote(host, "ps -eo pid=,args=ww")
143
+ found = []
144
+ for line in raw.splitlines():
145
+ fields = line.strip().split(None, 1)
146
+ if len(fields) == 2 and "-m torch.distributed.run" in fields[1] \
147
+ and f"--output-dir {output}" in fields[1]:
148
+ found.append(int(fields[0]))
149
+ return found
150
+
151
+
152
+ def foreign_gpu_processes(host: str, output: Path) -> list[str]:
153
+ own_pids: set[int] = set()
154
+ for controller in probe_controller_pids(host, output):
155
+ raw_children = remote(host, f"pgrep -P {controller} || true")
156
+ own_pids.update(int(value) for value in raw_children.split() if value.isdecimal())
157
+ raw = remote(host, "nvidia-smi --query-compute-apps=pid,process_name --format=csv,noheader")
158
+ return [line.strip() for line in raw.splitlines()
159
+ if line.strip() and int(line.split(",", 1)[0].strip()) not in own_pids]
160
+
161
+
162
+ def stop_probe(host: str, output: Path) -> None:
163
+ for pid in probe_controller_pids(host, output):
164
+ remote(host, f"kill -TERM {pid} 2>/dev/null || true")
165
+ for _ in range(6):
166
+ if not probe_controller_pids(host, output):
167
+ return
168
+ time.sleep(5)
169
+ for pid in probe_controller_pids(host, output):
170
+ LOGGER.warning("force stopping stalled probe controller %s on %s", pid, host)
171
+ remote(host, f"pkill -KILL -P {pid} 2>/dev/null || true; "
172
+ f"kill -KILL {pid} 2>/dev/null || true")
173
+
174
+
175
+ def probe(host: str, source: Path, batch: int) -> dict:
176
+ output = STATE_DIR / f"probe_{host[-2:]}_b{batch}_{stamp()}"
177
+ output.mkdir(parents=True, exist_ok=False)
178
+ log_path = output / "probe.log"
179
+ variables = {
180
+ "CUDA_VISIBLE_DEVICES": "0,1,2,3,4,5,6,7",
181
+ "JOINT_RESUME_FROM": str(source),
182
+ "JOINT_OUTPUT_DIR": str(output),
183
+ "JOINT_PER_DEVICE_BATCH": str(batch),
184
+ "JOINT_GRADIENT_ACCUMULATION": "1",
185
+ "JOINT_PROBE_ONLY": "1",
186
+ }
187
+ prefix = " ".join(f"{key}={shlex.quote(value)}" for key, value in variables.items())
188
+ script = f"cd {shlex.quote(str(ROOT))} && env {prefix} bash scripts/launch_joint_8gpu_idle.sh"
189
+ LOGGER.info("probing host=%s batch=%s source=%s log=%s", host, batch, source, log_path)
190
+ write_state(phase="probing", candidate=host, probe_batch=batch,
191
+ probe_source=str(source), probe_log=str(log_path))
192
+ min_free = [float("inf")] * 8
193
+ raced = False
194
+ last_foreign_check = 0.0
195
+ with log_path.open("w") as handle:
196
+ argv = (["bash", "-lc", script] if host == os.uname().nodename else
197
+ [str(SSH), "-o", "ConnectTimeout=5", host, script])
198
+ process = subprocess.Popen(argv,
199
+ stdout=handle, stderr=subprocess.STDOUT, text=True)
200
+ deadline = time.monotonic() + 1800
201
+ while process.poll() is None:
202
+ try:
203
+ sample = free_memory(host)
204
+ min_free = [min(old, value) for old, value in zip(min_free, sample)]
205
+ if time.monotonic() - last_foreign_check >= 3:
206
+ foreign = foreign_gpu_processes(host, output)
207
+ last_foreign_check = time.monotonic()
208
+ if foreign:
209
+ LOGGER.warning("another GPU process started during probe on %s: %s", host, foreign)
210
+ raced = True
211
+ stop_probe(host, output)
212
+ process.terminate()
213
+ break
214
+ except Exception as exc:
215
+ LOGGER.warning("probe memory sample failed: %s", exc)
216
+ if time.monotonic() > deadline:
217
+ stop_probe(host, output)
218
+ process.terminate()
219
+ raise TimeoutError(f"probe timed out: {log_path}")
220
+ time.sleep(1)
221
+ try:
222
+ result_code = process.wait(timeout=90)
223
+ except subprocess.TimeoutExpired:
224
+ stop_probe(host, output)
225
+ process.kill()
226
+ result_code = process.wait(timeout=20)
227
+ summary = output / "probe_summary.json"
228
+ passed = result_code == 0 and summary.is_file() and not raced
229
+ details = json.loads(summary.read_text()) if passed else {}
230
+ result = {"passed": passed, "batch": batch, "host": host,
231
+ "output": str(output), "log": str(log_path),
232
+ "exit_code": result_code,
233
+ "external_process_race": raced,
234
+ "min_free_mb_by_gpu": [None if value == float("inf") else value for value in min_free],
235
+ "min_free_mb": min(min_free), "summary": details}
236
+ LOGGER.info("probe result: %s", json.dumps({k: v for k, v in result.items() if k != "summary"}))
237
+ return result
238
+
239
+
240
+ def tune(host: str) -> dict | None:
241
+ _, source = current_checkpoint()
242
+ # The mapped proxy denies SwanLab; a migrated online run needs direct access.
243
+ remote(host,
244
+ "env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy "
245
+ "-u https_proxy -u all_proxy curl --noproxy '*' -sS -I --max-time 8 "
246
+ "https://api.swanlab.cn > /dev/null", timeout=12)
247
+ batch = 15
248
+ tried: set[int] = set()
249
+ best: dict | None = None
250
+ for _ in range(4):
251
+ if batch in tried or batch < 11 or batch > 17:
252
+ break
253
+ tried.add(batch)
254
+ if not gpu_state(host)["idle"]:
255
+ LOGGER.info("candidate %s became occupied before probe", host)
256
+ return None
257
+ result = probe(host, source, batch)
258
+ if result["external_process_race"]:
259
+ return None
260
+ if not gpu_state(host)["idle"]:
261
+ LOGGER.info("candidate %s became occupied during probe", host)
262
+ return None
263
+ if result["min_free_mb"] == float("inf"):
264
+ LOGGER.warning("probe had no valid GPU memory samples")
265
+ return None
266
+ if result["passed"] and result["min_free_mb"] >= MIN_FREE_MB:
267
+ best = result
268
+ if result["min_free_mb"] <= MAX_FREE_MB:
269
+ return result
270
+ batch += 1
271
+ else:
272
+ if not result["passed"]:
273
+ log_tail = Path(result["log"]).read_text(errors="replace")[-4000:].lower()
274
+ if "out of memory" not in log_tail:
275
+ LOGGER.error("probe failed for a reason other than CUDA OOM: %s", result["log"])
276
+ return None
277
+ batch -= 1
278
+ return best
279
+
280
+
281
+ def stop_source() -> tuple[int, Path]:
282
+ before, _ = current_checkpoint()
283
+ pid = controller_pid()
284
+ if pid is None:
285
+ raise RuntimeError("04 training controller is absent; refusing blind migration")
286
+ raw = remote(SOURCE_HOST, f"ps --ppid {pid} -o pid=,comm=")
287
+ children = []
288
+ for line in raw.splitlines():
289
+ fields = line.split()
290
+ if len(fields) == 2 and fields[1].startswith("syncnet_joint_r"):
291
+ children.append(int(fields[0]))
292
+ if len(children) != 8:
293
+ raise RuntimeError(f"expected eight 04 ranks, found {children}")
294
+ LOGGER.info("requesting graceful 04 stop: controller=%s children=%s", pid, children)
295
+ write_state(phase="stopping_04", source_controller=pid,
296
+ previous_checkpoint_step=before)
297
+ remote(SOURCE_HOST, "kill -TERM " + " ".join(map(str, children)))
298
+ deadline = time.monotonic() + 1200
299
+ while time.monotonic() < deadline:
300
+ if controller_pid() is None:
301
+ step, checkpoint = current_checkpoint()
302
+ if step > before:
303
+ LOGGER.info("04 stopped at complete step %s", step)
304
+ return step, checkpoint
305
+ raise RuntimeError(f"04 exited without a newer complete checkpoint after {before}")
306
+ time.sleep(5)
307
+ raise TimeoutError("04 did not finish graceful checkpoint within 20 minutes")
308
+
309
+
310
+ def launch_target(host: str, source_step: int, source: Path, batch: int) -> dict:
311
+ node = host[-2:]
312
+ run_name = f"joint_8gpu_idle_{node}_resume{source_step}_{stamp()}"
313
+ output = WORKSPACE / "outputs" / run_name
314
+ log = ROOT.parents[1] / ".cluster/logs" / f"multiwam_{run_name}.log"
315
+ # ROOT.parents[1] is /pfs/.../zkw for this project layout.
316
+ log.parent.mkdir(parents=True, exist_ok=True)
317
+ variables = {
318
+ "CUDA_VISIBLE_DEVICES": "0,1,2,3,4,5,6,7",
319
+ "JOINT_RESUME_FROM": str(source),
320
+ "JOINT_OUTPUT_DIR": str(output),
321
+ "JOINT_PER_DEVICE_BATCH": str(batch),
322
+ "JOINT_GRADIENT_ACCUMULATION": "1",
323
+ "JOINT_EXPERIMENT_NAME": f"Joint-World-Action-8GPU{node}-Resume{source_step}",
324
+ }
325
+ prefix = " ".join(f"{key}={shlex.quote(value)}" for key, value in variables.items())
326
+ script = (f"cd {shlex.quote(str(ROOT))} && {{ "
327
+ f"nohup env {prefix} bash scripts/launch_joint_8gpu_idle.sh "
328
+ f"> {shlex.quote(str(log))} 2>&1 < /dev/null & echo $!; }}")
329
+ pid = int(remote(host, script).strip().splitlines()[-1])
330
+ LOGGER.info("launched target host=%s pid=%s output=%s log=%s", host, pid, output, log)
331
+ write_state(phase="starting_target", target_host=host, target_pid=pid,
332
+ target_output=str(output), target_log=str(log), resumed_step=source_step,
333
+ per_device_batch=batch, gradient_accumulation=1)
334
+ deadline = time.monotonic() + 600
335
+ while time.monotonic() < deadline:
336
+ status = remote(host, f"ps -p {pid} -o stat= || true")
337
+ if not status.strip() or status.strip().startswith("Z"):
338
+ raise RuntimeError(f"target exited during startup; inspect {log}")
339
+ rank_count = int(remote(host, f"pgrep -P {pid} | wc -l").strip())
340
+ log_text = log.read_text(errors="replace") if log.exists() else ""
341
+ if "SwanLab initialized:" in log_text and rank_count == 8 \
342
+ and all(value <= 80000 for value in free_memory(host)):
343
+ return {"host": host, "pid": pid, "output": str(output), "log": str(log),
344
+ "step": source_step, "batch": batch}
345
+ if "Traceback (most recent call last)" in log_text:
346
+ raise RuntimeError(f"target startup traceback; inspect {log}")
347
+ time.sleep(5)
348
+ raise TimeoutError(f"target did not reach active training within ten minutes: {log}")
349
+
350
+
351
+ def stop_failed_target() -> None:
352
+ path = STATE_DIR / "state.json"
353
+ if not path.exists():
354
+ return
355
+ state = json.loads(path.read_text())
356
+ host, pid = state.get("target_host"), state.get("target_pid")
357
+ if host and pid:
358
+ remote(host, f"kill -TERM {int(pid)} 2>/dev/null || true")
359
+ for _ in range(60):
360
+ status = remote(host, f"ps -p {int(pid)} -o stat= || true").strip()
361
+ if not status or status.startswith("Z"):
362
+ return
363
+ time.sleep(5)
364
+ LOGGER.warning("force stopping stalled target PID %s on %s", pid, host)
365
+ remote(host, f"pkill -KILL -P {int(pid)} 2>/dev/null || true; "
366
+ f"kill -KILL {int(pid)} 2>/dev/null || true")
367
+ status = remote(host, f"ps -p {int(pid)} -o stat= || true").strip()
368
+ if status and not status.startswith("Z"):
369
+ raise RuntimeError(f"failed target PID {pid} remains alive on {host}")
370
+
371
+
372
+ def restart_source() -> None:
373
+ if controller_pid() is not None:
374
+ return
375
+ cmd = [str(SCHEDULER), "submit", "--host", SOURCE_HOST, "--gpus", "8",
376
+ "--min-free-mb", "120000", "--max-util", "100",
377
+ "--name", "multiwam_joint8_04_auto_recovery", "--cwd", str(ROOT), "--",
378
+ "env", "JOINT_PER_DEVICE_BATCH=10", "JOINT_GRADIENT_ACCUMULATION=2",
379
+ "bash", "scripts/launch_joint_8gpu_04.sh"]
380
+ LOGGER.warning("restarting 04 from latest checkpoint: %s", command(cmd, timeout=45))
381
+
382
+
383
+ def main() -> int:
384
+ parser = argparse.ArgumentParser(description=__doc__)
385
+ parser.add_argument("--once", action="store_true", help="scan once without migration")
386
+ parser.add_argument("--poll-seconds", type=int, default=60)
387
+ args = parser.parse_args()
388
+ STATE_DIR.mkdir(parents=True, exist_ok=True)
389
+ logging.basicConfig(level=logging.INFO,
390
+ format="%(asctime)s %(levelname)s %(message)s")
391
+ lock = (STATE_DIR / "watcher.lock").open("w")
392
+ try:
393
+ fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
394
+ except BlockingIOError:
395
+ LOGGER.error("another idle-eight migration watcher is already running")
396
+ return 2
397
+ all_hosts = hosts()
398
+ if args.once:
399
+ rows = []
400
+ for host in all_hosts:
401
+ try:
402
+ state = gpu_state(host)
403
+ rows.append({"host": host, "idle": state["idle"],
404
+ "used_mb": [gpu["used_mb"] for gpu in state["gpus"]],
405
+ "compute_processes": len(state["compute_pids"])})
406
+ except Exception as exc:
407
+ rows.append({"host": host, "error": str(exc)})
408
+ print(json.dumps(rows, indent=2))
409
+ return 0
410
+ LOGGER.info("watching hosts=%s; ignoring scheduler leases", all_hosts)
411
+ write_state(phase="waiting", watcher_pid=os.getpid(), watched_hosts=all_hosts,
412
+ source_output=str(SOURCE_OUTPUT), leases_ignored=True)
413
+ while True:
414
+ try:
415
+ for host in all_hosts:
416
+ try:
417
+ candidate = gpu_state(host)
418
+ except Exception as exc:
419
+ LOGGER.warning("scan %s failed: %s", host, exc)
420
+ continue
421
+ if not candidate["idle"]:
422
+ continue
423
+ LOGGER.info("eight idle GPUs found on %s; confirming", host)
424
+ time.sleep(10)
425
+ if not gpu_state(host)["idle"]:
426
+ continue
427
+ try:
428
+ chosen = tune(host)
429
+ except Exception:
430
+ LOGGER.exception("could not probe candidate %s; continuing scan", host)
431
+ continue
432
+ if chosen is None:
433
+ continue
434
+ LOGGER.info("validated batch=%s on %s with minimum free=%s MiB",
435
+ chosen["batch"], host, chosen["min_free_mb"])
436
+ write_state(phase="ready_to_migrate", candidate=host,
437
+ validated_batch=chosen["batch"], probe=chosen)
438
+ if not gpu_state(host)["idle"]:
439
+ continue
440
+ try:
441
+ step, source = stop_source()
442
+ except Exception:
443
+ LOGGER.exception("04 graceful stop failed; attempting recovery if needed")
444
+ restart_source()
445
+ continue
446
+ if not gpu_state(host)["idle"]:
447
+ LOGGER.warning("target occupied after 04 stopped; recovering 04")
448
+ restart_source()
449
+ continue
450
+ try:
451
+ result = launch_target(host, step, source, chosen["batch"])
452
+ except Exception:
453
+ LOGGER.exception("target launch failed; attempting 04 recovery")
454
+ stop_failed_target()
455
+ restart_source()
456
+ continue
457
+ LOGGER.info("migration complete: %s", result)
458
+ write_state(phase="migration_complete", result=result)
459
+ return 0
460
+ step, checkpoint = current_checkpoint()
461
+ write_state(phase="waiting", source_checkpoint_step=step,
462
+ source_checkpoint=str(checkpoint), source_controller=controller_pid())
463
+ except Exception as exc:
464
+ LOGGER.exception("watcher iteration failed: %s", exc)
465
+ write_state(phase="error_retrying", last_error=str(exc))
466
+ time.sleep(max(args.poll_seconds, 10))
467
+
468
+
469
+ if __name__ == "__main__":
470
+ sys.exit(main())
release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/best_validation.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "step": 16600,
3
+ "criterion": "fixed_seed_action_FM_not_closed_loop",
4
+ "metrics": {
5
+ "loss_action": 0.006641705986112356,
6
+ "loss_world_flow": 0.2399495542049408,
7
+ "loss_world_latent": 0.5039063096046448,
8
+ "world_recovered_clean_mse": 0.0271708182990551
9
+ }
10
+ }
release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/metrics.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/qwen_online_identity.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format_version": 1,
3
+ "repo": "Qwen/Qwen3-VL-2B-Instruct",
4
+ "local_root": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/models/Qwen3-VL-2B-Instruct",
5
+ "prompt_version": "bihub-v6-role-v1",
6
+ "attention_implementation": "sdpa",
7
+ "dtype": "bfloat16",
8
+ "mode": "frozen_online_no_cache"
9
+ }
release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/resolved_config.json ADDED
@@ -0,0 +1,469 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset_root": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/datasets/RoboTwin2.0",
3
+ "manifest_dir": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/datasets/RoboTwin2.0/mira_manifests/joint_anchor_v2",
4
+ "world_checkpoint": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066",
5
+ "action_checkpoint": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016",
6
+ "codec_checkpoint": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/outputs/mira_robotwin_codec/checkpoint-125000/checkpoint.pth",
7
+ "qwen_root": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/models/Qwen3-VL-2B-Instruct",
8
+ "output_dir": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/outputs/joint_8gpu_07_resume12975_20261011",
9
+ "steps": 55000,
10
+ "per_device_batch": 15,
11
+ "gradient_accumulation": 1,
12
+ "num_workers": 4,
13
+ "shard_group_size": 8,
14
+ "world_rollout_steps": 10,
15
+ "world_activation_checkpoint_blocks": -1,
16
+ "action_activation_checkpoint_blocks": 7,
17
+ "world_partial_checkpoint_block": -1,
18
+ "world_partial_checkpoint_components": "",
19
+ "lr_world": 1e-05,
20
+ "lr_action": 3e-05,
21
+ "warmup_steps": 500,
22
+ "weight_world_flow": 1.0,
23
+ "weight_latent": 0.0,
24
+ "weight_pixel": 0.0,
25
+ "weight_action": 1.0,
26
+ "log_every": 10,
27
+ "save_every": 100,
28
+ "validate_every": 200,
29
+ "validation_batches": 3,
30
+ "keep_last": 3,
31
+ "keep_every": 5000,
32
+ "seed": 2026,
33
+ "no_auto_resume": false,
34
+ "resume_from": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/outputs/joint_8gpu_04_resume12531_20261010/joint-checkpoint-12975",
35
+ "allow_batch_migration": true,
36
+ "resume_preflight_only": false,
37
+ "max_steps": null,
38
+ "max_runtime_seconds": 0,
39
+ "probe_only": false,
40
+ "swanlab_mode": "online",
41
+ "swanlab_project": "Multi_WAM",
42
+ "swanlab_experiment_name": "Joint-World-Action-8GPU07-Resume12975",
43
+ "swanlab_token_file": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/z_oranger/token.txt",
44
+ "resolved_paths": {
45
+ "world": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066",
46
+ "action": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016",
47
+ "codec": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/outputs/mira_robotwin_codec/checkpoint-125000/checkpoint.pth",
48
+ "qwen": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/models/Qwen3-VL-2B-Instruct",
49
+ "manifest": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/datasets/RoboTwin2.0/mira_manifests/joint_anchor_v2/train.jsonl",
50
+ "validation_manifest": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/datasets/RoboTwin2.0/mira_manifests/joint_anchor_v2/val.jsonl",
51
+ "stats": "/pfs/pfs-7jnepv/zkw/project/multi_wam/workspace_joint/datasets/RoboTwin2.0/mira_wam_aloha/dataset_stats.json"
52
+ },
53
+ "world_model": {
54
+ "latent_dim": 32,
55
+ "latent_height": 9,
56
+ "latent_width": 12,
57
+ "context_latents": 10,
58
+ "future_latents": 10,
59
+ "hidden_size": 2048,
60
+ "layers": 16,
61
+ "query_heads": 16,
62
+ "kv_heads": 4,
63
+ "temporal_layers": [
64
+ 0,
65
+ 4,
66
+ 8,
67
+ 12,
68
+ 15
69
+ ],
70
+ "attention_gating": true,
71
+ "qk_norm": "layernorm",
72
+ "activation_checkpointing": true,
73
+ "latent_mean": 0.024823864160431405,
74
+ "latent_std": 1.9595992324017892,
75
+ "anchor": {
76
+ "qwen_hidden_size": 2048,
77
+ "queries_per_view": 8,
78
+ "width": 512,
79
+ "heads": 8,
80
+ "ffn_hidden": 2048,
81
+ "layers": 1,
82
+ "dropout": 0.0,
83
+ "gate_init": 0.1
84
+ },
85
+ "history": {
86
+ "frames": 4,
87
+ "pool_height": 3,
88
+ "pool_width": 4,
89
+ "width": 512,
90
+ "heads": 8
91
+ },
92
+ "state": {
93
+ "hidden_size": 512,
94
+ "layers": 2,
95
+ "heads": 8,
96
+ "history_steps": 20,
97
+ "source_semantics": "simulator_drive_target_not_measured_qpos"
98
+ }
99
+ },
100
+ "action_loss": "masked_action_flow_mse_only",
101
+ "action_inference": {
102
+ "horizon": 20,
103
+ "width": 1024,
104
+ "layers": 8,
105
+ "heads": 16,
106
+ "head_dim": 64,
107
+ "ffn_hidden": 4096,
108
+ "dropout": 0.0,
109
+ "qk_norm": true,
110
+ "local_weights_shared": true,
111
+ "global_registers": 20,
112
+ "direct_left_right_attention": false,
113
+ "monotonic_sigma": 0.1,
114
+ "flow_time_distribution": "logit_normal",
115
+ "flow_time_logit_mean": 0.0,
116
+ "flow_time_logit_std": 1.0,
117
+ "loss": "masked_action_flow_mse_only",
118
+ "sampler": "euler",
119
+ "sampling_steps": 10,
120
+ "cfg_scale": 1.0,
121
+ "execute_steps": 8,
122
+ "normalized_action_clip": 5.0
123
+ },
124
+ "state_stats": {
125
+ "semantics": "simulator_drive_target_not_measured_qpos",
126
+ "dimension_order": [
127
+ "left_joint_0",
128
+ "left_joint_1",
129
+ "left_joint_2",
130
+ "left_joint_3",
131
+ "left_joint_4",
132
+ "left_joint_5",
133
+ "left_gripper",
134
+ "right_joint_0",
135
+ "right_joint_1",
136
+ "right_joint_2",
137
+ "right_joint_3",
138
+ "right_joint_4",
139
+ "right_joint_5",
140
+ "right_gripper"
141
+ ],
142
+ "count": 3969756,
143
+ "mean": [
144
+ -0.23842423294383108,
145
+ 1.129219465433914,
146
+ 0.8063186023981325,
147
+ -0.31013122977812463,
148
+ 0.0550065751813196,
149
+ -0.037801799381435436,
150
+ 0.665747107563347,
151
+ 0.21670644188394284,
152
+ 1.079659954600694,
153
+ 0.7880658701387332,
154
+ -0.32116052291552066,
155
+ -0.017377219292802774,
156
+ 0.035480138265607274,
157
+ 0.6792893846359807
158
+ ],
159
+ "std": [
160
+ 0.4159145164214798,
161
+ 1.0046354351335027,
162
+ 0.7767576027880211,
163
+ 0.6730596869402354,
164
+ 0.27067547362364786,
165
+ 0.6198195164104278,
166
+ 0.45458932319320244,
167
+ 0.3502395812196796,
168
+ 1.0249536977642213,
169
+ 0.794444111709162,
170
+ 0.6851519616642173,
171
+ 0.2446065264929482,
172
+ 0.614649842790471,
173
+ 0.44984026320575266
174
+ ],
175
+ "minimum": [
176
+ -7.552278995513916,
177
+ -0.36354875564575195,
178
+ -0.18528024852275848,
179
+ -1.956291913986206,
180
+ -1.6801013946533203,
181
+ -7.678869724273682,
182
+ 0.0,
183
+ -8.539926528930664,
184
+ -0.6294453740119934,
185
+ -0.07713392376899719,
186
+ -2.1328067779541016,
187
+ -2.1285502910614014,
188
+ -8.228925704956055,
189
+ 0.0
190
+ ],
191
+ "maximum": [
192
+ 6.45659065246582,
193
+ 4.179152488708496,
194
+ 5.346591472625732,
195
+ 1.7942548990249634,
196
+ 1.8604620695114136,
197
+ 5.43813943862915,
198
+ 1.0,
199
+ 7.142920017242432,
200
+ 4.157068729400635,
201
+ 5.672450065612793,
202
+ 1.95806884765625,
203
+ 1.5663840770721436,
204
+ 5.278550624847412,
205
+ 1.0
206
+ ],
207
+ "normalization_std_floor": 0.01,
208
+ "normalization_clip": 5.0,
209
+ "train_manifest_sha256": "fd762a4633991e77bfefe956f1a0c0e0305228e51bef57d39ca0bd350370a4cc"
210
+ },
211
+ "action_stats": {
212
+ "dimension_order": [
213
+ "left_joint_0",
214
+ "left_joint_1",
215
+ "left_joint_2",
216
+ "left_joint_3",
217
+ "left_joint_4",
218
+ "left_joint_5",
219
+ "left_gripper",
220
+ "right_joint_0",
221
+ "right_joint_1",
222
+ "right_joint_2",
223
+ "right_joint_3",
224
+ "right_joint_4",
225
+ "right_joint_5",
226
+ "right_gripper"
227
+ ],
228
+ "episode_count": 26950,
229
+ "episode_overlap": 0,
230
+ "format_version": 1,
231
+ "identity_sha256": "3be63ac371e88521642f1925ba0470ad64389ae62f597b88ccad1eea818cca54",
232
+ "mad": [
233
+ 0.15985311567783356,
234
+ 0.5771785974502563,
235
+ 0.828437328338623,
236
+ 0.6159048676490784,
237
+ 0.003159316023811698,
238
+ 0.07214008271694183,
239
+ 0.0,
240
+ 0.11001618951559067,
241
+ 0.6766568422317505,
242
+ 0.9398051500320435,
243
+ 0.6257827281951904,
244
+ 0.0021169157698750496,
245
+ 0.03799381107091904,
246
+ 0.0
247
+ ],
248
+ "mean": [
249
+ -0.26276024075137455,
250
+ 1.2279671713210598,
251
+ 0.8737799258034123,
252
+ -0.3247152758601896,
253
+ 0.059352640515124795,
254
+ -0.044222020657090494,
255
+ 0.6159483659145811,
256
+ 0.23903514873537698,
257
+ 1.1785528297611068,
258
+ 0.8572114056461271,
259
+ -0.3363709341476945,
260
+ -0.0189488661769259,
261
+ 0.039572275675667394,
262
+ 0.6316922837836962
263
+ ],
264
+ "median": [
265
+ -0.13985976576805115,
266
+ 1.7456244230270386,
267
+ 0.9851341247558594,
268
+ -1.3280065104481764e-05,
269
+ 0.0,
270
+ 0.0,
271
+ 1.0,
272
+ 0.11001618951559067,
273
+ 1.7171932458877563,
274
+ 0.9723858833312988,
275
+ 0.0,
276
+ 0.0,
277
+ 0.0,
278
+ 1.0
279
+ ],
280
+ "median_20mad_violations": [
281
+ 9038,
282
+ 0,
283
+ 0,
284
+ 0,
285
+ 913634,
286
+ 176934,
287
+ 1484543,
288
+ 8469,
289
+ 0,
290
+ 0,
291
+ 0,
292
+ 816034,
293
+ 554435,
294
+ 1426734
295
+ ],
296
+ "per_episode_target_slice": "action20_f32[19:2*n_latents-1]",
297
+ "physical_identity": {
298
+ "arm_joint_names": [
299
+ "fl_joint1",
300
+ "fl_joint2",
301
+ "fl_joint3",
302
+ "fl_joint4",
303
+ "fl_joint5",
304
+ "fl_joint6",
305
+ "fr_joint1",
306
+ "fr_joint2",
307
+ "fr_joint3",
308
+ "fr_joint4",
309
+ "fr_joint5",
310
+ "fr_joint6"
311
+ ],
312
+ "config": "/public/interns/haocheng/Oranger/project/multi_wam/workspace/vendor/RoboTwin/assets/embodiments/aloha-agilex/config.yml",
313
+ "config_sha256": "a4f043d2d4b44cca5ec47fb498a3194da3f87ff9530dcbfdcee1539a44423d57",
314
+ "gripper_joint_names": [
315
+ "fl_joint7",
316
+ "fr_joint7"
317
+ ],
318
+ "gripper_mapping": "policy_[0,1]_mapped_by_Robot.set_gripper_to_prismatic_drive_target",
319
+ "gripper_policy_limits": [
320
+ 0.0,
321
+ 1.0
322
+ ],
323
+ "gripper_real_scale": [
324
+ -0.01,
325
+ 0.045
326
+ ],
327
+ "urdf": "/public/interns/haocheng/Oranger/project/multi_wam/workspace/vendor/RoboTwin/assets/embodiments/aloha-agilex/urdf/arx5_description_isaac.urdf",
328
+ "urdf_sha256": "097c59fb19a7b482249c6097df8319586ea7cfd268c015516f103b289a7e761a"
329
+ },
330
+ "physical_limit_violations": [
331
+ 0,
332
+ 0,
333
+ 0,
334
+ 0,
335
+ 0,
336
+ 0,
337
+ 0,
338
+ 0,
339
+ 0,
340
+ 0,
341
+ 0,
342
+ 0,
343
+ 0,
344
+ 0
345
+ ],
346
+ "physical_max": [
347
+ 10.0,
348
+ 10.0,
349
+ 10.0,
350
+ 10.0,
351
+ 10.0,
352
+ 10.0,
353
+ 1.0,
354
+ 10.0,
355
+ 10.0,
356
+ 10.0,
357
+ 10.0,
358
+ 10.0,
359
+ 10.0,
360
+ 1.0
361
+ ],
362
+ "physical_min": [
363
+ -10.0,
364
+ -10.0,
365
+ -10.0,
366
+ -10.0,
367
+ -10.0,
368
+ -10.0,
369
+ 0.0,
370
+ -10.0,
371
+ -10.0,
372
+ -10.0,
373
+ -10.0,
374
+ -10.0,
375
+ -10.0,
376
+ 0.0
377
+ ],
378
+ "q001": [
379
+ -6.401034355163574,
380
+ -5.257390398583084e-07,
381
+ -2.8215323254698887e-05,
382
+ -1.7927707433700562,
383
+ -1.2653756141662598,
384
+ -6.153688907623291,
385
+ 0.0,
386
+ -2.775286912918091,
387
+ -0.37440356612205505,
388
+ -2.81171942333458e-05,
389
+ -1.8059775829315186,
390
+ -1.3924448490142822,
391
+ -3.974787473678589,
392
+ 0.0
393
+ ],
394
+ "q999": [
395
+ 0.4268765449523926,
396
+ 3.1502649784088135,
397
+ 3.5949294567108154,
398
+ 1.62345552444458,
399
+ 1.4587470293045044,
400
+ 2.5910685062408447,
401
+ 1.0,
402
+ 1.2237188816070557,
403
+ 2.9219048023223877,
404
+ 3.3141260147094727,
405
+ 1.6701792478561401,
406
+ 1.2955957651138306,
407
+ 3.181866407394409,
408
+ 1.0
409
+ ],
410
+ "sample_count": 3430756,
411
+ "source_manifest": "/public/interns/haocheng/Oranger/project/multi_wam/workspace/artifacts/latent_cache/c07fedc40214687438d50db4aef416ed91a3f91aeaeb3435623a74d61f7ce615/manifest_train.jsonl",
412
+ "source_manifest_sha256": "639f4b3292de77f17b9fb9ee7e3c288e0823aab53fca75c73fae93ca60afc010",
413
+ "split": "train_only",
414
+ "statistics_scope": "deduplicated_union_of_action20_targets_reachable_by_train_windows",
415
+ "std": [
416
+ 0.43764166749659794,
417
+ 1.0115041220132917,
418
+ 0.7878336066622994,
419
+ 0.7012330276733094,
420
+ 0.28464300063231485,
421
+ 0.6528320117067283,
422
+ 0.46822663440758655,
423
+ 0.36684612466926664,
424
+ 1.0366439206556548,
425
+ 0.8073265456939983,
426
+ 0.7172314487625776,
427
+ 0.26030669786332755,
428
+ 0.6480145923069487,
429
+ 0.4644942543259035
430
+ ],
431
+ "std_floor": 0.0001,
432
+ "validation_episode_count": 550,
433
+ "validation_manifest_sha256": "7c4105fd080fc4b5205044dc1f7935271d4665aae41bb4388b20d4e23ddaef36"
434
+ },
435
+ "parameter_summary": {
436
+ "joint_total": 1865580740,
437
+ "joint_trainable": 1865580740,
438
+ "world_trainable": 1349974130,
439
+ "action_trainable": 515606610,
440
+ "codec_frozen": 900300192,
441
+ "qwen3_frozen": 2127532032,
442
+ "optimizer_parameters": 1865580740
443
+ },
444
+ "frozen_boundary": {
445
+ "frozen": [
446
+ "qwen3_vl",
447
+ "lingbot_codec"
448
+ ],
449
+ "trainable": [
450
+ "world_all",
451
+ "current_resampler",
452
+ "state_encoder",
453
+ "action_all"
454
+ ]
455
+ },
456
+ "activation_checkpointing": {
457
+ "world_blocks": 16,
458
+ "world_blocks_total": 16,
459
+ "world_partial_block": -1,
460
+ "world_partial_components": [],
461
+ "action_blocks": 7,
462
+ "action_blocks_total": 8
463
+ },
464
+ "distributed_sharding": {
465
+ "mode": "full_1d",
466
+ "shard_group_size": 8,
467
+ "replica_groups": 1
468
+ }
469
+ }
release-20261014/metadata/outputs/joint_8gpu_07_resume12975_20261011/validation.jsonl ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"step": 13000, "loss_action": 0.0067005162127316, "loss_world_flow": 0.2391764372587204, "loss_world_latent": 0.5076497793197632, "world_recovered_clean_mse": 0.0270538330078125}
2
+ {"step": 13200, "loss_action": 0.007048924919217825, "loss_world_flow": 0.2393798977136612, "loss_world_latent": 0.5134277939796448, "world_recovered_clean_mse": 0.0271046943962574}
3
+ {"step": 13400, "loss_action": 0.007011095993220806, "loss_world_flow": 0.2389322966337204, "loss_world_latent": 0.5189616084098816, "world_recovered_clean_mse": 0.0269775390625}
4
+ {"step": 13600, "loss_action": 0.007447561249136925, "loss_world_flow": 0.2399088591337204, "loss_world_latent": 0.5213216543197632, "world_recovered_clean_mse": 0.02725728414952755}
5
+ {"step": 13800, "loss_action": 0.0067227683030068874, "loss_world_flow": 0.239501953125, "loss_world_latent": 0.5269368886947632, "world_recovered_clean_mse": 0.02716064453125}
6
+ {"step": 14000, "loss_action": 0.007205963134765625, "loss_world_flow": 0.2394205778837204, "loss_world_latent": 0.5148112177848816, "world_recovered_clean_mse": 0.0270640067756176}
7
+ {"step": 14200, "loss_action": 0.006966273766011, "loss_world_flow": 0.2392171323299408, "loss_world_latent": 0.509765625, "world_recovered_clean_mse": 0.02704366110265255}
8
+ {"step": 14400, "loss_action": 0.006931941490620375, "loss_world_flow": 0.2395426481962204, "loss_world_latent": 0.5218099355697632, "world_recovered_clean_mse": 0.0271555595099926}
9
+ {"step": 14600, "loss_action": 0.00747998571023345, "loss_world_flow": 0.2395426630973816, "loss_world_latent": 0.5253092646598816, "world_recovered_clean_mse": 0.027130126953125}
10
+ {"step": 14800, "loss_action": 0.0080235805362463, "loss_world_flow": 0.2392578125, "loss_world_latent": 0.5234375, "world_recovered_clean_mse": 0.0270538330078125}
11
+ {"step": 15000, "loss_action": 0.007311503402888775, "loss_world_flow": 0.2396240383386612, "loss_world_latent": 0.5174967646598816, "world_recovered_clean_mse": 0.0270487479865551}
12
+ {"step": 15200, "loss_action": 0.008310318924486637, "loss_world_flow": 0.2395833432674408, "loss_world_latent": 0.523193359375, "world_recovered_clean_mse": 0.02707417868077755}
13
+ {"step": 15400, "loss_action": 0.007149060722440481, "loss_world_flow": 0.2397461086511612, "loss_world_latent": 0.5120443105697632, "world_recovered_clean_mse": 0.0270487479865551}
14
+ {"step": 15600, "loss_action": 0.008104324340820312, "loss_world_flow": 0.239827498793602, "loss_world_latent": 0.5218912959098816, "world_recovered_clean_mse": 0.02711995504796505}
15
+ {"step": 15800, "loss_action": 0.007505735382437706, "loss_world_flow": 0.2398274838924408, "loss_world_latent": 0.511474609375, "world_recovered_clean_mse": 0.02711995504796505}
16
+ {"step": 16000, "loss_action": 0.00775464391335845, "loss_world_flow": 0.2399088740348816, "loss_world_latent": 0.5143229365348816, "world_recovered_clean_mse": 0.0271097831428051}
17
+ {"step": 16200, "loss_action": 0.007294019218534231, "loss_world_flow": 0.2398274838924408, "loss_world_latent": 0.5082194209098816, "world_recovered_clean_mse": 0.0271148681640625}
18
+ {"step": 16400, "loss_action": 0.00784810446202755, "loss_world_flow": 0.2402750700712204, "loss_world_latent": 0.5082194209098816, "world_recovered_clean_mse": 0.0272267684340477}
19
+ {"step": 16600, "loss_action": 0.006641705986112356, "loss_world_flow": 0.2399495542049408, "loss_world_latent": 0.5039063096046448, "world_recovered_clean_mse": 0.0271708182990551}
20
+ {"step": 16800, "loss_action": 0.007353783119469881, "loss_world_flow": 0.239501953125, "loss_world_latent": 0.52294921875, "world_recovered_clean_mse": 0.02709961123764515}
21
+ {"step": 17000, "loss_action": 0.0071589150466024876, "loss_world_flow": 0.2400309294462204, "loss_world_latent": 0.522216796875, "world_recovered_clean_mse": 0.02710978128015995}
22
+ {"step": 17200, "loss_action": 0.00723139476031065, "loss_world_flow": 0.2401936948299408, "loss_world_latent": 0.5174154043197632, "world_recovered_clean_mse": 0.02714538760483265}
23
+ {"step": 17400, "loss_action": 0.006714502815157175, "loss_world_flow": 0.2400716096162796, "loss_world_latent": 0.5123698711395264, "world_recovered_clean_mse": 0.0270894356071949}
24
+ {"step": 17600, "loss_action": 0.007697423920035362, "loss_world_flow": 0.2406005859375, "loss_world_latent": 0.5087077021598816, "world_recovered_clean_mse": 0.02726745419204235}
release-20261014/patches/step12531_to_step17700_code.patch ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --- a/mira/scripts/train_joint_world_action.py
2
+ +++ b/mira_09/scripts/train_joint_world_action.py
3
+ @@ -153,6 +153,15 @@
4
+ parser.add_argument("--keep-every", type=int, default=5000)
5
+ parser.add_argument("--seed", type=int, default=2026)
6
+ parser.add_argument("--no-auto-resume", action="store_true")
7
+ + parser.add_argument(
8
+ + "--resume-from",
9
+ + help="Checkpoint to migrate into a new 8-rank output run.",
10
+ + )
11
+ + parser.add_argument(
12
+ + "--allow-batch-migration", action="store_true",
13
+ + help="Resume an 8-rank checkpoint into a new output with a different batch/accumulation.",
14
+ + )
15
+ + parser.add_argument("--resume-preflight-only", action="store_true")
16
+ parser.add_argument("--max-steps", type=int)
17
+ parser.add_argument(
18
+ "--max-runtime-seconds", type=int, default=0,
19
+ @@ -341,10 +350,63 @@
20
+ scheduler: Any,
21
+ sampler: JointEvalAlignedSampler,
22
+ identity: dict,
23
+ + migrate_24_to_8: bool = False,
24
+ + migrate_8_batch: bool = False,
25
+ ) -> int:
26
+ rank = dist.get_rank() if dist.is_initialized() else 0
27
+ metadata = json.loads((checkpoint / "trainer_state.json").read_text(encoding="utf-8"))
28
+ - if metadata.get("artifact_identity_sha256") != canonical_sha256(identity):
29
+ + source_identity = metadata["artifact_identity"]
30
+ + source_digest = metadata.get("artifact_identity_sha256")
31
+ + if source_digest != canonical_sha256(source_identity):
32
+ + raise ValueError("source checkpoint identity checksum is invalid")
33
+ + if migrate_24_to_8:
34
+ + if source_digest != "ed0821370e634911d01e3ce1b533234de313d39a5ed7545c23124d2f6bc78b91":
35
+ + raise ValueError("migration requires the untouched published step-12531 checkpoint")
36
+ + if metadata.get("completed_steps") != 12531 or source_identity["world_size"] != 24 or identity["world_size"] != 8:
37
+ + raise ValueError("migration requires the published 24-rank state and 8 destination ranks")
38
+ + preserved = (
39
+ + "architecture", "dataset_manifest_sha256", "dataset_stats_sha256",
40
+ + "validation_manifest_sha256", "world_source_artifact",
41
+ + "world_checkpoint_fingerprint", "action_source_artifact",
42
+ + "action_checkpoint_fingerprint", "codec_checkpoint_sha256",
43
+ + "qwen_config_sha256", "online_cache_policy", "history_contract",
44
+ + "loss_weights", "world_rollout_steps", "world_schedule",
45
+ + )
46
+ + for key in preserved:
47
+ + if source_identity[key] != identity[key]:
48
+ + raise ValueError(f"migration changed the released training contract: {key}")
49
+ + for key in ("seed", "steps", "lr_world", "lr_action", "warmup_steps"):
50
+ + if source_identity["optimization"][key] != identity["optimization"][key]:
51
+ + raise ValueError(f"migration changed the optimizer schedule: {key}")
52
+ + for name, digest in source_identity["implementation_sha256"].items():
53
+ + if name != "scripts/train_joint_world_action.py" and identity["implementation_sha256"][name] != digest:
54
+ + raise ValueError(f"migration changed a model or data implementation: {name}")
55
+ + elif migrate_8_batch:
56
+ + if source_identity["world_size"] != 8 or identity["world_size"] != 8:
57
+ + raise ValueError("batch migration requires an 8-rank source and destination")
58
+ + preserved = (
59
+ + "architecture", "dataset_manifest_sha256", "dataset_stats_sha256",
60
+ + "validation_manifest_sha256", "world_source_artifact",
61
+ + "world_checkpoint_fingerprint", "action_source_artifact",
62
+ + "action_checkpoint_fingerprint", "codec_checkpoint_sha256",
63
+ + "qwen_root", "qwen_config_sha256", "online_cache_policy",
64
+ + "history_contract", "loss_weights", "world_rollout_steps", "world_schedule",
65
+ + )
66
+ + for key in preserved:
67
+ + if source_identity[key] != identity[key]:
68
+ + raise ValueError(f"batch migration changed the training contract: {key}")
69
+ + for key, value in source_identity["optimization"].items():
70
+ + if key not in {"per_device_batch", "gradient_accumulation"} and identity["optimization"][key] != value:
71
+ + raise ValueError(f"batch migration changed optimizer setting: {key}")
72
+ + for name, digest in source_identity["implementation_sha256"].items():
73
+ + if name != "scripts/train_joint_world_action.py" and identity["implementation_sha256"][name] != digest:
74
+ + raise ValueError(f"batch migration changed model or data implementation: {name}")
75
+ + if (source_identity["optimization"]["per_device_batch"],
76
+ + source_identity["optimization"]["gradient_accumulation"]) == (
77
+ + identity["optimization"]["per_device_batch"],
78
+ + identity["optimization"]["gradient_accumulation"]):
79
+ + raise ValueError("batch migration requires a changed batch or accumulation")
80
+ + elif source_digest != canonical_sha256(identity):
81
+ raise ValueError("joint checkpoint identity differs from this run")
82
+ model_state, optimizer_state = get_state_dict(model, optimizer)
83
+ state = {"model": model_state, "optimizer": optimizer_state}
84
+ @@ -359,7 +421,13 @@
85
+ checkpoint / f"rank-{rank:05d}.pth", map_location="cpu", weights_only=False
86
+ )
87
+ scheduler.load_state_dict(rank_state["scheduler"])
88
+ - sampler.load_state_dict(rank_state["sampler"])
89
+ + if migrate_24_to_8:
90
+ + # The sampler indexes the global stream as consumed * world_size + rank.
91
+ + # Preserve its next global position when reducing 24 ranks to 8.
92
+ + consumed = int(rank_state["sampler"]["consumed"])
93
+ + sampler.load_state_dict({"consumed": consumed * 3})
94
+ + else:
95
+ + sampler.load_state_dict(rank_state["sampler"])
96
+ random.setstate(rank_state["python_rng"])
97
+ np.random.set_state(rank_state["numpy_rng"])
98
+ torch.set_rng_state(rank_state["torch_rng"])
99
+ @@ -441,6 +509,10 @@
100
+ output.mkdir(parents=True, exist_ok=True)
101
+ if args.no_auto_resume and _complete_checkpoints(output):
102
+ raise ValueError("--no-auto-resume requires a new output directory; refusing checkpoint overwrite")
103
+ + if args.resume_from and args.no_auto_resume:
104
+ + raise ValueError("--resume-from and --no-auto-resume cannot be combined")
105
+ + if args.allow_batch_migration and not args.resume_from:
106
+ + raise ValueError("--allow-batch-migration requires --resume-from")
107
+ paths = {
108
+ "world": Path(args.world_checkpoint or defaults["world"]).resolve(),
109
+ "action": Path(args.action_checkpoint or defaults["action"]).resolve(),
110
+ @@ -776,6 +848,32 @@
111
+ sampler=sampler,
112
+ identity=identity,
113
+ )
114
+ + elif args.resume_from:
115
+ + resume_path = Path(args.resume_from).expanduser().resolve()
116
+ + start = _resume(
117
+ + resume_path,
118
+ + model=trainable,
119
+ + optimizer=optimizer,
120
+ + scheduler=scheduler,
121
+ + sampler=sampler,
122
+ + identity=identity,
123
+ + migrate_24_to_8=not args.allow_batch_migration,
124
+ + migrate_8_batch=args.allow_batch_migration,
125
+ + )
126
+ + if args.resume_preflight_only:
127
+ + if rank == 0:
128
+ + (output / "resume_preflight.json").write_text(
129
+ + json.dumps({
130
+ + "status": "passed", "source_step": start,
131
+ + "destination_world_size": world_size,
132
+ + "next_sampler_position_per_rank": sampler.consumed,
133
+ + "new_artifact_identity_sha256": canonical_sha256(identity),
134
+ + }, indent=2) + "\n", encoding="utf-8"
135
+ + )
136
+ + _barrier()
137
+ + if dist.is_initialized():
138
+ + dist.destroy_process_group()
139
+ + return
140
+ total = min(args.steps, args.max_steps) if args.max_steps is not None else args.steps
141
+ iterator = iter(loader)
142
+ if start >= total:
143
+ --- a/mira/src/mira/training/swanlab_tracker.py
144
+ +++ b/mira_09/src/mira/training/swanlab_tracker.py
145
+ @@ -26,12 +26,24 @@
146
+
147
+
148
+ def _force_direct_connection() -> None:
149
+ - """Make every HTTP client created by SwanLab bypass environment proxies."""
150
+ + """Keep the node's working SwanLab route while excluding Codex's reserved port."""
151
+ + if os.environ.get("SWANLAB_FORCE_DIRECT") == "1":
152
+ + for variable in _PROXY_ENDPOINT_VARIABLES:
153
+ + os.environ.pop(variable, None)
154
+ + os.environ["NO_PROXY"] = "*"
155
+ + os.environ["no_proxy"] = "*"
156
+ + return
157
+ + proxy = os.environ.get("https_proxy") or os.environ.get("HTTPS_PROXY")
158
+ + if not proxy or "127.0.0.1:7892" in proxy:
159
+ + proxy = "http://192.168.0.135:18000"
160
+ for variable in _PROXY_ENDPOINT_VARIABLES:
161
+ - os.environ.pop(variable, None)
162
+ - # Requests/httpx honor these variables even if a parent process later injects a proxy endpoint.
163
+ - os.environ["NO_PROXY"] = "*"
164
+ - os.environ["no_proxy"] = "*"
165
+ + if "ftp" in variable.lower():
166
+ + os.environ.pop(variable, None)
167
+ + else:
168
+ + os.environ[variable] = proxy
169
+ + local_hosts = "localhost,127.0.0.1,192.168.0.0/16,10.0.0.0/8"
170
+ + os.environ["NO_PROXY"] = local_hosts
171
+ + os.environ["no_proxy"] = local_hosts
172
+
173
+
174
+ def _without_secrets(value: Any) -> Any:
release-20261014/scripts/download_release.sh ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ DEST="${1:?usage: download_release.sh DOWNLOAD_DIR}"
5
+ mkdir -p "$DEST"
6
+ # The direct Hub route is the reproducible default. Use a permitted workspace
7
+ # proxy only when direct access is unavailable; never use Codex's reserved port.
8
+ unset http_proxy https_proxy all_proxy ftp_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY FTP_PROXY
9
+ export NO_PROXY='*' no_proxy='*' HF_XET_HIGH_PERFORMANCE=1
10
+ REVISION="snapshot-20261014-joint17700"
11
+ hf download Orangerl/multi-wam --revision "$REVISION" \
12
+ --include 'README.md' --include 'PROGRESS_20261014.md' \
13
+ --include 'skills/multi-wam-joint-reproduce/**' \
14
+ --include 'skills/multi-wam-joint-continue/**' \
15
+ --include 'release-20261010/**' \
16
+ --include 'release-20261014/**' \
17
+ --include 'archives/codec-checkpoint-step125000.tar.zst' \
18
+ --include 'archives/qwen3-vl-2b-instruct.tar.zst' \
19
+ --include 'release-20260902/workspace/outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066/**' \
20
+ --include 'release-20260902/workspace/outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016/**' \
21
+ --local-dir "$DEST"
22
+ echo "Downloaded pinned Multi-WAM step-17700 release to $DEST"
release-20261014/scripts/relocate_checkpoint_identity.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Relocate only the Qwen path in a restored copy of step-17700 metadata."""
3
+
4
+ import argparse
5
+ import hashlib
6
+ import json
7
+ from pathlib import Path
8
+
9
+
10
+ ORIGINAL_SHA256 = "74250186f7e6e3d8e8e5c78f5830207ff14bcea32b3fbf6bfb9b2a5d34c16cc7"
11
+ CHECKPOINT = "outputs/joint_8gpu_07_resume12975_20261011/joint-checkpoint-17700"
12
+
13
+
14
+ def digest(value):
15
+ return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(",", ":"),
16
+ ensure_ascii=False).encode()).hexdigest()
17
+
18
+
19
+ def file_hash(path):
20
+ result = hashlib.sha256()
21
+ with path.open("rb") as handle:
22
+ for chunk in iter(lambda: handle.read(16 << 20), b""):
23
+ result.update(chunk)
24
+ return result.hexdigest()
25
+
26
+
27
+ def main(workspace):
28
+ workspace = workspace.resolve()
29
+ path = workspace / CHECKPOINT / "trainer_state.json"
30
+ state = json.loads(path.read_text())
31
+ identity = state["artifact_identity"]
32
+ if state["artifact_identity_sha256"] != ORIGINAL_SHA256 or digest(identity) != ORIGINAL_SHA256:
33
+ raise SystemExit("Refusing: checkpoint is not the published step-17700 identity")
34
+ original_nested = identity["sha256"]
35
+ if digest({key: value for key, value in identity.items() if key != "sha256"}) != original_nested:
36
+ raise SystemExit("Refusing: nested identity checksum mismatch")
37
+ qwen = workspace / "models/Qwen3-VL-2B-Instruct"
38
+ if file_hash(qwen / "config.json") != identity["qwen_config_sha256"]:
39
+ raise SystemExit("Refusing: Qwen config changed")
40
+ for name, expected in identity["implementation_sha256"].items():
41
+ if file_hash(workspace / "mira_09" / name) != expected:
42
+ raise SystemExit(f"Refusing: source changed: {name}")
43
+ if identity["qwen_root"] == str(qwen):
44
+ print("Qwen path already matches restored workspace")
45
+ return
46
+ identity["qwen_root"] = str(qwen)
47
+ identity.pop("sha256")
48
+ identity["sha256"] = digest(identity)
49
+ state["artifact_identity_sha256"] = digest(identity)
50
+ state["relocation_audit"] = {
51
+ "source_artifact_identity_sha256": ORIGINAL_SHA256,
52
+ "source_nested_sha256": original_nested,
53
+ "changed_field": "artifact_identity.qwen_root",
54
+ "purpose": "destination-local path relocation; no tensor, optimizer, sampler or RNG changes",
55
+ }
56
+ temp = path.with_suffix(".json.relocating")
57
+ temp.write_text(json.dumps(state, indent=2, ensure_ascii=False) + "\n")
58
+ temp.replace(path)
59
+ print("Relocated restored checkpoint metadata to", qwen)
60
+
61
+
62
+ if __name__ == "__main__":
63
+ parser = argparse.ArgumentParser(description=__doc__)
64
+ parser.add_argument("workspace", type=Path)
65
+ args = parser.parse_args()
66
+ main(args.workspace)
release-20261014/scripts/restore_release.sh ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ if [[ $# -ne 2 ]]; then
5
+ echo "usage: restore_release.sh DOWNLOAD_DIR EMPTY_WORKSPACE" >&2
6
+ exit 2
7
+ fi
8
+ BUNDLE="$(cd "$1" && pwd)"
9
+ WORKSPACE="$2"
10
+ RELEASE="$BUNDLE/release-20261014"
11
+ [[ -s "$RELEASE/SHA256SUMS" ]] || { echo "Missing 2026-10-14 release" >&2; exit 2; }
12
+ (cd "$BUNDLE" && sha256sum -c release-20261014/SHA256SUMS)
13
+
14
+ # The published October 10 layer supplies frozen assets and both packed environments.
15
+ bash "$BUNDLE/skills/multi-wam-joint-reproduce/scripts/restore_release.sh" \
16
+ "$BUNDLE" "$WORKSPACE"
17
+ WORKSPACE="$(cd "$WORKSPACE" && pwd)"
18
+ tar --zstd -xf "$RELEASE/archives/source-code-joint17700.tar.zst" -C "$WORKSPACE"
19
+ tar --zstd -xf "$RELEASE/archives/joint-checkpoint-17700.tar.zst" -C "$WORKSPACE"
20
+ # Preserve the stopped run as audit history. The resumable output retains
21
+ # metrics through step 17700 and the best-validation criterion, then appends
22
+ # new metrics without counting the discarded step 17710 twice.
23
+ mkdir -p "$WORKSPACE/release_history/joint17700"
24
+ cp -a "$RELEASE/metadata/outputs/joint_8gpu_07_resume12975_20261011/." \
25
+ "$WORKSPACE/release_history/joint17700/"
26
+ OUTPUT="$WORKSPACE/outputs/joint_8gpu_07_resume12975_20261011"
27
+ cp "$WORKSPACE/release_history/joint17700/best_validation.json" "$OUTPUT/"
28
+ cp "$WORKSPACE/release_history/joint17700/validation.jsonl" "$OUTPUT/"
29
+ "$WORKSPACE/conda/envs/mira/bin/python" - "$WORKSPACE/release_history/joint17700/metrics.jsonl" "$OUTPUT/metrics.jsonl" <<'PY'
30
+ import json
31
+ import sys
32
+ with open(sys.argv[1], encoding="utf-8") as source, open(sys.argv[2], "w", encoding="utf-8") as output:
33
+ for line in source:
34
+ if int(json.loads(line)["step"]) <= 17700:
35
+ output.write(line)
36
+ PY
37
+ "$WORKSPACE/conda/envs/mira/bin/python" \
38
+ "$RELEASE/scripts/relocate_checkpoint_identity.py" "$WORKSPACE"
39
+ "$WORKSPACE/conda/envs/mira/bin/python" \
40
+ "$RELEASE/scripts/verify_release.py" "$WORKSPACE"
41
+ echo "Restored step-17700 continuation at $WORKSPACE"
42
+ echo "Download the external pinned RoboTwin dataset before 8-GPU training."
release-20261014/scripts/resume_8gpu.sh ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ if [[ $# -ne 1 ]]; then
5
+ echo "usage: resume_8gpu.sh RESTORED_WORKSPACE" >&2
6
+ exit 2
7
+ fi
8
+ WORKSPACE="$(cd "$1" && pwd)"
9
+ PYTHON="$WORKSPACE/conda/envs/mira/bin/python"
10
+ DATASET="$WORKSPACE/datasets/RoboTwin2.0"
11
+ OUTPUT="$WORKSPACE/outputs/joint_8gpu_07_resume12975_20261011"
12
+ CHECKPOINT="$OUTPUT/joint-checkpoint-17700"
13
+ [[ -x "$PYTHON" && -s "$CHECKPOINT/trainer_state.json" ]] || {
14
+ echo "Missing restored environment or complete step-17700 checkpoint" >&2; exit 2;
15
+ }
16
+ [[ "$(nvidia-smi -L | wc -l)" -eq 8 ]] || { echo "Expected eight local GPUs" >&2; exit 2; }
17
+ GPU_SET="$(tr ',' '\n' <<< "${CUDA_VISIBLE_DEVICES:-0,1,2,3,4,5,6,7}" | sort -n | paste -sd, -)"
18
+ [[ "$GPU_SET" == "0,1,2,3,4,5,6,7" ]] || { echo "Expected physical GPUs 0-7" >&2; exit 2; }
19
+ [[ "$(find "$DATASET/dataset" -mindepth 2 -maxdepth 2 -name 'aloha-agilex_*.zip' | wc -l)" -eq 100 ]] || {
20
+ echo "Download the 100 pinned RoboTwin ALOHA archives first" >&2; exit 2;
21
+ }
22
+
23
+ export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
24
+ export PYTHONPATH="$WORKSPACE/mira_09/src${PYTHONPATH:+:$PYTHONPATH}"
25
+ export PYTHONUNBUFFERED=1 TOKENIZERS_PARALLELISM=false
26
+ export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 TORCH_NCCL_ASYNC_ERROR_HANDLING=1
27
+ export OMP_NUM_THREADS=4 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
28
+ export SWANLAB_FORCE_DIRECT=1 NO_PROXY='*' no_proxy='*'
29
+ unset http_proxy https_proxy all_proxy ftp_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY FTP_PROXY
30
+ MODE=disabled
31
+ TRACKER_ARGS=()
32
+ if [[ -n "${SWANLAB_TOKEN_FILE:-}" ]]; then
33
+ [[ -s "$SWANLAB_TOKEN_FILE" ]] || { echo "SWANLAB_TOKEN_FILE is missing" >&2; exit 2; }
34
+ MODE=online
35
+ TRACKER_ARGS+=(--swanlab-token-file "$SWANLAB_TOKEN_FILE")
36
+ fi
37
+
38
+ args=(
39
+ "$DATASET"
40
+ --manifest-dir "$DATASET/mira_manifests/joint_anchor_v2"
41
+ --world-checkpoint "$WORKSPACE/outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066"
42
+ --action-checkpoint "$WORKSPACE/outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016"
43
+ --codec-checkpoint "$WORKSPACE/outputs/mira_robotwin_codec/checkpoint-125000/checkpoint.pth"
44
+ --qwen-root "$WORKSPACE/models/Qwen3-VL-2B-Instruct"
45
+ --output-dir "$OUTPUT"
46
+ --steps 55000 --per-device-batch 15 --gradient-accumulation 1
47
+ --num-workers 4 --shard-group-size 8 --world-rollout-steps 10
48
+ --world-activation-checkpoint-blocks -1 --action-activation-checkpoint-blocks 7
49
+ --lr-world 1e-5 --lr-action 3e-5 --warmup-steps 500
50
+ --weight-world-flow 1 --weight-latent 0 --weight-pixel 0 --weight-action 1
51
+ --log-every 10 --save-every 100 --validate-every 200 --validation-batches 3
52
+ --keep-last 3 --keep-every 5000
53
+ --swanlab-mode "$MODE" --swanlab-project Multi_WAM
54
+ --swanlab-experiment-name Joint-World-Action-8GPU-Resume17700
55
+ "${TRACKER_ARGS[@]}"
56
+ )
57
+ if [[ "${JOINT_PREFLIGHT_ONLY:-0}" == 1 ]]; then
58
+ args+=(--resume-preflight-only --swanlab-mode disabled)
59
+ fi
60
+ cd "$WORKSPACE"
61
+ exec "$PYTHON" -m torch.distributed.run --standalone --nproc_per_node=8 \
62
+ "$WORKSPACE/mira_09/scripts/train_joint_world_action.py" "${args[@]}"
release-20261014/scripts/verify_release.py ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Check the restored step-17700 continuation and its frozen dependencies."""
3
+
4
+ import argparse
5
+ import hashlib
6
+ import json
7
+ import subprocess
8
+ from pathlib import Path
9
+
10
+
11
+ CHECKPOINT = "outputs/joint_8gpu_07_resume12975_20261011/joint-checkpoint-17700"
12
+
13
+
14
+ def digest(value):
15
+ return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(",", ":"),
16
+ ensure_ascii=False).encode()).hexdigest()
17
+
18
+
19
+ def file_hash(path):
20
+ result = hashlib.sha256()
21
+ with path.open("rb") as handle:
22
+ for chunk in iter(lambda: handle.read(16 << 20), b""):
23
+ result.update(chunk)
24
+ return result.hexdigest()
25
+
26
+
27
+ def expect_hash(path, expected):
28
+ actual = file_hash(path)
29
+ if actual != expected:
30
+ raise AssertionError(f"SHA-256 mismatch: {path}: {actual}")
31
+
32
+
33
+ def main(workspace, require_dataset):
34
+ workspace = workspace.resolve()
35
+ checkpoint = workspace / CHECKPOINT
36
+ state = json.loads((checkpoint / "trainer_state.json").read_text())
37
+ identity = state["artifact_identity"]
38
+ assert state["completed_steps"] == state["next_step"] == 17700
39
+ assert identity["world_size"] == 8
40
+ assert identity["optimization"]["per_device_batch"] == 15
41
+ assert identity["optimization"]["gradient_accumulation"] == 1
42
+ assert identity["optimization"]["steps"] == 55000
43
+ assert identity["loss_weights"] == {"world_flow": 1.0, "latent": 0.0,
44
+ "pixel": 0.0, "action": 1.0}
45
+ assert digest(identity) == state["artifact_identity_sha256"]
46
+ nested = identity["sha256"]
47
+ assert digest({key: value for key, value in identity.items() if key != "sha256"}) == nested
48
+ assert identity["qwen_root"] == str(workspace / "models/Qwen3-VL-2B-Instruct")
49
+ assert (checkpoint / "distributed/.metadata").is_file()
50
+ assert len(list((checkpoint / "distributed").glob("*.distcp"))) == 8
51
+ for index in range(8):
52
+ assert (checkpoint / f"rank-{index:05d}.pth").is_file()
53
+ assert (checkpoint / "distributed" / f"__{index}_0.distcp").stat().st_size > 2_000_000_000
54
+ for name, expected in identity["implementation_sha256"].items():
55
+ expect_hash(workspace / "mira_09" / name, expected)
56
+ manifest = workspace / "datasets/RoboTwin2.0/mira_manifests/joint_anchor_v2"
57
+ expect_hash(manifest / "train.jsonl", identity["dataset_manifest_sha256"])
58
+ expect_hash(manifest / "val.jsonl", identity["validation_manifest_sha256"])
59
+ expect_hash(workspace / "datasets/RoboTwin2.0/mira_wam_aloha/dataset_stats.json",
60
+ identity["dataset_stats_sha256"])
61
+ expect_hash(workspace / "models/Qwen3-VL-2B-Instruct/config.json",
62
+ identity["qwen_config_sha256"])
63
+ expect_hash(workspace / "outputs/mira_robotwin_codec/checkpoint-125000/checkpoint.pth",
64
+ identity["codec_checkpoint_sha256"])
65
+ for path, field, step in [
66
+ ("outputs/robotwin_bihub_world_v12_largebatch_remaining/main-checkpoint-25066",
67
+ "world_checkpoint_fingerprint", 25066),
68
+ ("outputs/robotwin_bihub_wam_v13_action_eval_aligned_continue4epoch/action-checkpoint-23016",
69
+ "action_checkpoint_fingerprint", 23016),
70
+ ]:
71
+ parent = workspace / path
72
+ assert json.loads((parent / "trainer_state.json").read_text())["completed_steps"] == step
73
+ result = hashlib.sha256()
74
+ for relative in ("trainer_state.json", "distributed/.metadata"):
75
+ result.update(relative.encode())
76
+ result.update(file_hash(parent / relative).encode())
77
+ assert result.hexdigest() == identity[field], f"source checkpoint changed: {path}"
78
+ if require_dataset:
79
+ files = list((workspace / "datasets/RoboTwin2.0/dataset").glob("*/aloha-agilex_*.zip"))
80
+ assert len(files) == 100, f"expected 100 external RoboTwin ALOHA archives, got {len(files)}"
81
+ python = workspace / "conda/envs/mira/bin/python"
82
+ assert python.is_file(), "restored training environment missing"
83
+ subprocess.run([str(python), "-c", "import torch, swanlab; print('training imports OK', torch.__version__)"],
84
+ check=True)
85
+ print("Release integrity OK: 8-rank full state, optimizer schedule, exact source and frozen dependencies")
86
+
87
+
88
+ if __name__ == "__main__":
89
+ parser = argparse.ArgumentParser(description=__doc__)
90
+ parser.add_argument("workspace", type=Path)
91
+ parser.add_argument("--require-dataset", action="store_true")
92
+ args = parser.parse_args()
93
+ main(args.workspace, args.require_dataset)
skills/multi-wam-joint-continue/SKILL.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: multi-wam-joint-continue
3
+ description: Restore, verify and continue the Multi-WAM joint World+Action eight-GPU step-17700 checkpoint published on 2026-10-14.
4
+ ---
5
+
6
+ # Multi-WAM joint continuation (step 17700)
7
+
8
+ Read `PROGRESS_20261014.md` and `release-20261014/RELEASE_MANIFEST.json` before
9
+ selecting a checkpoint or describing the run. The last logged optimizer step
10
+ was 17710, but the newest complete eight-rank checkpoint is **17700**. Do not
11
+ claim a later restart point or a step-17700 closed-loop evaluation.
12
+
13
+ ## Restore
14
+
15
+ Download the immutable `snapshot-20261014-joint17700` revision using
16
+ `release-20261014/scripts/download_release.sh`. Restore into an empty workspace
17
+ with `release-20261014/scripts/restore_release.sh`; this first restores the
18
+ 2026-10-10 base layer (packed environments and frozen source assets), then
19
+ checks SHA-256 and overlays the current `mira_09` source, the eight-rank full
20
+ checkpoint, and run metadata. The restore script updates only the recorded
21
+ absolute Qwen path in the **restored copy** of checkpoint metadata; the
22
+ published archive stays untouched. Run `verify_release.py` and, after the
23
+ external pinned RoboTwin dataset is downloaded, run it again with
24
+ `--require-dataset`.
25
+
26
+ Do not put HF or SwanLab tokens in the release directory, a workspace archive,
27
+ or a command-line argument. Use a destination-local `SWANLAB_TOKEN_FILE` for
28
+ online tracking. All non-Codex processes must avoid port `127.0.0.1:7892`.
29
+
30
+ ## Resume
31
+
32
+ Use one node with eight GPUs and
33
+ `release-20261014/scripts/resume_8gpu.sh RESTORED_WORKSPACE`. Run
34
+ `JOINT_PREFLIGHT_ONLY=1` first if checking a new machine. The launcher keeps
35
+ the exact checkpoint identity: 8 ranks, batch 15/GPU, accumulation 1,
36
+ global batch 120, target 55000 steps, World LR 1e-5, Action LR 3e-5,
37
+ warmup 500, 10 World rollout steps, World activation checkpoint blocks -1,
38
+ Action blocks 7, and World FM + Action FM objective. The training entry point
39
+ automatically discovers the restored checkpoint in its output directory;
40
+ do not pass `--allow-batch-migration` or re-run the old 24-to-8 migration.
41
+
42
+ Qwen and codec remain frozen. The exact source, manifests, stats and frozen
43
+ asset fingerprints are checked by `verify_release.py`. Raw RoboTwin data is
44
+ external and pinned by the October 10 dataset helper. The old October 10
45
+ closed-loop score applies only to joint step 12531.