Skip to content

Add Cosmos3 Nano - #1772

Merged
alexmillane merged 4 commits into
mainfrom
alexmillane/feature/cosmos3-nano-policy
Dec 3, 2026
Merged

alexmillane merged 4 commits into
mainfrom
alexmillane/feature/cosmos3-nano-policy

Conversation

@alexmillane

@alexmillane alexmillane commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Add a cosmos3_nano policy variant to CosmosRemotePolicy.

Why this change?

  • Cosmos Nano is the larger SoTA WAM variant
  • We want a more powerful WAM in the repo.

What changes?

  • CosmosRemotePolicyCfg takes policy_variant, a CosmosPolicyVariant enum (cosmos3_edge or cosmos3_nano).
  • The OSMO server task (osmo/tasks/cosmos_server_task.py) selects the checkpoint and prompt format from the run's policy_variant.
  • build_server_image.sh bakes the Nano checkpoint into the cosmos_server image next to Edge, pinned to a Hugging Face revision
  • run_cosmos_server.sh takes -v edge or -v nano to serve either checkpoint locally.

Edge is still the default, so existing experiment configs are unchanged.

Validation

  • Run ~5000 episodes of kitchenbench through Nano to produce SoTA results.

@alexmillane alexmillane left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self review.

@alexmillane
alexmillane force-pushed the alexmillane/feature/cosmos3-nano-policy branch from 7c6fbb0 to 8f946cb Compare November 27, 2026 12:43
@alexmillane
alexmillane changed the base branch from main to alex/feature/kitchenbench-eight-button-appliances November 27, 2026 12:43
@alexmillane
alexmillane force-pushed the alex/feature/kitchenbench-eight-button-appliances branch from 2e74d17 to 0a2d312 Compare November 27, 2026 20:47
@alexmillane
alexmillane force-pushed the alexmillane/feature/cosmos3-nano-policy branch from 8f946cb to 054a7bf Compare November 28, 2026 20:36
Base automatically changed from alex/feature/kitchenbench-eight-button-appliances to main November 29, 2026 15:54
CosmosRemotePolicyCfg gains a policy_variant field (CosmosPolicyVariant:
cosmos3_edge, the default, or cosmos3_nano) that selects which released
Cosmos3 DROID checkpoint serves the client. The variant sets the default
open_loop_horizon (16 for Edge, 32 for Nano) and, on OSMO, the server
task's checkpoint and prompt format: Edge is served with JSON-formatted
prompts and Nano with plain-text prompts, following each model card.

build_server_image.sh bakes the Nano checkpoint into the cosmos_server
image next to Edge, pinned to a Hugging Face revision, so the server
downloads nothing at startup.

run_cosmos_server.sh takes -v edge|nano to serve either checkpoint locally.

Signed-off-by: alex <[email protected]>
@alexmillane
alexmillane force-pushed the alexmillane/feature/cosmos3-nano-policy branch from 054a7bf to 220013c Compare November 30, 2026 20:07

@alexmillane alexmillane left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self review 1

Comment thread osmo/tasks/cosmos_server_task.py Resolved
Bake the Edge checkpoint to /workspace/baked_checkpoint_edge and rename the
build script's CHECKPOINT variables to EDGE_CHECKPOINT for symmetry with Nano.
Drop the policy_variant paragraph from the server/client policies docs page.

Signed-off-by: Alex Millane <[email protected]>
@alexmillane alexmillane changed the title Add Cosmos3 Nano policy variant to the Cosmos client and server Add Cosmos3 Nano Nov 30, 2026
@alexmillane
alexmillane marked this pull request as ready for review November 30, 2026 22:04
@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · Fix the documented Nano YAML selection before merging.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes reach Cosmos policy runs and their server images.

Fix the documented Nano YAML selection before merging.

Findings

  1. P1 Nano YAML fails to load ▶
  2. P2 Nano keeps Edge action timing ▶

Summary

Adds Nano selection to the Cosmos client, image build, local server wrapper, and per-run OSMO server setup.

  • Cosmos policy configs can choose Edge or Nano with matching replay defaults.
  • OSMO runs start the Cosmos server for each policy variant.
  • The Cosmos server image can serve either Edge or Nano.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Config["Cosmos policy config"] --> Variant{"Selected variant"}
  Variant --> Edge["Edge checkpoint · JSON prompt · 16 actions"]
  Variant --> Nano["Nano checkpoint · plain prompt · 32 actions"]
  Edge --> Server["Dedicated OSMO server"]
  Nano --> Server
  Server --> Client["Client replays returned actions"]
Loading

Reviews (1) · Last reviewed commit: "Address Cosmos3 Nano self review" · Reviewed by Greptile

