diff --git a/docs/source/policy_groot_README.md b/docs/source/policy_groot_README.md index c5fe078c3..200a3872b 100644 --- a/docs/source/policy_groot_README.md +++ b/docs/source/policy_groot_README.md @@ -48,7 +48,7 @@ is itself a defaulted dataclass, so the original config dataclasses fail to impo So the test uses a **producer / consumer** split across two venvs: -1. **Producer** — `tests/policies/groot/dump_original_n1_7.py`, run in the *original* +1. **Producer** — `tests/policies/groot/utils/dump_original_n1_7.py`, run in the *original* gr00t venv. For each embodiment it builds dummy inputs generically from the checkpoint metadata (state dims from `statistics.json`; camera/language keys from the processor modality configs), runs the original model, and saves the exact @@ -82,7 +82,7 @@ PY # 1) Produce the original-side artifacts for all embodiments (original gr00t venv, CUDA) CUDA_VISIBLE_DEVICES=0 /path/to/Isaac-GR00T/.venv-original/bin/python \ - tests/policies/groot/dump_original_n1_7.py \ + tests/policies/groot/utils/dump_original_n1_7.py \ --ckpt "$CKPT" --out-dir tests/policies/groot/artifacts --device cuda --seed 42 # 2) Run the parity test (LeRobot venv) — one parametrized case per embodiment diff --git a/tests/policies/groot/test_groot_vs_original.py b/tests/policies/groot/test_groot_vs_original.py index 5861aae13..a46915b45 100644 --- a/tests/policies/groot/test_groot_vs_original.py +++ b/tests/policies/groot/test_groot_vs_original.py @@ -25,7 +25,8 @@ in the checkpoint. To keep the comparison fair, the original outputs + the exact collated inputs are produced once per embodiment in the original ``gr00t`` env via the companion script -``dump_original_n1_7.py`` (next to this file) and saved to per-tag ``.npz`` files. +``utils/dump_original_n1_7.py`` (in the ``utils`` package next to this file) and saved +to per-tag ``.npz`` files. This test discovers those artifacts, replays the identical inputs through the LeRobot model, and compares. @@ -65,7 +66,7 @@ def _artifact_dir() -> Path: Self-contained by default: a sibling ``artifacts/`` directory next to this test. Override with ``GROOT_N1_7_PARITY_DIR`` (e.g. to point at a scratch location). - The directory is read-only here -- it is populated by ``dump_original_n1_7.py`` + The directory is read-only here -- it is populated by ``utils/dump_original_n1_7.py`` run in the original gr00t environment; the test never creates it. """ env = os.environ.get("GROOT_N1_7_PARITY_DIR") @@ -169,7 +170,7 @@ _ARTIFACTS = _discover_artifacts() not _ARTIFACTS, reason=( "No GR00T N1.7 parity artifacts found. Generate them first in the original gr00t " - "env:\n .venv-original/bin/python tests/policies/groot/dump_original_n1_7.py " + "env:\n .venv-original/bin/python tests/policies/groot/utils/dump_original_n1_7.py " "--ckpt --out-dir tests/policies/groot/artifacts --device cuda" ), ) diff --git a/tests/policies/groot/utils/__init__.py b/tests/policies/groot/utils/__init__.py new file mode 100644 index 000000000..9a68168b3 --- /dev/null +++ b/tests/policies/groot/utils/__init__.py @@ -0,0 +1 @@ +"""Utilities shared by GR00T policy tests.""" diff --git a/tests/policies/groot/dump_original_n1_7.py b/tests/policies/groot/utils/dump_original_n1_7.py similarity index 99% rename from tests/policies/groot/dump_original_n1_7.py rename to tests/policies/groot/utils/dump_original_n1_7.py index c5dd0888e..26d1cd10c 100644 --- a/tests/policies/groot/dump_original_n1_7.py +++ b/tests/policies/groot/utils/dump_original_n1_7.py @@ -25,7 +25,7 @@ The companion pytest (run in the LeRobot env) loads each .npz, replays the ident inputs + seed through the LeRobot GR00T N1.7 model, and asserts the outputs match. Usage: - .venv-original/bin/python tests/policies/groot/dump_original_n1_7.py \ + .venv-original/bin/python tests/policies/groot/utils/dump_original_n1_7.py \ --ckpt \ --out-dir tests/policies/groot/artifacts \ [--tags libero_sim,oxe_droid_relative_eef_relative_joint,...] \