Repository navigation
feat(training): add DreamerV3 world-model package, mjlab GPU driver, ONNX export, and PPO benchmark - #903
feat(training): add DreamerV3 world-model package, mjlab GPU driver, ONNX export, and PPO benchmark#903M-Colley wants to merge 1 commit into
Conversation
0133fa5 to
8cd24e9
Compare
8cd24e9 to
c06bba5
Compare
|
Automated cross-repo audit (compatibility, composition, reuse) of
Nothing here blocks merging on its own; the items are for the next revision. Generated by Claude Code |
cb543d3 to
8fe47b8
Compare
|
Pushed
New tier1 test Note: the |
0af65f5 to
4b1a6bf
Compare
|
Pushed two follow-ups (
Full test suite ( |
…ONNX export, and PPO benchmark - Add self-contained training/dreamerv3/ (myosuite-dreamerv3) package per docs/wiki/training-guidelines.md across CPU Gymnasium (DreamerEnv), GPU mjlab MuJoCo Warp twins (MjlabDriver, mapping [-1, 1] onto each term's action_range and sanitizing diverged Warp worlds), and experimental GPU MJX (MJXDriver). - Add standalone JAX-free PyTorch / TorchScript / ONNX policy export (export.py) with MyoSuite deployment manifests (.onnx.manifest.json), silu activation parity, and pinned Hugging Face checkpoint resolution (maco018/myosuite-dreamerv3@ea6ca03a75eb3bfc7c1899232e445332ee7427ac, v0.2.0). - Expose bounded exploration std flags (--minstd, --maxstd, --actent) on dreamerv3-train-mjlab and add multi-seed PPO vs. DreamerV3 benchmark harness and 12-test pytest suite.
d05b730 to
8f59a5e
Compare
Note
Draft (
Post-3.0) — CandidatewmFamily & Shared Infra Gate (#953, Discussion #965): Converted to Draft and deferred from Milestone3.2pending maintainer alignment in Discussion #965 on canonical world-model organization (training/wm/alongsidetraining/supermimic/), adoption oftraining/common/(#953 / #977) evaluation, PPO baseline invocation, and artifact APIs, and full 4-task CPU+GPU PPO benchmark completion (myoElbowPose1D6MRandom-v0,myoChallengeRelocateP1-v0,myoFullBodyDirectional-v0,myoMimic-v0).Summary
training/dreamerv3/(myosuite-dreamerv3) package integrating DreamerV3 world-model reinforcement learning (Hafner, Pasukonis, Ba & Lillicrap, Nature 2025;danijar/dreamerv3, MIT License preserved inLICENSE-dreamerv3.txt) perdocs/wiki/training-guidelines.md, with zero changes tomyosuite/or the rootpyproject.toml.DreamerEnv,dreamerv3-train): wrapsmyosuite.make_env(5-tuple Gymnasium step,EnvConfig.featuresmuscle-condition wrappers--feature fatigue|sarcopenia|motor-noise|reafferentation, offscreenmujoco.Renderer64x64RGB CNN observations, andsolved/rwd_dense/rwd_sparselogging).mjlabDriver (MjlabDriver,dreamerv3-train-mjlab): wraps MyoSuite's registered GPU MuJoCo Warp twins (ManagerBasedRlEnv), handling same-step auto-reset,jax.prealloc=FalseVRAM sharing, in-placebfloat16JAX recurrent carry selection, and peak deterministic checkpoint (best_ckpt) tracking with zero-shot evaluation on CPUmake_env.MJXDriver,dreamerv3-train-mjx): stepsnum_envsenvironments insidejax.jit(jax.vmap(...))usingjax.lax.condstep-vs-reset staging so terminal observations (is_last=True,is_terminal) are preserved prior to episode reset.dreamerv3-export,export.py,hf.py): reconstructs the proprioceptive encoder, block-GRU RSSM posterior, and bounded-normal actor directly from saved checkpoint NumPy arrays (atol < 1e-5vs. JAX across resets), writes<policy>.onnx.manifest.jsonphysical provenance sidecars somyosuite.utils.export_onnx.verify_onnx_on_cpupasses strictly (allow_provenance_mismatch=False), and enforces pinned@<commit_or_tag>hf://resolution.Benchmark Against PPO (
size12m, Seeds0, 1, 2, NVIDIA GeForce RTX 5090, Zero-Shot CPUmake_envEval)Difference summary: Across all four evaluated tasks,
DreamerV3(size12m,mjlab) achieves higher sample efficiency and peak task return than registeredmjlabRSL-RLPPOon 6-musclemyoElbowPose1D6MRandom-v0(100.0 ± 0.0%vs.75.0 ± 8.2%solved;735.71 ± 24.86vs.281.25 ± 121.26return at36,864steps), under--feature fatigue(100.0 ± 0.0%vs.66.7 ± 2.4%solved;732.57 ± 18.91vs.226.56 ± 11.51return), on 39-musclemyoHandPoseRandom-v0(-276.76 ± 15.28vs.-300.81 ± 2.56return at294,912steps), and on 80-musclemyoLegWalk-v0(231.43 ± 41.67vs.211.49 ± 15.11return at196,608steps), whereas massively parallel on-policymjlabPPOruns7.8×–15.8×faster in wall-clock time (3.7–22.2 svs.41.3–351.6 s).env_id)make_envReturnmyoElbowPose1D6MRandom-v0DreamerV3(size12m,mjlab)735.71 ± 24.86100.0 ± 0.0%41.3 ± 1.3myoElbowPose1D6MRandom-v0PPO(mjlab/ RSL-RL)281.25 ± 121.2675.0 ± 8.2%3.7 ± 0.3myoElbowPose1D6MRandom-v0(--feature fatigue)DreamerV3(size12m,mjlab)732.57 ± 18.91100.0 ± 0.0%43.5 ± 0.3myoElbowPose1D6MRandom-v0(--feature fatigue)PPO(mjlab/ RSL-RL)226.56 ± 11.5166.7 ± 2.4%5.6 ± 2.7myoHandPoseRandom-v0DreamerV3(size12m,mjlab,best_ckpt)-276.76 ± 15.280.0 ± 0.0%351.6 ± 33.9myoHandPoseRandom-v0PPO(mjlab/ RSL-RL)-300.81 ± 2.560.0 ± 0.0%22.2 ± 6.4myoLegWalk-v0DreamerV3(size12m,mjlab,best_ckpt)231.43 ± 41.670.0 ± 0.0%266.3 ± 7.5myoLegWalk-v0PPO(mjlab/ RSL-RL)211.49 ± 15.110.0 ± 0.0%20.0 ± 1.2Full learning curves vs. environment steps and wall-clock time are documented in
training/dreamerv3/README.md.Extended 8.6-Hour GPU Runs (
6.0M–6.2MSteps,v0.2.0seed0Checkpoints)Bounding DreamerV3's
bounded_normalexploration std (--minstd 0.02 --maxstd 0.12..0.15 --actent 0.0, preventing entropy-drivenstddev -> 1.0drift on saturated off-muscles as in #566) and training ~8.6h per task (train_ratio=256, RTX 5090):env_id)Grad Updates)make_envONNX ReturnmyoLegWalk-v0(80 muscles)6,000,000(750k)9,961.76(4,130.9random starts)1,000.0 / 1,000(38%random)0.0%(upright 10s balance; speed< 0.7 m/s)myoHandPoseRandom-v0(39 muscles)6,200,000(1.55M)+100.03 ± 135.92(+115.11val)100.0 / 10018.8%any /15.6%final (25.0%val, 64/32 eps)All trained
size12mcheckpoints (agent.pkl, TorchScript.pt, and stateful.onnx+.onnx.manifest.json) and raw evaluation JSON logs are published on Hugging Face atmaco018/myosuite-dreamerv3(pinned at tagv0.2.0/ commitea6ca03a75eb3bfc7c1899232e445332ee7427ac).Verification
PYTHONPATH=../dreamerv3 pytest training/dreamerv3/tests/test_dreamerv3.py -v(12 passed, including strictverify_onnx_on_cpu(..., allow_provenance_mismatch=False),[0, 1]twin action-range mapping, Warp NaN guard, andsiluactivation parity)pre-commit run --all-filesOwnership & Reuse (
REVIEW.md)training/dreamerv3/(self-contained world-model package withpyproject.tomlandLICENSE-dreamerv3.txt; zero files inmyosuite/).myosuite.make_env,myosuite.core.hf_io,myosuite.utils.checkpoint_manifest, andmyosuite.utils.export_onnx.training/package; evaluation, PPO baseline runner, and artifact helpers slated fortraining/common/per Consolidate shared training infrastructure while keeping methods independently installable #953).Compatibility & Checks
Post-3.0): unit tests and CI pass; deferred pending Discussion RFC: Canonical Learning Families, Cross-Algorithm Compatibility Shim, and Benchmark Strategy (`training/*`) #965 (training/wm/) and full 4-task CPU+GPU PPO benchmark.