prlq's picture
openwam_v3/code: inference code (patch vs upstream, server, README)
7073aad verified
|
Raw History Blame Contribute Delete
3.3 kB

OpenWAM-α (MobileManipBench, final definition): inference code

Checkpoints: openwam_v3/{10000..80000}/ (final: openwam_v3/80000/). Each folder has the weights checkpoint_step_N.safetensors, config.yaml, normalization_stats.npy and tokenizer/.

Full training and data description: ../REPORT.md (section 5) and canonical_action_v2/README.md.

Files

file purpose
openwam_mmb.patch All our changes to official OpenWAM, against upstream commit 9bd3f87daa8c5376db42fd304ba17e65c5a888d7 (10 files). Applied to a clean checkout, it reproduces our training code byte for byte (verified).
serve_openwam.py Policy server, unified interface (openpi websocket protocol).
ws_server.py Minimal openpi-protocol websocket server.
stats/{go2_arm,sawyer_umi,stretch3}.npy The per-robot normalization the model was trained with (mmb_v4, = meta/mmb_v4_normalization_stats.npy): the shared q01/q99 in OpenWAM's raw order, with rot6d, gripper and missing dims as identity.
train_mmb.sh The launch script we used, for reference: 4 GPUs × batch 8, 80k steps (NPROC_PER_NODE=4 DATALOADER=mmb_v4 ... training.batch_size=8). Its paths are our cluster's.

What the patch adds:

  • the data loader openwam/dataloader/mmb_v4.py, registered as mmb_v4 with config configs/dataloader/mmb_v4.yaml, which implements the final definition;
  • mmb_canonical_action.py, a copy of the shared module;
  • the loaders for earlier definitions, kept because the registry imports them.

Run the policy

git clone https://github.com/OpenWAM-Official/OpenWAM.git && cd OpenWAM
git checkout 9bd3f87daa8c5376db42fd304ba17e65c5a888d7
git apply /path/to/openwam_mmb.patch
# install per the OpenWAM README, plus:
pip install --no-deps "openpi-client @ git+https://github.com/Physical-Intelligence/openpi.git#subdirectory=packages/openpi-client"
huggingface-cli download prlq/mobilemanipbench-data --repo-type dataset --include "openwam_v3/80000/*" --local-dir ckpt
# Also needed: Wan2.2-TI2V-5B (VAE + text encoder). config.yaml points to it; edit model.video_backbone(.encoder).model_path.
PYTHONPATH=$PWD:$PWD/third_party python /path/to/serve_openwam.py ckpt/openwam_v3/80000 --port 8001 --device cuda:0   # run from the OpenWAM root

Use --no-deps for openpi-client: its pin downgrades numpy below 2, and OpenWAM needs numpy 2.x.

Why a custom server: OpenWAM's built-in deploy normalizer expects a single stats file, but this model was trained with per-robot statistics. serve_openwam.py therefore loads the engine with the built-in normalizer off (dataloader.normalize_mode=none) and normalizes exactly like the training reader:

  • proprio: 14-D → final_raw_proprio → min-max → 80-D slots;
  • output: 80-D → slots → inverse min-max → 14-D.

Interface (same for π0.5, GR00T and OpenWAM)

Request: same fields as GR00T / π0.5 (see gr00t_n17_v4/code/README.md). Response: actions float32 [32, 14], unnormalized, shared layout, missing dimensions 0.

  • Images: head and wrist go into OpenWAM's [head, wrist, black] 384×320 canvas, using the same code as training.
  • Inference: 10 denoising steps (deploy default).
  • Speed: about 0.4–0.5 s per call on an MI325X shared with training, without compile.