feat(envs): make LIBERO sim control frequency configurable#312
Conversation
The LIBERO env built OffScreenRenderEnv without control_freq, so the sim always ran at robosuite's hardcoded 20 Hz and the env-config `fps` field was dead (never placed in gym_kwargs). Thread `fps` through gym_kwargs -> LiberoEnv -> OffScreenRenderEnv(control_freq=...), defaulting to 20 (the native rate, so behavior is unchanged) and bump existing libero configs from their stale 10/30 to 20. Adds CPU mock tests plus a gpu test that the value reaches the real sim.
Review: LIBERO control-freq wiringOverview. Wires the previously-dead Bottom line: correct and well-tested — good to merge after the optional nits below. Verified the call chain end-to-end; the default is behavior-preserving (20 = robosuite's default, so the no-arg path is unchanged), and the 39% vs 92% ablation is a convincing justification for both the default and the config bumps. Verified
Optional suggestions (none blocking)
Risk: low. Default path unchanged; the only behavioral delta is for configs that explicitly set fps 10/30, which are intentionally corrected. No new deps; CPU tests are self-contained. Generated by Claude Code |
Addresses PR review: fps now drives the sim control loop, so reject a non-positive value in __post_init__ instead of letting it fail obscurely inside robosuite; and note in the base EnvConfig docstring that fps is a stepping frequency whose exact meaning is env-specific (LIBERO overrides to 20).
|
Thanks for the review. Addressed in 804dbdb:
Leaving as-is:
|
pi_config and value_config referenced the 10-fps physical-intelligence/libero dataset with dataset_mixture.action_freq=30, which upsamples/mis-samples it. Set both to 10 to match the dataset's frame rate. (env.fps — the sim control rate — stays 20 where an env exists; no env sections were added.)
Re-review (updated for
|
Re-point all physical-intelligence/libero references to TensorAuto/libero (a forthcoming 20-fps re-export that fixes the nominal 10-fps label) and set dataset_mixture.action_freq to 20, so the dataset rate, action sampling, and the 20 Hz sim all align. Also renames the standard_data_format_mapping key and the value-visualizer fallback default, and generalizes a v2.0-format comment (the re-export may be v2.1). The dataset is not published yet, so these configs are not runnable until it lands.
Re-review (updated for
|
Document in standard_data_format_mapping that physical-intelligence/libero is intentionally unmapped: it ships a wrong fps=10 label (actions are authored at the sim's native 20 Hz), so its entry is removed (not aliased) to discourage use in favor of the corrected 20-fps TensorAuto/libero re-export.
|
Thanks — addressing the re-review of the migration (incl.
|
Re-review (
|
| Prior concern | Status |
|---|---|
| 🚧 Unpublished dataset (merge-blocker) | Resolved — body now states TensorAuto/libero is published: a v2.1 re-export of the same frames (1693 eps / 273465 frames, "verified equal"), fps label corrected 10 → 20, no resampling. |
Resolved — now a deliberate choice with an explanatory comment in standard_data_format_mapping.py + an explicit "Compatibility notes" entry. Fail-loud to discourage the mislabeled upstream is a reasonable call. |
|
🔎 action_freq: 20 unverifiable |
Resolved — metadata verified (fps=20, v2.1, matching counts). Since it's a relabel-only re-export, the same physical frames are sampled as before (consecutive frames): training behavior is preserved for the already-correct configs and fixed for the old action_freq: 30 ones. |
| ✂️ Scope/title | Kept as one PR. Now that the dataset is live the blocking rationale is gone, so this is just hygiene — consider broadening the title beyond (envs) since it also migrates the dataset, but not a blocker. |
One caveat — I couldn't independently verify the dataset from the review sandbox. huggingface.co is egress-blocked here (403 on TensorAuto/libero and on a public control lerobot/droid_100), so I'm trusting the author's stated verification + green CI rather than confirming the HF metadata myself.
CI: check-checklist ✅, Pre-commit Hooks ✅, review ✅; CPU Tests still in progress. (PR is a draft with requested reviewers pending — hence blocked.)
Bottom line
LGTM once CPU Tests lands green. The env.fps → control_freq fix is solid and well-tested, and the dataset relabel cleanly aligns dataset rate / action_freq / sim control_freq at 20.
Generated by Claude Code
What this does
🗃️ Feature / 🐛 Bug
The LIBERO eval env built
OffScreenRenderEnvwith onlybddl_file_name+ camera sizes, so the simulation always ran at robosuite's hardcodedcontrol_freq=20Hz. TheEnvConfig.fpsfield existed but was dead — it was never placed ingym_kwargs, so it never reached env construction. (Upstream LeRobot's LIBERO env carries the same dead field.)This wires
env.fpsthrough to robosuite'scontrol_freq:The LIBERO default is set to 20 (robosuite's native rate, so the no-arg path is unchanged), with a
fps > 0guard.Why 20 is the right default. An fps ablation on a
pi05_memcheckpoint (libero_10, 64 episodes per setting, single GPU, identical seed/config — onlyenv.fpsvaried):control_freqlibero_10success20 Hz reproduces the training-time eval; 10 Hz collapses it. The data is authored at the sim's native 20 Hz.
Dataset:
physical-intelligence/libero→TensorAuto/libero(20 fps)Every reference to
physical-intelligence/liberois re-pointed toTensorAuto/liberoanddataset_mixture.action_freqis set to 20 across the demo configs and docs.TensorAuto/liberois published — av2.1re-export of the same frames/episodes (1693 episodes / 273465 frames, verified equal) with the fps label corrected10 → 20Hz (no resampling). Upstreamphysical-intelligence/liberoships a wrongfps=10label even though its actions are authored at 20 Hz; the corrected copy makes the dataset rate,action_freq, and simcontrol_freqall line up at 20.Compatibility notes
env.fpsis now active. If your own config explicitly set it to a non-20 value (the old example configs shippedfps: 10), that value was previously ignored and will now take effect — set it to 20, or remove it, to keep the prior 20 Hz behavior.physical-intelligence/liberois intentionally removed fromstandard_data_format_mapping.py(not aliased), with an explanatory comment, to discourage the wrongly-labeled dataset. A config still pointing at it (without its owndata_features_name_mapping) will error at dataset build — switch toTensorAuto/libero.How it was tested
tests/envs/test_libero_control_freq.py: CPU mock tests (env.fps→gym_kwargs["control_freq"];OffScreenRenderEnvbuilt with the configuredcontrol_freq; default 20; rejectsfps <= 0) plus a@pytest.mark.gpureal-sim readback.pre-commit run --all-filesandpytest -m "not gpu" -n autopass; the gpu test passes on a CUDA box.libero_10).TensorAuto/liberometadata:fps=20,v2.1, same episode/frame counts as the upstream copy.How to checkout & try? (for the reviewer)
pytest -sx tests/envs/test_libero_control_freq.py -m "not gpu"The sim frequency is now a config field / CLI override on any libero config:
Checklist
Note: Before submitting this PR, please read the contributor guideline.