Skip to content

Add DualModePolicyConfig, simplify inference CLI#80

Open
brentyi wants to merge 2 commits intoamazon-far:mainfrom
brentyi:brent/20260318_inference_cli_cleanup
Open

Add DualModePolicyConfig, simplify inference CLI#80
brentyi wants to merge 2 commits intoamazon-far:mainfrom
brentyi:brent/20260318_inference_cli_cleanup

Conversation

@brentyi
Copy link
Copy Markdown

@brentyi brentyi commented Mar 18, 2026

Followup to #73, which adds a dual policy inference mode that can be quickly switched between.

In #73, this was implemented by:

  • Adding a secondary: InferenceConfig field to the InferenceConfig class:
    @dataclass(frozen=True)
    class InferenceConfig:
         robot: ...
         observation: ...
         task: ...
         secondary: InferenceConfig | None  # New!
  • Introducing an argparse-based "pre-parser" for choosing between secondary configs, before the standard tyro parser is used to override config defaults.

Two problems here:

  • (Nit) The datastructure is a bit weird, since if we have inference_config there's a inference_config.secondary, but that secondary can also have a secondary: inference_config.secondary.secondary.
  • The argparse parsing logic adds complexity.

This PR:

  • Adds a DualModePolicyConfig class with two fields, primary: InferenceConfig and secondary: InferenceConfig. I think this is clearer.
    • Breaking change: entrypoint-registered inference configs should now be DualModePolicyConfig instead of InferenceConfig. We could add an automatic cast / compatibility shim if this is a problem.
  • Uses the DualModePolicyConfig to re-implement the secondary config selection logic using tyro.
    • This was designed to reproduce the previous logic as closely as possible. Subcommands like inference:g1-29dof-loco now refer to a (primary, secondary) inference config pair. The default secondary can be overridden with either none or another inference config.
    • The syntax is slightly different.
      • --secondary none is now secondary:none.
      • --secondary-preset g1-29dof-wbt is now secondary:g1-29dof-wbt.

@tomasz-lewicki @carlosferrazza

@clayrosenthal clayrosenthal added the enhancement New feature or request label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants