Skip to content

roadmap: g1_motion_tracking multi-backend enablement — newton CUDA graph, genesis cold-start, isaac worker fixes #1604

Description

@TATP-233

Background

FlashSAC g1_motion_tracking now runs on five backends (mujoco, motrix, mjwarp, newton, genesis) after #1603, with training metrics at or above the fastsac baseline. Three known gaps remain, and closing them spans three repositories: Motphys/UniLab (this repo, owner configs/registration), unilabsim/unisim (backend adapters), unilabsim/unilab_rl (algo runners/collectors). This issue tracks the cross-repo roadmap.

Work items

1. Newton CUDA graph acceleration (unisim → unilab)

The newton backend reaches ~35k sps vs mjwarp's ~94k on the same task. Unlike mjwarp — where CUDA graphs are automatic and transparent (unisim/backend/mjwarp/backend.py, _cuda_graph_eligibility(): CUDA + driver ≥ 12.4 + mempool, eager fallback) — NewtonBackend has no graph support at all, and newton.SolverMuJoCo (1.5.1) exposes no graph parameter.

  • unisim: implement CUDA graph capture in NewtonBackend, following the mjwarp eligibility/fallback pattern. Constraints identified:
    • _physics_substep swaps state/state_out pointers each step → capture the full nsteps loop (or parity double-graphs)
    • set_state (reset) allocates fresh warp arrays per call → keep reset outside the graph unless fixed-capacity scratch is added (mjwarp _RESET_SCRATCH_CAPACITY pattern)
    • capture must happen after materialize() capacity calibration rebuilds state
    • per-step capacity-check host sync (backend.py:623-632) limits graph benefit; consider periodic checking (behavior change, needs review)
  • unilab: optional owner knob (newton_use_cuda_graph) in src/unilab/base/base.py + backend_factory.py forwarding; document in newton owner YAMLs
  • Validate with flashsac g1_motion_tracking full-budget training (target: sps uplift, reward parity with the 26.50 / best 34.15 eager result)

2. Genesis cold-start tick-0 timeout — root fix (unilab_rl → unilab)

First genesis run always hits TimeoutError: collector inference tick 0 (30s): collector env construction — including genesis kernel JIT (all of it inside scene.build, no lazy compilation left) and the first reset — happens inside the tick-0 timing window (uni_rl/offpolicy/double_buffer_runner.py:555, worker.py:232→325). The disk cache (~/.cache/quadrants/qdcache/) fixes second runs, but even warm builds at 2048 envs can exceed 30s (per-process kernel module loading). The existing learner-side 1-env probe env does not warm the collector's cache: genesis forks kernel sets by n_envs (PARA_LEVEL.PARTIAL for n_envs≤1 vs ALL otherwise, genesis/engine/scene.py:967).

Current state: timeout override (training.inference_request_timeout_sec) is only a mitigation, and flash_sac doesn't even forward it yet (unilabsim/unilab_rl#26; fast_td3 is missing it too).

  • unilab_rl (root fix): collector-ready handshake — collector signals after init_state; learner starts tick timing only after ready, so 30s bounds steady-state ticks, not backend cold start. Merge with unilab_rl#26 (timeout forwarding for flash_sac/fast_td3)
  • unilab (mitigation, doable now): set GS_PARA_LEVEL=2 for the learner probe env when sim_backend=genesis so the probe compiles the same kernel set as the collector, moving cold JIT into the untimed runner-construction phase (src/unilab/scripts/train_offpolicy.py)
  • After the unilab_rl handshake lands: re-validate genesis at the default 2048 envs (currently validated at 512 envs, 12.8M steps: final 23.94 vs baseline 12.33 @10m steps)

3. isaacgym/isaacsim worker state fixes (unisim → unilab)

  • unisim: fix worker state publish/reset path (isaacgym/isaacsim: broken body-state publish / reset for motion-tracking workloads unilabsim/unisim#141 — episode length stuck at 1.0-1.6; evidence attached there). Not fixed in unisim-core 1.5.1
  • unilab: after the unisim fix, probe both backends on g1_motion_tracking, register them in src/unilab/tasks/motion_tracking/g1/__init__.py, add owner YAMLs, and run full-budget flashsac training validation
  • Regenerate the support matrix and update tests/envs/test_env_configs.py backend list

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions