Skip to content

fix(robomimic): end episodes on success and at the task's horizon; make the extra installable - #9

Merged
tactino merged 2 commits into
mainfrom
fix/robomimic-episodes
Sep 27, 2026
Merged

tactino merged 2 commits into
mainfrom
fix/robomimic-episodes

Conversation

@tactino

@tactino tactino commented Sep 25, 2026

Copy link
Copy Markdown
Member

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 - terminated came from done, which is always false, and truncated was hard-coded False. A pilot on NutAssemblySquare finished 0 episodes in 4,096 steps.

RobomimicConfig gains:

  • horizon: int | None = None - steps before truncation; None takes 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 robomimic extra could not be installed

It pinned robomimic==0.3.0 - the last on PyPI - whose env_robosuite imports mujoco_py unconditionally; mujoco_py needs 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] (no mujoco_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; the d4rl/cython/patchelf entries, which served mujoco_py, are gone. The comment says why, that this extra and mujoco need separate environments, and that robomimic's egl-probe needs CMake to build.
  • A failed robomimic import now reports the underlying error.

Checked, on a Linux workstation

  • The client's own code builds NutAssemblySquare from square-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 for EnvRobosuite and are skipped where robomimic is not installed, like the LIBERO tests.
  • Full suite: 141 passed, 12 skipped in the MuJoCo venv; 148 passed, 11 skipped, 1 failed in the robomimic venv. The failure, test_a_caller_who_chose_a_backend_keeps_it, fails identically on main in that venv and is not this change: robosuite 1.4.1's binding_utils.py (lines 37-43) forces MUJOCO_GL=egl on import whenever GPU rendering is on and the caller chose anything but osmesa or glx. It could only surface once robomimic was installable.

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".
@tactino
tactino merged commit b20f6bd into main Sep 27, 2026
2 checks passed
@tactino
tactino deleted the fix/robomimic-episodes branch September 27, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant