fix(robomimic): end episodes on success and at the task's horizon; make the extra installable - #9
Merged
Merged
Conversation
robomimic's environments never end an episode themselves: the shipped metadata sets ignore_done and EnvRobosuite.is_done() is never true; robomimic's own rollouts stop on success or at a fixed horizon. The client did neither, so a robomimic run was one endless episode - 0 episodes in 4,096 steps on NutAssemblySquare. RobomimicConfig gains horizon (default: robomimic's rollout horizon for the task, 400 or 700; an unknown task must set it) and terminate_on_success (default on). The robomimic extra pinned robomimic 0.3.0, which imports mujoco_py and so cannot be installed without MuJoCo 2.1 and system GL headers; it now takes v0.4.0 from its tag, with robosuite 1.4.1 and mujoco 2.3.7. A failed robomimic import now says what failed instead of "not installed".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The robomimic family had, in effect, never run: filling the platform's coverage matrix found two defects, one blocking installation and one making every run a single endless episode.
1. Episodes never ended
robomimic's environments do not end an episode themselves: the metadata this client ships sets
ignore_done,EnvRobosuite.is_done()is never true, and robomimic's own rollouts stop on success or at a fixed horizon. The client did neither -terminatedcame fromdone, which is always false, andtruncatedwas hard-codedFalse. A pilot onNutAssemblySquarefinished 0 episodes in 4,096 steps.RobomimicConfiggains:horizon: int | None = None- steps before truncation;Nonetakes robomimic's rollout horizon for the task (400 for Lift, PickPlaceCan, NutAssemblySquare; 700 for ToolHang, TwoArmTransport). A task with no known horizon and none set raises, rather than running forever.terminate_on_success: bool = True- the step the task succeeds ends the episode as terminated.2. The
robomimicextra could not be installedIt pinned
robomimic==0.3.0- the last on PyPI - whoseenv_robosuiteimportsmujoco_pyunconditionally;mujoco_pyneeds MuJoCo 2.1 binaries and system GL headers. On the GPU cluster neither client environment has it, so the import failed with the message "Robomimic is not installed" although robomimic was installed. Now:robomimic @ [email protected](nomujoco_py; supports robosuite 1.2+),robosuite==1.4.1,mujoco==2.3.7(the shipped metadata is v1.4-era, and mujoco 3.x trips robosuite 1.4.1's joint assertion),PyOpenGL==3.1.4; thed4rl/cython/patchelfentries, which servedmujoco_py, are gone. The comment says why, that this extra andmujoconeed separate environments, and that robomimic'segl-probeneeds CMake to build.Checked, on a Linux workstation
NutAssemblySquarefromsquare-img, resets and steps it, with EGL rendering, in a venv built from exactly these pins.tests/test_robomimic_episodes.py(written first, 6 of 6 failing before the fix): cut at the task's horizon; success ends the episode; success can be left running; an explicit horizon wins; reset restarts the count; an unknown task needs a horizon. They use a stand-in forEnvRobosuiteand are skipped where robomimic is not installed, like the LIBERO tests.test_a_caller_who_chose_a_backend_keeps_it, fails identically onmainin that venv and is not this change: robosuite 1.4.1'sbinding_utils.py(lines 37-43) forcesMUJOCO_GL=eglon import whenever GPU rendering is on and the caller chose anything but osmesa or glx. It could only surface once robomimic was installable.