Comment thread osmo/tasks/cosmos_server_task.py Resolved
Comment thread osmo/tasks/cosmos_server_task.py Resolved
@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

This PR adds Cosmos3 Nano as a second Cosmos policy variant. It adds a CosmosPolicyVariant enum on CosmosRemotePolicyCfg with a default open-loop horizon per variant, a checkpoint and prompt format per variant for the OSMO server task, and both checkpoints in the cosmos_server image. The OSMO wiring closely follows the pi0 pattern. My main new concern is the rollout: the Edge checkpoint path changes but the image tag stays the same, so Cosmos runs can break depending on which side of the image push they run (inline).

Greptile already posted two config problems. I reproduced both with the pinned omegaconf 2.3.1 and hydra-core 1.3.8, so I haven't repeated them inline:

  • policy_variant: cosmos3_nano doesn't load from YAML. Hydra only accepts the member name NANO. The policy-runner --policy_variant flag only accepts cosmos3_nano, so YAML and the CLI currently need different spellings. The repo already handles this for ObservationModality (vlm_agent_policy.py:53) by naming members after their values (cosmos3_edge = "cosmos3_edge"). I checked that with that change, YAML, Hydra overrides, the CLI flag, and the serializer all use cosmos3_nano. The test comment at test_osmo_experiment_workflow.py:463 ("the typed loader accepts the name or the value") should change with it.
  • A Run-level override runs.<run>.policy.policy_variant=NANO keeps open_loop_horizon=16. The loader builds each Run's policy, which fills in the Edge default, before applying Run overrides. I confirmed this by replicating the loader's two-stage composition. See the inline note on the horizon table for a fix that also clears up a stale comment.

Other notes, with no changed line to attach them to:

  • Cosmos Runs now record policy_variant: cosmos3_edge instead of cosmos_remote in arena_experiment_result.json (build_arena_run_result_metadata, arena_experiment_result.py:321). That's probably what you want, but older Cosmos results are labelled differently, so it's worth a line in the PR description.
  • The legacy osmo.submit_evaluation_workflow --policy cosmos path always starts CosmosServerTask with the default Edge config, yet it now accepts the new --policy_variant flag through --policy_runner_args. With --policy_variant cosmos3_nano, that path evaluates Edge but labels the results as Nano. The pi0 legacy workflow has the same gap. Should that path reject a non-default variant?
  • run_cosmos_server.sh:7 and its help text (line 33) still describe a "Cosmos3-Edge-Policy inference server".

Findings

🟡 Warning: osmo/tasks/cosmos_server_task.py:25 — The Edge checkpoint path is renamed, but the image tag stays cosmos_server. Old code and new images (or the reverse) will look for a checkpoint path that doesn't exist.
🔵 Improvement: isaaclab_arena_policies/isaaclab_arena_cosmos/docker/build_server_image.sh:25 — Pin the Edge Hugging Face revision like Nano, since this PR requires a rebuild.
🔵 Improvement: isaaclab_arena_policies/isaaclab_arena_cosmos/policy/cosmos_remote_config.py:25 — The comment at cosmos_remote_policy.py:18-22 is now stale. Resolving the horizon in the policy would also address Greptile's override point.
🔵 Improvement: osmo/tasks/cosmos_server_task.py:46 — Store policy_variant on the server config instead of two fields derived from it.

Test Coverage and CI Cost

The new tests are cheap and fit the existing files. None of them loads a Cosmos policy through the YAML loader or applies a Run override, which is where both Greptile issues occur. Greptile already asked for a YAML-loading test. It should also apply a Run-level policy_variant override and assert the horizon is 32, since that case fails today. At this head, pre-commit is still queued and the test jobs show as skipped, so I couldn't confirm the suite passes.

Verdict

Minor fixes needed

The press-button YAMLs from #1568 landed after #1775 started requiring
task-type tags on every KitchenBench YAML, which broke
test_kitchen_bench_yamls_have_known_tags on main. Tag them press_button.

Signed-off-by: Alex Millane <[email protected]>
Resolve the default open_loop_horizon when CosmosRemotePolicy is built,
so a Run override that switches policy_variant picks up the new variant's
default instead of keeping the Edge value written by __post_init__.

CosmosServerTaskCfg stores the policy_variant and looks up the checkpoint
and prompt format from it, so the two cannot disagree.

Pin the Edge checkpoint revision in build_server_image.sh, like Nano.

Signed-off-by: Alex Millane <[email protected]>
@alexmillane
alexmillane merged commit dc91398 into main Dec 3, 2026
10 checks passed
@alexmillane
alexmillane deleted the alexmillane/feature/cosmos3-nano-policy branch December 3, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants