Add fresh-instance restoration runbook
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222# New-instance runbook
This is the authoritative checklist for rebuilding or resuming the experiment ona fresh Linux GPU instance. The scientific design is documented in`docs/single_task_transfer_handoff.md` and`docs/broad_encoder_next_run_handoff.md`.
## 1. What is already complete
- Seven-task broad SAILOR encoder trained for 90,000 updates with batch 128, seed 1, a 16-D latent, and ten-step chunks.- Final broad encoder and all intermediate 10k weight checkpoints uploaded to Hugging Face. Final optimizer/training state is also present.- Coffee D0 positive-control embeddings and Behavior Retrieval analysis.- Exact global full-covariance IWR KDE scores, an 8,192-source approximation, and the released batch-local IWR reference output.- Random-vs-BR and BR-vs-IWR review videos, manifests, and timestamp analyses.- W&B run: <https://forge.coreweave.com/wandb/chandrahul0320/post-robot-broad-sailor/runs/4ns4w7uf>.
Public locations:
- Code: <https://github.com/RahulSChand/single-task-transfer>- Artifacts: <https://huggingface.co/datasets/Chand0320/single-task-transfer-artifacts>
## 2. What remains scientifically unfinished
1. Manually label the blinded random-vs-BR clips by semantic phase and compare relevant-behavior rates. Account for overlapping windows when reporting uncertainty.2. Inspect/label the global-IWR early mode versus its terminal mode. The top 100 global-IWR clips contain 30 clips from the first trajectory decile and 62 from the last decile.3. Train a substantive compute-matched Coffee-only encoder. The existing Coffee-only checkpoint is a 1,000-step integration pilot, not a fair counterpart to the broad 90k encoder. Roughly 24,104 batch-128 updates give about 45 presentations per Coffee anchor.4. Re-run BR and IWR under that substantive Coffee-only encoder, keeping the source/query manifests and retrieval budget fixed.5. Train and evaluate the downstream Diffusion Policy arms. No full target-only, whole-source, random, BR, global-IWR, or source-pretrain/target-finetune policy comparison has been completed.6. Evaluate fixed final checkpoints in fresh simulator rollouts. Training or representation losses are not downstream task results.
Do not select an encoder checkpoint using Mug Cleanup target-family validation.It was reporting-only. The broad run's best Mug Cleanup validation loss occurredat 10k, but the predetermined 90k checkpoint remains the primary artifact.
## 3. Recommended machine
- Linux with an NVIDIA GPU; the validated machine was an A100 80 GB.- At least 64 GB RAM; the broad loader cached hundreds of GB on the validated host, which had 866 GB RAM. If memory is smaller, set `cache=False` in the encoder config before training.- At least 100 GB disk for environments, raw data, RLDS, and restored artifacts.- `/workspace` is not automatically persistent. Check the provider's volume configuration before relying on it.
## 4. Clone code and exact third-party revisions
```bashgit clone https://github.com/RahulSChand/single-task-transfer.git /workspace/single_task_transfercd /workspace/single_task_transferexport PROJECT_ROOT=/workspace/single_task_transfer
bash scripts/setup_host_tools.shbash scripts/clone_third_party.sh```
Pinned third-party revisions are encoded in `scripts/clone_third_party.sh` andalso recorded in the HF preservation metadata.
## 5. Rebuild environments and adapters
```bashcd /workspace/single_task_transferbash scripts/setup_sim_env.shbash scripts/setup_train_env.shbash scripts/setup_wandb_env.shbash scripts/install_iwr_adapter.sh```
The training environment intentionally uses W&B 0.19.7 with protobuf 4.25.6 soTensorFlow 2.17 remains compatible. New `wandb_v1_...` keys require a newer SDK,so online logging runs through the separate `envs/wandb` sidecar environment.Authenticate it with:
```bash/workspace/single_task_transfer/envs/wandb/bin/wandb login```
Do not commit or paste credentials into project files.
## 6. Restore completed artifacts
For the minimal substantive restore (broad encoder, Coffee retrieval analysis,manifests, reports, and preservation metadata):
```bash/root/.local/bin/hf download Chand0320/single-task-transfer-artifacts \ --type dataset \ --include 'artifacts/encoders/broad_sailor_7task/**' \ --include 'artifacts/retrieval/broad_90k_coffee_sanity/**' \ --include 'manifests/**' \ --include 'reports/**' \ --include 'results/preservation_2026-10-24/**' \ --local-dir /workspace/single_task_transfer```
To restore every published experiment artifact, including integration smokecheckpoints and the source-only pilot:
```bash/root/.local/bin/hf download Chand0320/single-task-transfer-artifacts \ --type dataset \ --local-dir /workspace/single_task_transfer```
The HF repository does not contain raw third-party MimicGen HDF5 or generatedRLDS data.
## 7. Re-download raw data and rebuild RLDS when needed
```bashcd /workspace/single_task_transferbash scripts/download_pilot_data.shbash scripts/download_broad_data.shbash scripts/download_coffee_sanity_data.sh
# Recreate/check fixed seed-0 source and target manifests.bash scripts/wait_for_pilot_data.sh
bash scripts/build_pilot_rlds.shbash scripts/build_broad_rlds.shbash scripts/build_coffee_sanity_rlds.sh```
The scripts verify official file sizes/hashes and deterministic episode/windowcounts. Do not add Coffee D0, Mug Cleanup, Hammer Cleanup, Threading, or othertarget-family data to broad encoder training or normalization.
## 8. Install Supervisor jobs
On the validated Vast image:
```bashinstall -m 0644 services/*.conf /etc/supervisor/conf.d/supervisorctl rereadsupervisorctl update```
All long jobs should be started and monitored through Supervisor. Useful jobs:
```bashsupervisorctl start broad_encoder_smokesupervisorctl start broad_encoder_wandbsupervisorctl start broad_encodersupervisorctl start broad_coffee_sanitysupervisorctl start coffee_iwrsupervisorctl status```
Do not restart `broad_encoder` against the restored completed run directoryunless intentionally resuming or auditing it.
## 9. Verification after restore
```bashcd /workspace/single_task_transfer
/workspace/single_task_transfer/envs/train/bin/python - <<'PY'import jaximport jax.numpy as jnpx = (jnp.ones((1024, 1024)) @ jnp.ones((1024, 1024))).block_until_ready()print(jax.devices(), float(x[0, 0]))PY
test -f artifacts/encoders/broad_sailor_7task/broad-sailor-7task-b128-90k-seed1/90000/_CHECKPOINT_METADATAtest -f artifacts/encoders/broad_sailor_7task/broad-sailor-7task-b128-90k-seed1/state/90000/_CHECKPOINT_METADATAtest -f artifacts/retrieval/broad_90k_coffee_sanity/iwr_global_scores.npztest -f artifacts/retrieval/broad_90k_coffee_sanity/iwr_vs_br_100/summary.json
CUDA_VISIBLE_DEVICES='' envs/train/bin/python scripts/verify_pilot_rlds.pyCUDA_VISIBLE_DEVICES='' envs/train/bin/python scripts/verify_broad_rlds.py```
Expected broad representation totals are 700 episodes, 256,540 raw timesteps,250,240 complete ten-step windows, and 255,840 encoder anchors.
## 10. Retrieval definitions used in saved results
- **BR/SR:** for each Coffee Preparation source window, take its Euclidean distance to the nearest Coffee D0 query embedding; lower is better.- **Global IWR:** rank by unclipped `log p_target(z) - log p_source(z)`, using all 2,114 Coffee D0 embeddings and all 67,762 Coffee Preparation source embeddings, bandwidth multiplier 8, and relative diagonal regularization `1e-4`.- **Released IWR reference:** `third_party/importance-retrieval/scripts/retrieval/is.py`. It estimates the source KDE within each scoring minibatch, so it is retained as an implementation reference rather than the primary global-IWR result.
## 11. Data-role and leakage rules
- `D_repr`: the seven declared encoder-training tasks only.- `D_source`: exactly the fixed 100 Coffee Preparation demonstrations; the only retrieval candidate pool.- `D_target`: downstream query/policy demonstrations.- Coffee D0 positive-control data is query-only.- Target-family data must not contribute encoder gradients, normalization, or checkpoint/hyperparameter selection.- Auxiliary broad-encoder examples must never enter retrieval candidates or downstream policy training.
## 12. Before stopping or destroying the next instance
1. Confirm all Supervisor jobs are terminal.2. Upload new code to GitHub and new artifacts to the HF dataset repository.3. Save manifests, configs, logs, exact commands, repository SHAs, environment freezes, checkpoint inventories, and hashes.4. Verify critical remote and uploaded paths before destruction.5. Rotate any credentials exposed during interactive setup.
reports/NEW_INSTANCE_RUNBOOK.mdAdded+222