Skip to content
FunCoding

cosmos3-post-train-simulation-bimanual

Official

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).

Star
674
Last commit
Nov 30, 2026

.agents/skills/cosmos3-post-train-simulation-bimanual/SKILL.md

View on GitHub

Post-train Cosmos3-Nano-Sim-Bimanual

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.

When to use this skill

  • Use to train Cosmos3-Nano-Sim-Bimanual from Cosmos3-Nano on a completed local training bundle with Cosmos Framework: validate the bundle, run Stage 0, continue through Stages 1 to 3, resume a stage and export the Stage 3 student.
  • Not for generating video with the released model or an exported student, see cosmos3-inference-simulation-bimanual; not for generator or reasoner supervised fine-tuning, see cosmos3-post-training; not for converting raw robot data into a training bundle (the Framework loader "does not provide a raw-robot-data-to-bundle conversion command", step 1); for the Auto and Sim-Transfer models, start at the entry skill cosmos3-post-train-simulation.

Choose your starting point

GoalStart withFollow
Start a new four-stage training runCosmos3-Nano and a completed local bundleStage 0 Quickstart
Continue an existing chainYour completed stage checkpoint and saved configurationContinue training
Generate videoReleased Bimanual model or your exported Stage 3 studentInference

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.

Prerequisites

Framework installation, environment setup and checkpoint download in general: cosmos3-setup. The model-specific requirements follow.

Set up the environment

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's uv self update 0.11.29 is 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

Activate the Framework environment

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.

Quickstart: train Stage 0

1. Prepare and validate training data

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 calls unzstd; without it tar stops with unzstd: Cannot exec) and the FFmpeg shared libraries named under "Activate the Framework environment" (the --materialize check decodes video through TorchCodec; without them it stops with an error such as libavutil.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 download call each, into the folder the README uses. What one call does with two patterns depends on the hf version (the Framework environment's keeps only the last of two --include flags, a newer one rejects two patterns after one flag); a missing examples/training/SHA256SUMS is 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:

  1. Split source episodes before creating windows, keeping all windows from an episode in one split.
  2. Choose robot-window lengths for the task and available memory, then keep RGB and actions aligned: a window with T+1 observations has T transitions. Window length is selected by the user and is not fixed by the loader.
  3. Preserve coordinate frames, rot6d convention, calibrated gripper width, domain IDs, validity masks and the pinned global-asinh statistics. Training materializes raw captures through the native transform; an inference sidecar's already-normalized values are not raw training actions.
  4. Start with one supported robot source. Advanced users may provide multiple supported sources; Framework normalizes their declared relative weights. Framework also applies stage-specific rendering internally, so do not create separate source-resolution strata.
  5. Inspect representative decoded samples and the actual packed batch, including 59 semantic action values padded to 64, their masks, units, and semantics.

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.

2. Prepare the Cosmos3-Nano initializer and video VAE

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.

3. Configure Stage 0 from Cosmos3-Nano

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.

4. Launch Stage 0

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
Optional: run a 12-iteration smoke test

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.

Continue training

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/:

StageTOMLRequired initialization
0: representation adaptationsim_bimanual_stage0_bidir.tomlCOSMOS_SIM_BIMANUAL_GA_CHECKPOINT
1: teacher forcingsim_bimanual_stage1_tf.tomlCOSMOS_SIM_BIMANUAL_STAGE0_CHECKPOINT
2: TF-dCMsim_bimanual_stage2_tfdcm.tomlCOSMOS_SIM_BIMANUAL_STAGE1_CHECKPOINT for student and frozen teacher
3: SF-DMDsim_bimanual_stage3_sfdmd.tomlCOSMOS_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.

Export and check inference

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.

Run inference with your checkpoint

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.

Troubleshooting

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.

Reference files

FileWhen to read it
references/data-contract.mdBefore 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.mdBefore writing training captions: window selection, writing and review, optional automated captioning, the handoff record
references/parameter-guide.mdBefore changing the recipe: each parameter's reference value, policy, adjustment guidance, coupled settings, required validation and failure signals
references/canonical-recipe.mdFor 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.mdAt 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.mdFor more than one node: the raw torchrun launch with node count, node rank and rendezvous address, and the full-state resume check
references/environment.mdFor the training install, the hardware and allocation checks and the resources each task binds
references/troubleshooting.mdWhen a launch, a training run or a checkpoint load fails: symptom table, procedures 3 to 5, failure playbook
SkillWhen to use
cosmos3-post-train-simulationEntry skill of the Simulation post-training row: routes to the Auto, Sim-Bimanual and Sim-Transfer block skills
cosmos3-inference-simulation-bimanualInference with the released checkpoint or your exported Stage 3 student, held-out PSNR evaluation, the input contract and the action schema
cosmos3-inference-simulationEntry skill of Simulation inference: model chooser, shared prerequisites, validation checklist
cosmos3-post-trainingGenerator and reasoner supervised fine-tuning (SFT)
cosmos3-setupFramework installation, environment setup, checkpoint download
cosmos3-env-troubleshootEnvironment, installation and runtime errors

Similar Skills

blender-motion-state-inspection

AFaffaan-m/ECC314k4,125 new stars in the last 7 days

Official

slack-gif-creator

ANanthropics/skills203k3,333 new stars in the last 7 days

Featured

algorithmic-art

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

moneyprinterturbo-video

HAharry0703/MoneyPrinterTurbo147k1,663 new stars in the last 7 days

thinking-out-loud

SHShubhamsaboo/awesome-llm-apps146k895 new stars in the last 7 days

design-motion

GAgarrytan/gstack143k636 new stars in the last 7 days