# amazon-far/fpo-control architecture

> Architecture diagram of the GitHub repository amazon-far/fpo-control, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amazon-far/fpo-control
- Repository: https://github.com/amazon-far/fpo-control

## Overview

#### Purpose and layout
This is an FPO++ (Flow Policy Optimization) research release with two independent Python experiment stacks: Isaac Lab locomotion and simulated robot manipulation. Each has its own environment bootstrap and dependencies; they share no visible common application package.

#### Primary entry points
- Locomotion: training and policy playback are launched through `isaaclab_experiments/isaaclab_fpo/scripts/train.py`, `isaaclab_experiments/isaaclab_fpo/scripts/play.py`, and visualization playback in `isaaclab_experiments/isaaclab_fpo/scripts/play_with_viser.py`.
- Manipulation: offline base-policy pretraining, online RL fine-tuning, and checkpoint evaluation are respectively `manipulation_experiments/pretrain_flow_bc.py`, `manipulation_experiments/finetune_online_rl.py`, and `manipulation_experiments/eval_checkpoint.py`.

#### Locomotion training stack
The installable `isaaclab_fpo` package implements an on-policy FPO RL path around Isaac Lab vectorized simulation. CLI and task/RL configuration select a task and algorithm; the runner samples parallel environment rollouts, invokes FPO updates, logs/checkpoints, and can export policies.
- `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/algorithms/fpo.py`
- `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/runners/on_policy_runner.py`
- `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/rl_cfg.py`

#### Locomotion environment/model boundary
`vec_env.py` and `wrapper.py` adapt Isaac Lab task environments to the learning loop’s vectorized observation/action/reset interface. Actor-critic, observation normalization, EMA, and rollout storage form the policy-learning state boundary: simulator tensors enter the policy; action, reward, termination, and value data are accumulated before an optimizer update.
- `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/env/vec_env.py`
- `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/modules/actor_critic.py`
- `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/storage/rollout_storage.py`

#### Manipulation learning pipeline
Manipulation experiments separate offline flow behavior-cloning pretraining from online FPO/Vanilla-FPO/DPPO fine-tuning. The local flow model stack supplies configurable MLP, residual MLP, or U-Net denoisers, while `dexmg_env.py` bridges the training scripts to manipulation environments. Evaluation consumes saved checkpoints and produces benchmark results; shell launchers encode benchmark/ablation orchestration.
- `manipulation_experiments/pretrain_flow_bc.py`
- `manipulation_experiments/finetune_online_rl.py`
- `manipulation_experiments/src/flow_model.py`
- `manipulation_experiments/src/dexmg_env.py`

#### Simulation, data, and external dependencies
Locomotion depends on NVIDIA Isaac Lab through the submodule at `isaaclab_experiments/thirdparty/IsaacLab`; whole-body tracking data is separately provisioned under `isaaclab_experiments/whole_body_tracking_reference_data/`. Manipulation vendors LeRobot for policy/dataset/RL facilities and robosuite for MuJoCo-based simulation; DexMimicGen is cloned during setup. GPU-oriented Python runtimes are implied by the deep-learning/simulation stacks. Experiment tracking integrations exist for Weights & Biases and Neptune in the locomotion package.
- `manipulation_experiments/thirdparty/lerobot/lerobot`
- `manipulation_experiments/thirdparty/robosuite/robosuite`
- `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/utils/wandb_utils.py`
- `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/utils/neptune_utils.py`

#### Visualization and artifacts
Isaac Lab playback can connect simulator state to Viser; pre-extracted scene hierarchies and GLB meshes support visualization for cartpole and multiple robot tasks. This is an observability/output path, not part of optimization control flow.
- `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/viser/viser_isaac_lab.py`
- `isaaclab_experiments/isaaclab_fpo/viser_assets/isaac_velocity_flat_g1_v0/scene_hierarchy.yaml`

