blender-motion-state-inspection
AFaffaan-m/ECC314k4,125 new stars in the last 7 days
Train Cosmos3 Nano Sim Bimanual from Cosmos3-Nano with Cosmos Framework's four native stage TOMLs and a local training bundle. Covers data preparation, initialization, training, checkpoint handoffs, resume and student export. Stages 0 to 3 (representation adaptation, teacher forcing, TF-dCM and SF-DMD distillation) launch with torchrun and cosmos_framework.scripts.train --sft-toml. Use when the user asks "post-train Sim-Bimanual", "train Sim-Bimanual on my own robot data", "run Sim-Bimanual Stage 0", "continue Sim-Bimanual with Stage 1, 2 or 3", "resume a Sim-Bimanual stage", "distill my Sim-Bimanual student" or "export my Sim-Bimanual Stage 3 student". Not for inference with the released checkpoint or an exported student (cosmos3-inference-simulation-bimanual), generator or reasoner supervised fine-tuning (cosmos3-post-training), or the Auto and Sim-Transfer models (start at cosmos3-post-train-simulation).
Train an action-conditioned world model that predicts the visual consequences of bimanual actions. It consumes a task description, RGB observations and an aligned action trajectory, and produces video rather than robot actions. The worked chain starts from Cosmos3-Nano and runs Stage 0 through Stage 3.
| Goal | Start with | Follow |
|---|---|---|
| Start a new four-stage training run | Cosmos3-Nano and a completed local bundle | Stage 0 Quickstart |
| Continue an existing chain | Your completed stage checkpoint and saved configuration | Continue training |
| Generate video | Released Bimanual model or your exported Stage 3 student | Inference |
Use the data contract for action meaning, normalization, timing and captions, and the parameter guide before changing the recipe. The commands below use Cosmos Framework.
Use the native Bimanual recipes and Bimanual data preflight in this Framework checkout.
Framework installation, environment setup and checkpoint download in general: cosmos3-setup. The model-specific requirements follow.
Follow the Framework setup guide, then check the additional Bimanual requirements. Reuse a working Framework environment.
Skill note (not in the source): the Bimanual requirements give the install command of the training environment. Run it from the root of the Framework checkout as it is written there; it runs the pinned uv through
uvx, so it works with any uv on the host (the setup guide'suv self update 0.11.29is refused when a package manager installed uv):
uvx --from 'uv==0.11.29' uv sync --locked --python 3.13 --group cu130-train --extra train --extra guardrail
Use a dedicated Framework checkout, Python 3.13, the documented CUDA/FFmpeg
system libraries, and a GPU allocation. Set FRAMEWORK_DIR to that checkout.
From its root, activate the prepared training environment:
cd "$FRAMEWORK_DIR"
source .venv/bin/activate
export COSMOS_INTERNAL=0 COSMOS_TRAINING=1
python -m cosmos_framework.scripts.train --help
For a CUDA 12.8 host, use the matching group from the setup guide.
Do not clear LD_LIBRARY_PATH; keep the CUDA compatibility and FFmpeg library
paths required by your installation. The training extra includes
mujoco==3.10.0 for calibrated action/FK preprocessing.
The registered layout uses FSDP shard degree 8 and context-parallel degree 4.
The eight-process command below must run inside an allocation that supports
that layout and the sample's memory requirements. Multi-node placement follows
Framework training.
Set BIMANUAL_BUNDLE to a completed user-owned local bundle. It contains
manifest.json, samples.json, local media/action resources, and
resources/tokenizer/. An inference JSONL or action sidecar alone is not a
training bundle. The Framework loader consumes this format; it does not provide
a raw-robot-data-to-bundle conversion command.
Download the versioned single-source robot example from the Sim-Bimanual checkpoint. Its README records coverage, checksum verification and extraction commands. Use it to understand the bundle layout and native dataloader handoff; it is a small integration example, not a convergence dataset. The duplicated AgiBot inputs and paired GT videos show the relationship to inference, while the training bundle retains raw robot actions rather than already-normalized inference sidecars.
Skill note (not in the source): two steps come before that README's commands, because they and the two checks below need things the README does not state. First install
zstd(the extraction callsunzstd; without ittarstops withunzstd: Cannot exec) and the FFmpeg shared libraries named under "Activate the Framework environment" (the--materializecheck decodes video through TorchCodec; without them it stops with an error such aslibavutil.so.56: cannot open shared object file). On Debian or Ubuntu, as root:
apt-get update && apt-get install -y --no-install-recommends zstd ffmpeg
Skill note (not in the source): then download the README's two patterns with one
hf downloadcall each, into the folder the README uses. What one call does with two patterns depends on thehfversion (the Framework environment's keeps only the last of two--includeflags, a newer one rejects two patterns after one flag); a missingexamples/training/SHA256SUMSis the sign. Continue with the README's checksum and extraction commands.
hf download nvidia/Cosmos3-Nano-Sim-Bimanual --include 'examples/training/*' --local-dir Cosmos3-Nano-Sim-Bimanual
hf download nvidia/Cosmos3-Nano-Sim-Bimanual --include 'assets/training/agibot/**' --local-dir Cosmos3-Nano-Sim-Bimanual
Prepare data using the local bundle layout, action schema and caption guide:
T+1 observations has T transitions.
Window length is selected by the user and is not fixed by the loader.Bind the prepared bundle, check its files, then read one packed Stage 0 sample before loading model weights:
export COSMOS_SIM_BIMANUAL_LOCAL_BUNDLE="$BIMANUAL_BUNDLE"
python -m cosmos_framework.scripts.validate_bimanual_data \
--bundle "$COSMOS_SIM_BIMANUAL_LOCAL_BUNDLE"
python -m cosmos_framework.scripts.validate_bimanual_data \
--bundle "$COSMOS_SIM_BIMANUAL_LOCAL_BUNDLE" --materialize --stage 0
Both commands must report passed: true. The second must also report
materialized: true, batch sample/token counts and tensor shapes/dtypes.
See what these checks cover.
The native make_bimanual_local_dataloader handles stage-specific stream
selection and packing, and installs loader-state resume support. Use the
Framework data interface.
Set NANO_REVISION to the chosen immutable nvidia/Cosmos3-Nano revision.
The following paths are used by conversion and training later in this guide:
export NANO_HF_DIR="$PWD/checkpoints/Cosmos3-Nano-$NANO_REVISION"
export NANO_DCP_ROOT="$PWD/checkpoints/Cosmos3-Nano-dcp-$NANO_REVISION"
export VIDEO_VAE_DIR="$PWD/checkpoints/wan22_vae"
hf download nvidia/Cosmos3-Nano \
--revision "$NANO_REVISION" --local-dir "$NANO_HF_DIR"
hf download Wan-AI/Wan2.2-TI2V-5B Wan2.2_VAE.pth \
--local-dir "$VIDEO_VAE_DIR"
python -m cosmos_framework.scripts.convert_model_to_dcp \
--checkpoint-path "$NANO_HF_DIR" -o "$NANO_DCP_ROOT"
export COSMOS_SIM_BIMANUAL_GA_CHECKPOINT="$NANO_DCP_ROOT"
export VIDEO_VAE_PATH="$VIDEO_VAE_DIR/Wan2.2_VAE.pth"
test -f "$NANO_DCP_ROOT/model/.metadata"
test -f "$VIDEO_VAE_PATH"
Record the model/VAE identities and conversion revision. This produces model
weights, not optimizer or trainer state. The native Stage 0 recipe skips
net_ema. and the three new action modules during this fresh load, keeps
regular-weight loading strict, and copies the loaded/fresh regular weights
into EMA through its built-in callback. Do not add a second EMA callback.
Same-run resume restores saved EMA instead.
Set IMAGINAIRE_OUTPUT_ROOT to writable storage mounted at the same absolute
path on every worker, and choose a unique RUN_NAME for the chain.
export IMAGINAIRE_OUTPUT_ROOT="$BIMANUAL_OUTPUT_ROOT"
RUN_NAME=bimanual-my-data
TOML=examples/toml/sft_config/sim_bimanual_stage0_bidir.toml
python -m cosmos_framework.scripts.train \
--sft-toml="$TOML" --dryrun -- \
"job.name=$RUN_NAME-stage0" \
"model.config.tokenizer.vae_path=$VIDEO_VAE_PATH" \
model_parallel.context_parallel_size=4
The TOML selects sim_local_bimanual_stage0_bidir. Inspect the resolved config
under $IMAGINAIRE_OUTPUT_ROOT/cosmos3_simulation/bimanual/$RUN_NAME-stage0/.
Confirm the local bundle/tokenizer, Cosmos3-Nano load path, Stage 0 EMA callback,
parallelism and job.wandb_mode=disabled. Training does not require a release
inference checkpoint or a W&B key. A dry run resolves config without loading
weights, decoding a batch or taking an optimizer step.
Use the same shell, paths and run name:
torchrun --standalone --nproc-per-node=8 \
-m cosmos_framework.scripts.train --sft-toml="$TOML" -- \
"job.name=$RUN_NAME-stage0" \
"model.config.tokenizer.vae_path=$VIDEO_VAE_PATH" \
model_parallel.context_parallel_size=4
To check data loading, forward/backward updates, and checkpoint writing before a reference-length run, use a dedicated run name and add the two bounded-run overrides:
RUN_NAME=bimanual-my-data-smoke
torchrun --standalone --nproc-per-node=8 \
-m cosmos_framework.scripts.train --sft-toml="$TOML" -- \
"job.name=$RUN_NAME-stage0" \
"model.config.tokenizer.vae_path=$VIDEO_VAE_PATH" \
model_parallel.context_parallel_size=4 \
trainer.max_iter=12 \
checkpoint.save_iter=12
Confirm finite losses and gradients and a completed checkpoint at iteration 12. The same overrides can be used with another stage's TOML. Omit them for the reference training budgets.
Monitor losses and gradients, inspect the emitted batch semantics, and keep the job running through completed checkpoint saves. To resume an interrupted Stage 0 run, rerun the same command with the same run name, output root, bundle, topology, and parent checkpoint; Framework restores the saved iteration, optimizer, scheduler, EMA, and loader state.
The native reference budgets are 35,000, 8,000, 4,000 and 1,500 trainer
iterations for Stages 0–3, respectively. All four TOMLs live under
examples/toml/sft_config/:
| Stage | TOML | Required initialization |
|---|---|---|
| 0: representation adaptation | sim_bimanual_stage0_bidir.toml | COSMOS_SIM_BIMANUAL_GA_CHECKPOINT |
| 1: teacher forcing | sim_bimanual_stage1_tf.toml | COSMOS_SIM_BIMANUAL_STAGE0_CHECKPOINT |
| 2: TF-dCM | sim_bimanual_stage2_tfdcm.toml | COSMOS_SIM_BIMANUAL_STAGE1_CHECKPOINT for student and frozen teacher |
| 3: SF-DMD | sim_bimanual_stage3_sfdmd.toml | COSMOS_SIM_BIMANUAL_STAGE2_CHECKPOINT for student; COSMOS_SIM_BIMANUAL_STAGE0_CHECKPOINT for reference/critic |
After accepting Stage 0, bind its exact completed iteration root, not model/:
export COSMOS_SIM_BIMANUAL_STAGE0_CHECKPOINT="$STAGE0_CHECKPOINT_ROOT"
TOML=examples/toml/sft_config/sim_bimanual_stage1_tf.toml
Repeat the config check and launch with this TOML and job.name=$RUN_NAME-stage1.
After Stage 1, export COSMOS_SIM_BIMANUAL_STAGE1_CHECKPOINT and select Stage 2;
after Stage 2, export COSMOS_SIM_BIMANUAL_STAGE2_CHECKPOINT and select Stage 3.
Use distinct stage run names. The recipe adds /model where a nested load needs
it. Every new stage starts fresh optimization state; same-stage resume restores
the existing run. See Framework checkpoint handoffs.
Keep the four-step Stage 3 schedule. It updates the student once per six trainer iterations and the critic on the other five, so 12 iterations exercise two student and ten critic updates. Inspect both optimizers, not just the iteration counter. Frozen teacher/reference and critic weights are not inference artifacts.
Accept each stage only after finite updates, completed save and fresh-process readback. Keep its resolved config and immutable checkpoint identity. Use held-out generation to judge model quality separately from short-run execution.
For a portable Stage 3 student, set STAGE3_CHECKPOINT_ROOT to its completed
iteration root, STAGE3_CONFIG to that run's saved config.yaml, and
STUDENT_EXPORT to a new export directory:
python -m cosmos_framework.scripts.export_model \
--checkpoint-path "$STAGE3_CHECKPOINT_ROOT" \
--config-file "$STAGE3_CONFIG" \
--experiment sim_local_bimanual_stage3_sfdmd \
--use-ema-weights --no-vit --student-only-checkpoint-metadata \
-o "$STUDENT_EXPORT"
This command selects student EMA explicitly. Preserve the selected variant and saved four-step schedule, and inspect the export's action metadata and local-path sanitization. Follow inference with that export. The released schema-5 example also uses four steps; preserve each export's exact saved ladder rather than assuming the schedules are identical.
With the Stage 3 student exported, follow "Use your own Stage 3 checkpoint" in the Sim-Bimanual inference skill. The same skill runs the released checkpoint.
Start with the troubleshooting reference: its symptom table leads to the procedures for staged launch, training progress and checkpoint identity and state, and the failure playbook follows them. Runtime and access, input validation, generation and evaluation are in the inference skill's troubleshooting reference. For environment problems shared by all models, use cosmos3-env-troubleshoot.
| File | When to read it |
|---|---|
references/data-contract.md | Before preparing or validating a bundle: the native loader, the user-owned local bundle layout, what the two validation commands cover, the published examples, the logical sample, captions and conditioning, the loader adaptation contract |
references/caption-guide.md | Before writing training captions: window selection, writing and review, optional automated captioning, the handoff record |
references/parameter-guide.md | Before changing the recipe: each parameter's reference value, policy, adjustment guidance, coupled settings, required validation and failure signals |
references/canonical-recipe.md | For the four-stage reference recipe: TOMLs, budgets and initialization, shared values, the settings of Stages 0 to 3, runtime requirements, the Stage 3 four-step schedule, runtime defaults to record |
references/checkpoint-and-resume.md | At a stage boundary or before a resume: each stage's inputs and load behavior, warm start, same-run resume and export, the fresh four-stage chain, resume compatibility, EMA and inference selection |
references/multinode-launcher.md | For more than one node: the raw torchrun launch with node count, node rank and rendezvous address, and the full-state resume check |
references/environment.md | For the training install, the hardware and allocation checks and the resources each task binds |
references/troubleshooting.md | When a launch, a training run or a checkpoint load fails: symptom table, procedures 3 to 5, failure playbook |
| Skill | When to use |
|---|---|
| cosmos3-post-train-simulation | Entry skill of the Simulation post-training row: routes to the Auto, Sim-Bimanual and Sim-Transfer block skills |
| cosmos3-inference-simulation-bimanual | Inference with the released checkpoint or your exported Stage 3 student, held-out PSNR evaluation, the input contract and the action schema |
| cosmos3-inference-simulation | Entry skill of Simulation inference: model chooser, shared prerequisites, validation checklist |
| cosmos3-post-training | Generator and reasoner supervised fine-tuning (SFT) |
| cosmos3-setup | Framework installation, environment setup, checkpoint download |
| cosmos3-env-troubleshoot | Environment, installation and runtime errors |
AFaffaan-m/ECC314k4,125 new stars in the last 7 days
ANanthropics/skills203k3,333 new stars in the last 7 days
Generate flow fields and particle systems with p5.js, using seeded randomness for original algorithmic art.
ANanthropics/skills203k3,333 new stars in the last 7 days
HAharry0703/MoneyPrinterTurbo147k1,663 new stars in the last 7 days
SHShubhamsaboo/awesome-llm-apps146k895 new stars in the last 7 days
GAgarrytan/gstack143k636 new stars in the last 7 days