physicalai-train-exporting-and-validating

Installation
SKILL.md

Exporting and Validating Studio Policies

Export lives in library/src/physicalai/export/: backends.py (the ExportBackend enum — onnx, openvino, torch, executorch — plus per-backend parameter classes) and mixin_policy.py (ExportablePolicyMixin, which gives policies export(output_dir, backend=...)). The Python API is primary library behavior; the CLI entry library/src/physicalai/cli/export.py must preserve the same artifact contract. Studio owns export; Runtime owns loading.

Workflow

  1. Identify the inputs: source policy class (e.g. physicalai.policies.ACT), .ckpt path, target backend, and the Runtime loader behavior expected for that backend.
    • Done when: all four are pinned before touching code.
  2. Pick the route and keep both consistent — they must produce the same artifact:
    • Python: policy.export(output_dir, backend=ExportBackend.ONNX).
    • CLI: physicalai export --policy physicalai.policies.ACT --ckpt_path model.ckpt --backend onnx --output_dir ./export.
  3. Read backend constraints before editing generic code. See the backend reference for the target (references/<backend>.md). Do not generalize a fix across backends without checking each.
  4. Export, then validate numerical parity against the Torch policy path on representative inputs. Parity proves correctness.
    • Done when: max abs/rel diff on sample inputs is within the family's tolerance, or the divergence is understood and documented.
  5. Validate artifact structure and metadata against references/export-contract.md.
    • Done when: the expected model file and metadata files exist, and input/output/feature names match Runtime preprocessing.
  6. Confirm the Runtime path. For deployment-bound artifacts, verify Runtime can auto-detect (by extension) or explicitly load the backend via InferenceModel(...).

Validation loop

Installs
25
GitHub Stars
68
First Seen
Jul 6, 2026
physicalai-train-exporting-and-validating — open-edge-platform/physical-ai-studio