Main entry points: [`isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/runners/on_policy_runner.py`](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/runners/on_policy_runner.py) (On-policy runner), [`isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/env/vec_env.py`](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/env/vec_env.py) (Vector environment adapter), [`manipulation_experiments/finetune_online_rl.py`](https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/finetune_online_rl.py) (Online RL fine-tuning), [`isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/modules/actor_critic.py`](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/modules/actor_critic.py) (Actor-critic & rollout state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_locomotion["Isaac Lab Locomotion"]
  node_loco_train["Train CLI<br/>Python entry point<br/>[train.py]"]
  node_loco_play["Policy playback<br/>Python entry point<br/>[play.py]"]
  node_loco_vis_play["Viser playback<br/>Python entry point<br/>[play_with_viser.py]"]
  node_rl_cfg["Task &amp; RL config<br/>configuration layer<br/>[rl_cfg.py]"]
  node_runner["On-policy runner<br/>training orchestrator"]
  node_vec_env["Vector environment adapter<br/>environment boundary<br/>[vec_env.py]"]
  node_policy_state["Actor-critic &amp; rollout state<br/>policy learning state<br/>[actor_critic.py]"]
  node_fpo["FPO optimizer<br/>RL algorithm<br/>[fpo.py]"]
  node_rollouts[("Rollout storage<br/>trajectory buffer<br/>[rollout_storage.py]")]
  node_tracking["Experiment tracking<br/>W&amp;B / Neptune integration<br/>[wandb_utils.py]"]
  node_viser["Viser bridge<br/>visualization adapter<br/>[viser_isaac_lab.py]"]
end

subgraph group_manipulation["Manipulation Experiments"]
  node_pretrain["Flow BC pretraining<br/>Python entry point"]
  node_finetune["Online RL fine-tuning<br/>Python entry point"]
  node_eval["Checkpoint evaluation<br/>Python entry point<br/>[eval_checkpoint.py]"]
  node_flow_model["Flow model stack<br/>denoising policy model<br/>[flow_model.py]"]
  node_dexmg_env["DexMimicGen adapter<br/>environment boundary<br/>[dexmg_env.py]"]
end

subgraph group_dependencies["Simulation &amp; Integrations"]
  node_isaac_lab{{"NVIDIA Isaac Lab<br/>simulator submodule"}}
  node_tracking_data[("Whole-body tracking data<br/>reference dataset")]
  node_lerobot{{"LeRobot<br/>vendored learning framework"}}
  node_robosuite{{"robosuite<br/>MuJoCo simulation framework"}}
  node_viser_assets["Viser scene assets<br/>visualization assets"]
end

node_loco_train -->|"loads"| node_rl_cfg
node_loco_train -->|"starts"| node_runner
node_rl_cfg -->|"configures"| node_runner
node_runner -->|"steps"| node_vec_env
node_vec_env -->|"adapts tasks from"| node_isaac_lab
node_tracking_data -.->|"provides references"| node_isaac_lab
node_runner -->|"acts with"| node_policy_state
node_vec_env -->|"observations, rewards, dones"| node_rollouts
node_policy_state -->|"values and actions"| node_rollouts
node_rollouts -->|"training batches"| node_fpo
node_fpo -->|"optimizer updates"| node_policy_state
node_runner -.->|"logs checkpoints and metrics"| node_tracking
node_loco_play -->|"replays policy in"| node_vec_env
node_loco_vis_play -->|"launches"| node_viser
node_viser -->|"streams state from"| node_isaac_lab
node_viser_assets -.->|"supplies scenes"| node_viser
node_pretrain -->|"trains"| node_flow_model
node_pretrain -->|"uses datasets and policies"| node_lerobot
node_finetune -->|"fine-tunes"| node_flow_model
node_finetune -->|"interacts through"| node_dexmg_env
node_dexmg_env -->|"runs manipulation simulation"| node_robosuite
node_finetune -->|"uses RL facilities"| node_lerobot
node_eval -->|"loads checkpoints"| node_flow_model
node_eval -->|"benchmarks in"| node_dexmg_env

click node_loco_train "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/scripts/train.py"
click node_loco_play "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/scripts/play.py"
click node_loco_vis_play "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/scripts/play_with_viser.py"
click node_rl_cfg "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/rl_cfg.py"
click node_runner "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/runners/on_policy_runner.py"
click node_vec_env "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/env/vec_env.py"
click node_policy_state "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/modules/actor_critic.py"
click node_fpo "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/algorithms/fpo.py"
click node_rollouts "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/storage/rollout_storage.py"
click node_tracking "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/utils/wandb_utils.py"
click node_viser "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/viser/viser_isaac_lab.py"
click node_pretrain "https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/pretrain_flow_bc.py"
click node_finetune "https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/finetune_online_rl.py"
click node_eval "https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/eval_checkpoint.py"
click node_flow_model "https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/src/flow_model.py"
click node_dexmg_env "https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/src/dexmg_env.py"
click node_isaac_lab "https://github.com/amazon-far/fpo-control/tree/main/isaaclab_experiments/thirdparty/IsaacLab"
click node_tracking_data "https://github.com/amazon-far/fpo-control/tree/main/isaaclab_experiments/whole_body_tracking_reference_data"
click node_lerobot "https://github.com/amazon-far/fpo-control/tree/main/manipulation_experiments/thirdparty/lerobot/lerobot"
click node_robosuite "https://github.com/amazon-far/fpo-control/tree/main/manipulation_experiments/thirdparty/robosuite/robosuite"
click node_viser_assets "https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/viser_assets/isaac_velocity_flat_g1_v0/scene_hierarchy.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loco_train,node_loco_play,node_loco_vis_play,node_rl_cfg,node_runner,node_vec_env,node_policy_state,node_fpo,node_rollouts,node_tracking,node_viser toneBlue
class node_pretrain,node_finetune,node_eval,node_flow_model,node_dexmg_env toneAmber
class node_isaac_lab,node_tracking_data,node_lerobot,node_robosuite,node_viser_assets toneMint
```

## Components

### Isaac Lab Locomotion

On-policy FPO experiments over vectorized Isaac Lab tasks.

- [Train CLI](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/scripts/train.py): Python entry point · `isaaclab_experiments/isaaclab_fpo/scripts/train.py`
- [Policy playback](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/scripts/play.py): Python entry point · `isaaclab_experiments/isaaclab_fpo/scripts/play.py`
- [Viser playback](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/scripts/play_with_viser.py): Python entry point · `isaaclab_experiments/isaaclab_fpo/scripts/play_with_viser.py`
- [Task & RL config](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/rl_cfg.py): configuration layer · Selects tasks and algorithm settings. · `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/rl_cfg.py`
- [On-policy runner](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/runners/on_policy_runner.py): training orchestrator · Samples rollouts, updates policies, and writes artifacts. · `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/runners/on_policy_runner.py`
- [Vector environment adapter](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/env/vec_env.py): environment boundary · Adapts Isaac Lab tasks to vectorized learning I/O. · `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/env/vec_env.py`
- [Actor-critic & rollout state](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/modules/actor_critic.py): policy learning state · Policy, normalization, EMA, and collected transition data. · `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/modules/actor_critic.py`
- [FPO optimizer](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/algorithms/fpo.py): RL algorithm · `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/algorithms/fpo.py`
- [Rollout storage](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/storage/rollout_storage.py): trajectory buffer · `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/storage/rollout_storage.py`
- [Experiment tracking](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/utils/wandb_utils.py): W&B / Neptune integration · `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/utils/wandb_utils.py`
- [Viser bridge](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/viser/viser_isaac_lab.py): visualization adapter · Streams simulator state for visualization. · `isaaclab_experiments/isaaclab_fpo/isaaclab_fpo/viser/viser_isaac_lab.py`

### Manipulation Experiments

Offline flow pretraining and online policy optimization.

- [Flow BC pretraining](https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/pretrain_flow_bc.py): Python entry point · `manipulation_experiments/pretrain_flow_bc.py`
- [Online RL fine-tuning](https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/finetune_online_rl.py): Python entry point · Runs FPO, Vanilla-FPO, or DPPO fine-tuning. · `manipulation_experiments/finetune_online_rl.py`
- [Checkpoint evaluation](https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/eval_checkpoint.py): Python entry point · Produces benchmark results from saved checkpoints. · `manipulation_experiments/eval_checkpoint.py`
- [Flow model stack](https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/src/flow_model.py): denoising policy model · Configurable MLP, residual MLP, and U-Net denoisers. · `manipulation_experiments/src/flow_model.py`
- [DexMimicGen adapter](https://github.com/amazon-far/fpo-control/blob/main/manipulation_experiments/src/dexmg_env.py): environment boundary · Bridges training code to manipulation environments. · `manipulation_experiments/src/dexmg_env.py`

### Simulation & Integrations

- [NVIDIA Isaac Lab](https://github.com/amazon-far/fpo-control/tree/main/isaaclab_experiments/thirdparty/IsaacLab): simulator submodule · `isaaclab_experiments/thirdparty/IsaacLab`
- [Whole-body tracking data](https://github.com/amazon-far/fpo-control/tree/main/isaaclab_experiments/whole_body_tracking_reference_data): reference dataset · `isaaclab_experiments/whole_body_tracking_reference_data`
- [LeRobot](https://github.com/amazon-far/fpo-control/tree/main/manipulation_experiments/thirdparty/lerobot/lerobot): vendored learning framework · Provides policy, dataset, and RL facilities. · `manipulation_experiments/thirdparty/lerobot/lerobot`
- [robosuite](https://github.com/amazon-far/fpo-control/tree/main/manipulation_experiments/thirdparty/robosuite/robosuite): MuJoCo simulation framework · `manipulation_experiments/thirdparty/robosuite/robosuite`
- [Viser scene assets](https://github.com/amazon-far/fpo-control/blob/main/isaaclab_experiments/isaaclab_fpo/viser_assets/isaac_velocity_flat_g1_v0/scene_hierarchy.yaml): visualization assets · Scene hierarchy and meshes for playback. · `isaaclab_experiments/isaaclab_fpo/viser_assets/isaac_velocity_flat_g1_v0/scene_hierarchy.yaml`

## Connections

- Train CLI → Task & RL config: loads
- Train CLI → On-policy runner: starts
- Task & RL config → On-policy runner: configures
- On-policy runner → Vector environment adapter: steps
- Vector environment adapter → NVIDIA Isaac Lab: adapts tasks from
- Whole-body tracking data → NVIDIA Isaac Lab: provides references
- On-policy runner → Actor-critic & rollout state: acts with
- Vector environment adapter → Rollout storage: observations, rewards, dones
- Actor-critic & rollout state → Rollout storage: values and actions
- Rollout storage → FPO optimizer: training batches
- FPO optimizer → Actor-critic & rollout state: optimizer updates
- On-policy runner → Experiment tracking: logs checkpoints and metrics
- Policy playback → Vector environment adapter: replays policy in
- Viser playback → Viser bridge: launches
- Viser bridge → NVIDIA Isaac Lab: streams state from
- Viser scene assets → Viser bridge: supplies scenes
- Flow BC pretraining → Flow model stack: trains
- Flow BC pretraining → LeRobot: uses datasets and policies
- Online RL fine-tuning → Flow model stack: fine-tunes
- Online RL fine-tuning → DexMimicGen adapter: interacts through
- DexMimicGen adapter → robosuite: runs manipulation simulation
- Online RL fine-tuning → LeRobot: uses RL facilities
- Checkpoint evaluation → Flow model stack: loads checkpoints
- Checkpoint evaluation → DexMimicGen adapter: benchmarks in
