[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110357":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":14,"starSnapshotCount":14,"syncStatus":15,"lastSyncTime":29,"discoverSource":30},110357,"xmimic","nico-bohlinger\u002Fxmimic","nico-bohlinger","Whole-body motion tracking for the Unitree G1 in under a minute. BlinkMimic's world-model trainer rebuilt in JAX, 3.7x faster on four H100s.",null,"Python",202,14,69,0,2,30,120,10,72.53,"MIT License",false,"main",true,[],"2026-11-18 01:07:00","2026-11-23 08:48:30","# XMimic\n\n**Whole-body motion tracking for the Unitree G1, trained 3.7× faster.** XMimic is BlinkMimic's world-model trainer rebuilt\nin JAX. On four H100s it reaches BlinkMimic's target in 0.86 minutes, where BlinkMimic needs 3.19 on one; on a single\nH100 it is 1.3× faster. Same task, same hyperparameters, same evaluation.\n\nPaper: [XMimic and XSoma: Learning Humanoid Motion Tracking and Locomotion in Under a Minute](https:\u002F\u002Fnico-bohlinger.github.io\u002Fpapers\u002F2026_xmimic_xsoma.pdf)\n(Nico Bohlinger, Jan Peters, 2026), which presents XMimic together with [XSoma](https:\u002F\u002Fgithub.com\u002Fnico-bohlinger\u002Fxsoma), the\nsame recipe for locomotion on rough terrain. Please [cite it](#citation) if you use XMimic. It replaces the first version, which covered\nXMimic alone.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"figures\u002Ftime_to_target_dark.png\">\n  \u003Cimg alt=\"Time to target on H100: BlinkMimic 3.19 min, InstantTrack v1.3 3.31 min, XMimic on 1, 2, 3 and 4 GPUs 2.47, 1.39, 1.09 and 0.86 min\" src=\"figures\u002Ftime_to_target.png\">\n\u003C\u002Fpicture>\n\n## What XMimic is\n\n[BlinkMimic](https:\u002F\u002Fgithub.com\u002Ffuyichen0725\u002Fblinkmimic) trains one policy that tracks all 40 LAFAN1 motion clips on a\nsimulated Unitree G1. It follows SuperMimic: learn a world model of the robot, then improve the policy by backpropagating\nthrough rollouts imagined in that model.\n\nXMimic implements the same algorithm with BlinkMimic's hyperparameters (`PRESET[main]`, commit `d264658`). What changes\nis the machinery:\n\n- everything runs in JAX: the simulator (MuJoCo Warp through MJX), the replay buffer, the world model, the policy and the critic;\n- whole training iterations compile into single XLA programs, so the GPU never waits for Python;\n- the iteration can be split across 2 to 4 GPUs that work at the same time.\n\n\u003Cp align=\"center\">\u003Cimg src=\"figures\u002Fxmimic.gif\" width=\"720\" alt=\"XMimic: 3.7x faster training to BlinkMimic's target, with the G1 dancing\">\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Csub>The G1 driven by an XMimic policy after 54 s of training on 4 H100s (the target checkpoint of a 4-GPU\nrun of the first release), replayed in MuJoCo on a CPU.\u003C\u002Fsub>\u003C\u002Fp>\n\n## Results\n\nTime to the same target on H100 NVL GPUs. Every run trains for at least 6 minutes; every 100th checkpoint is evaluated on\nall 40 clips with 4 replicas each.\n\n| method | GPUs | runs | it\u002Fs | first ≥ 0.82 (min) | held ×3 (min) | speedup | GPU-min to target |\n|---|---|---|---|---|---|---|---|\n| BlinkMimic | 1 | 5 | 9.1 | 2.25 (1.94–2.51) | 3.19 (2.70–3.91) | 1.00× | 3.2 |\n| InstantTrack v1.3 | 1 | 2 | 10.2 | 1.90 (1.81–1.99) | 3.31 (2.34–4.29) | 0.96× | 3.3 |\n| XMimic · 1 GPU | 1 | 8 | 12.0 | 1.71 (1.54–1.98) | 2.47 (1.98–3.42) | 1.29× | 2.5 |\n| XMimic · 2 GPUs | 2 | 4 | 25.2 | 0.93 (0.84–1.03) | 1.39 (1.16–1.81) | 2.29× | 2.8 |\n| XMimic · 3 GPUs | 3 | 4 | 36.4 | 0.71 (0.67–0.72) | 1.09 (0.95–1.41) | 2.91× | 3.3 |\n| XMimic · 4 GPUs | 4 | 4 | 38.8 | 0.70 (0.69–0.73) | **0.86 (0.77–0.95)** | **3.70×** | 3.4 |\n\nTimes are means over runs (range in brackets), in minutes of training with compilation excluded.\n\n- **The target** is BlinkMimic's: normalized evaluation return ≥ 0.82 with none of the 40 clips failing, held for three\n  consecutive checkpoints (\"held ×3\"). \"First ≥ 0.82\" is the first checkpoint above 0.82, with failures allowed.\n- **On one GPU** XMimic is 1.3× faster than BlinkMimic and InstantTrack, so it also needs the fewest GPU-minutes.\n- **On four GPUs** it is 3.7× faster in wall-clock time. It uses a little more GPU time in total than BlinkMimic (3.4 vs\n  3.2 GPU-minutes): the speedup buys time, not efficiency.\n- **Same final quality.** All methods end at about the same return (0.86 to 0.87 after 6 minutes); XMimic gets there\n  sooner.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"figures\u002Flearning_curves_dark.png\">\n  \u003Cimg alt=\"Learning curves: evaluation return and failed clips against training time\" src=\"figures\u002Flearning_curves.png\">\n\u003C\u002Fpicture>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Every layout\u003C\u002Fb>: how XMimic scales from 1 to 4 GPUs\u003C\u002Fsummary>\n\n\u003Cbr>\n\n`--layout` chooses how an iteration is spread over GPUs (see [How it gets fast](#how-it-gets-fast)). The 4-GPU layout\n(AWLP) is the headline above; the plain 1-GPU trainer is the like-for-like comparison. The runs of FP1, FP and ALP train\n3500 iterations, as in the first release. No schedule depends on the number of iterations, so their times to the target\ncompare directly.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"figures\u002Ftime_to_target_all_dark.png\">\n  \u003Cimg alt=\"Time to target of every layout\" src=\"figures\u002Ftime_to_target_all.png\">\n\u003C\u002Fpicture>\n\n| method | GPUs | runs | it\u002Fs | first ≥ 0.82 (min) | held ×3 (min) | speedup | GPU-min to target |\n|---|---|---|---|---|---|---|---|\n| BlinkMimic | 1 | 5 | 9.1 | 2.25 (1.94–2.51) | 3.19 (2.70–3.91) | 1.00× | 3.2 |\n| InstantTrack v1.3 | 1 | 2 | 10.2 | 1.90 (1.81–1.99) | 3.31 (2.34–4.29) | 0.96× | 3.3 |\n| XMimic, 1 GPU | 1 | 8 | 12.0 | 1.71 (1.54–1.98) | 2.47 (1.98–3.42) | 1.29× | 2.5 |\n| 1 GPU + probe process (FP1) | 1 | 4 | 11.8 | 1.83 (1.74–1.91) | 2.42 (1.93–3.04) | 1.32× | 2.4 |\n| 2 GPUs: trainer \\| prober (FP) | 2 | 4 | 16.0 | 1.59 (1.58–1.60) | 2.10 (1.89–2.32) | 1.52× | 4.2 |\n| 2 GPUs: actor \\| learner (AL) | 2 | 4 | 25.2 | 0.93 (0.84–1.03) | 1.39 (1.16–1.81) | 2.29× | 2.8 |\n| 3 GPUs: actor \\| learner \\| prober (ALP) | 3 | 2 | 25.8 | 0.90 (0.87–0.94) | 1.28 (1.00–1.56) | 2.49× | 3.8 |\n| 3 GPUs: actor \\| world model \\| policy (AWL) | 3 | 4 | 36.4 | 0.71 (0.67–0.72) | 1.09 (0.95–1.41) | 2.91× | 3.3 |\n| 4 GPUs: actor \\| world model \\| policy \\| prober (AWLP) | 4 | 4 | 38.8 | 0.70 (0.69–0.73) | **0.86 (0.77–0.95)** | **3.70×** | 3.4 |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>How we measured\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003Cbr>\n\n- **Hardware.** One H100 NVL per GPU, the GPUs of a node connected by NVLink. All methods ran on the same cluster.\n- **Training budget.** A checkpoint every 100 iterations for every method, as in BlinkMimic, and at least 6 minutes of\n  training: BlinkMimic trains its 3500 iterations (6.4 minutes), InstantTrack 4000 (6.6 minutes), and XMimic stops after\n  6.2 minutes (`--iterations 100000 --max_minutes 6.2`). FP1, FP and ALP train 3500 iterations.\n- **Evaluation.** BlinkMimic's protocol: each clip is played once from its first frame per replica (4 replicas), with no\n  randomization and no noise; a clip fails when the training termination triggers. XMimic's checkpoints are scored by its\n  JAX evaluator (`python -m xmimic.evaluate`), BlinkMimic's and InstantTrack's by their own `eval_batch.py`. On the same\n  checkpoints the two evaluators agree to +0.001 in mean return.\n- **Training time.** XMimic compiles before its clock starts. BlinkMimic and InstantTrack compile and capture CUDA graphs\n  inside their training loop, so that one-time cost is subtracted from their checkpoint times\n  ([`tools\u002Fexclude_compile.py`](tools\u002Fexclude_compile.py), from their own train logs).\n- **Baselines.** BlinkMimic `d264658` (`PRESET[main]`) and InstantTrack v1.3 `9474e74` (its own preset), both unmodified,\n  on their PyTorch stack (torch 2.9, mjlab 1.6, MuJoCo Warp 3.11).\n- **Data.** Every number above is computed from the evaluation files in [`results\u002F`](results\u002F) by\n  [`tools\u002Fmake_figures.py`](tools\u002Fmake_figures.py).\n\n\u003C\u002Fdetails>\n\n## How it gets fast\n\nAn iteration collects about 2.5 simulation steps of 4096 worlds, fits the world model 5 times, and updates the policy by\nbackpropagating through 32 imagined steps. The work is a long chain of small GPU kernels, so most of the speed comes from\nkeeping the GPU busy and running parts of the chain side by side.\n\n1. **Whole iterations as compiled programs.** On one GPU, 50 iterations run as one XLA program. Nothing returns to Python\n   in between, and checkpoints are written from a background thread.\n2. **bf16 where PyTorch uses it.** Matmul outputs are bf16, as in torch autocast, so the backward pass runs on bf16 tensor\n   cores too (policy update on an H100: 41.6 → 29.9 ms).\n3. **Fewer, larger kernels** in the learner ([`xmimic\u002Ffast.py`](xmimic\u002Ffast.py)): work that does not depend on the imagined\n   state is hoisted out of the 32-step loop, weight gradients are formed in one GEMM per layer, same-shape Muon updates\n   are batched, and cuBLAS replaces XLA's Triton GEMMs on Hopper. Each change is tested against the reference on the CPU.\n4. **Probe sweeps off the critical path.** BlinkMimic periodically replays the averaged policy on all clips to find\n   failures and focus training on them (the paper calls this the failure search; the code's flags are `--eprobe_*`). On\n   one GPU a sweep halves the training speed while it runs. XMimic can run the\n   sweeps on their own GPU, or in a second process that shares a GPU through CUDA MPS.\n5. **An iteration split across GPUs.** An actor collects data, a world-model learner fits the world model, and a policy\n   learner runs the backpropagation, all at the same time. Each works on the others' results from the previous iteration.\n6. **The host out of the way.** The actor runs in its own Python thread, collection loops get their trip count from the\n   host so that launching them never waits for the GPU, the critic fit moves to the world-model GPU, and Python's garbage\n   collector is frozen after setup. Together: 20 → 39–41 iterations per second on 4 GPUs.\n\n| `--layout` | GPUs | what each GPU does |\n|---|---|---|\n| `1GPU` (default) | 1 | everything, probe sweeps inside the loop as in BlinkMimic |\n| `FP1` | 1 | the 1-GPU trainer; probe sweeps in a second process on the same GPU (needs CUDA MPS) |\n| `FP` | 2 | trainer \\| prober |\n| `AL` | 2 | actor (collection, world model) \\| policy learner; probe process on GPU 1 (needs CUDA MPS) |\n| `ALP` | 3 | actor \\| policy learner \\| prober |\n| `AWL` | 3 | actor \\| world-model learner and critic \\| policy learner; probe process on GPU 1 (needs CUDA MPS) |\n| `AWLP` | 4 | actor \\| world-model learner and critic \\| policy learner \\| prober |\n\nOn 4 GPUs the actor's 2.5 physics steps (about 24 ms) and the policy update (about 23 ms) are now both on the critical path\nof a 25 ms iteration. More speed needs faster physics or collection spread over more GPUs.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>What did not help\u003C\u002Fb>\u003C\u002Fsummary>\n\n\u003Cbr>\n\n- Overlapping collection and learning on one GPU: XLA stream annotations crash with MuJoCo Warp's kernels or run the\n  learner 1.9× slower, and actor and learner as two processes sharing one GPU are no faster than the fused iteration.\n- Static collection loop bounds inside the 1-GPU program (3 % slower) or one program per iteration (18 % slower). Only the\n  multi-GPU actors use static bounds.\n- Other XLA flags: within 1 %, or much slower. Concurrent command-buffer scheduling helps the learners by 1–3 % but slows\n  the physics, so it is applied to the learner programs only (`--learner_xla`).\n- Two whole trainers on one GPU under CUDA MPS: 1.08× the throughput of one.\n- Smaller solver budgets are faster but change the dynamics. Other MJX graph modes, SAP broadphase and fused substeps gave\n  nothing.\n- Algorithm changes (a higher policy learning rate, larger world-model batches, a lower update-to-data ratio) were within\n  seed noise or worse, so BlinkMimic's settings stay.\n\n\u003C\u002Fdetails>\n\n## How to run\n\nLinux with NVIDIA GPUs and CUDA 12, Python 3.11. The published numbers are from H100s.\nWarp's wheel on PyPI needs an NVIDIA driver of version 580 or newer; with an older driver, install Warp's CUDA 12 build\n(`warp_lang-1.19.0+cu12`) from [its releases](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fwarp\u002Freleases) instead.\n\n```bash\npip install -r requirements.txt\nbash tools\u002Fdownload_data.sh        # 40 G1 LAFAN1 clips and the G1 meshes, checked against tools\u002Fdata_sha256.txt\n```\n\nTrain and evaluate on one GPU (about 5 minutes of training on an H100):\n\n```bash\npython train.py --log_dir runs\u002F1gpu\npython -m xmimic.evaluate runs\u002F1gpu    # writes runs\u002F1gpu\u002Feval_jax_r4.csv and prints the time to target\n```\n\nThe 4-GPU layout:\n\n```bash\npython train.py --layout AWLP --log_dir runs\u002Fawlp\n```\n\n`FP1`, `AL` and `AWL` share a GPU between two processes; start CUDA MPS first:\n\n```bash\nnvidia-cuda-mps-control -d\npython train.py --layout AWL --log_dir runs\u002Fawl\necho quit | nvidia-cuda-mps-control\n```\n\nThe defaults are the published configuration; [`xmimic\u002Fconfig.py`](xmimic\u002Fconfig.py) lists every option. `train.py` sets\n`XLA_FLAGS=--xla_gpu_enable_triton_gemm=false`, 90 % GPU memory preallocation and a persistent compilation cache in\n`~\u002F.cache\u002Fxmimic\u002Fjax` unless you set them yourself (`JAX_COMPILATION_CACHE_DIR` moves the cache). The programs of a\nconfiguration compile in parallel threads before the training clock starts, which takes about 2 to 3 minutes the first\ntime; later runs load them from the cache in about 20 seconds.\n\nOther tools:\n\n```bash\npython tools\u002Fmake_figures.py                     # the figures and tables above, from results\u002F\nJAX_PLATFORMS=cpu python tests\u002Ftest_fast_equiv.py  # fast learner vs reference, on the CPU (a few minutes)\npython tools\u002Frollout_cpu.py runs\u002Fawlp\u002Fckpt_002000.npz --out rollout.npz   # play a policy on the CPU\npython tools\u002Frender_gif.py rollout.npz           # the GIF above\n```\n\n## Faithfulness and caveats\n\n- **Same algorithm.** In a side-by-side check, XMimic's training statistics (world-model loss, imagined survival,\n  simulated return, episode length) were close to BlinkMimic's at every logged iteration, and both reach the same final\n  evaluation return.\n- **Multi-GPU staleness.** In the actor-learner layouts the actor collects with a policy one iteration old, and the policy\n  learner imagines with a world model one iteration old (AWL and AWLP: two). InstantTrack v1.3 uses the same one-iteration\n  staleness on one GPU. With the critic on the world-model GPU, the critic is one more iteration old.\n- **Constraint budget.** XMimic simulates with 256 constraint rows per world instead of BlinkMimic's 500 (7 % faster per\n  physics step). In most runs a training world exceeds 256 a few times (about 6 events in 3500 iterations) and loses the\n  extra rows for that step. Evaluation uses 500.\n- **Fewer probe sweeps.** In the multi-GPU layouts a sweep runs beside training and spans more iterations than\n  BlinkMimic's in-loop sweep (about 30). A sweep that falls due while one runs is skipped, so the 4-GPU layout sweeps\n  once every 250 iterations, AL every 255 and AWL every 380, against every 125 in BlinkMimic (and in FP, FP1 and ALP).\n  It still reaches the target first.\n- **bf16.** The fast learner rounds to bf16 in different places than the reference. Its gradients stay within the\n  reference's own bf16 error and the error of torch autocast ([`tests\u002Ftest_fast_equiv.py`](tests\u002Ftest_fast_equiv.py)).\n- **Noise.** The held ×3 time of a single run can lie up to about a minute from the mean of its method, because it\n  depends on when the last hard clips stop failing. Compare means. InstantTrack and ALP have only 2 runs. Throughput\n  (it\u002Fs) is close to deterministic.\n- **Hardware.** All numbers are from H100s. The kernel-level gains target Hopper GPUs and may be smaller on others.\n\n## Repository\n\n```\ntrain.py                 entry point (--layout, all options in xmimic\u002Fconfig.py)\nxmimic\u002F                  the trainer: simulator, task, networks, the reference iteration (algorithm.py),\n                         the fast learner (fast.py), the layouts (single_gpu.py, multi_gpu.py), the evaluator\nassets\u002Fg1\u002F               the G1 scene and metadata, exported from BlinkMimic's mjlab scene (meshes are downloaded)\nresults\u002F                 per-run evaluation files behind every number and figure\nfigures\u002F                 figures and the GIF\ntools\u002F                   data download, figures, compile-time exclusion, CPU rollout, GIF, BlinkMimic interop\ntests\u002F                   CPU equivalence tests of the fast learner\n```\n\n## Acknowledgements\n\nXMimic stands on other people's work:\n\n- **[BlinkMimic](https:\u002F\u002Fgithub.com\u002Ffuyichen0725\u002Fblinkmimic)** by Fuyi Chen: the algorithm, hyperparameters, robot setup\n  and evaluation protocol that XMimic reimplements; much of XMimic is a port of its code.\n- **[InstantTrack](https:\u002F\u002Fgithub.com\u002FHuy-Quang-Dao\u002FinstantTrack)** by Huy-Quang-Dao, which BlinkMimic builds on and which\n  is our second baseline, and **[supermimic_vibed](https:\u002F\u002Fgithub.com\u002Fzita-ch\u002Fsupermimic_vibed)** by Chong Zhang (ETH\n  Zurich), the reimplementation both started from.\n- **SuperMimic** (Liao et al., arXiv:2610.28480) for the method. XMimic is an independent work, not affiliated with or\n  endorsed by the SuperMimic authors.\n- **InstantMimic** (Choi, Leem, Won, arXiv:2609.09821) for the idea of a training loop that lives on the GPU.\n- [MuJoCo](https:\u002F\u002Fmujoco.org), [MuJoCo Warp](https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fmujoco_warp),\n  [NVIDIA Warp](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fwarp), [JAX](https:\u002F\u002Fgithub.com\u002Fjax-ml\u002Fjax) and\n  [mjlab](https:\u002F\u002Fgithub.com\u002Fmujocolab\u002Fmjlab).\n- **Data.** LAFAN1 motions by Ubisoft La Forge (Harvey et al., SIGGRAPH 2020; CC BY-NC-ND 4.0) and the Unitree G1\n  description (BSD-3-Clause), via the Hugging Face dataset `lvhaidong\u002FLAFAN1_Retargeting_Dataset`. Neither is\n  redistributed here. The GIF and trained checkpoints derive from LAFAN1: non-commercial use only.\n\nLicenses and notices of the code XMimic derives from: [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).\n\n## Citation\n\nIf you use XMimic in your research, please cite:\n\n```bibtex\n@misc{bohlinger2026xmimicxsoma,\n  title  = {XMimic and XSoma: Learning Humanoid Motion Tracking and Locomotion in Under a Minute},\n  author = {Bohlinger, Nico and Peters, Jan},\n  year   = {2026},\n  url    = {https:\u002F\u002Fnico-bohlinger.github.io\u002Fpapers\u002F2026_xmimic_xsoma.pdf}\n}\n```\n\nXMimic reimplements BlinkMimic and SuperMimic, so please also cite them (see [Acknowledgements](#acknowledgements)).\n\n## License\n\nXMimic is released under the [MIT License](LICENSE). The code it derives from (BlinkMimic, InstantTrack,\nsupermimic_vibed) is MIT-licensed as well; their notices are in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). The\nLAFAN1 motions are not part of the repository, and anything derived from them (the GIF, trained checkpoints) is under\nCC BY-NC-ND 4.0: non-commercial use only.\n","XMimic 是一个面向 Unitree G1 四足机器人（实际为仿人机器人，项目中称 humanoid）的全身运动跟踪模型训练框架。它基于 BlinkMimic 的世界模型范式，使用 JAX 重实现全部组件（包括 MJX 模拟器、世界模型、策略网络与评论器），支持单机多卡（2–4 块 H100）并行训练，实现在相同超参和评估标准下，训练至目标性能所需时间缩短至原方法的 1\u002F3.7（单卡提速 1.3×，四卡仅需 0.86 分钟）。适用于机器人模仿学习、实时运动复现、低延迟策略训练等对训练效率要求严苛的研发场景。","2026-11-24 04:38:45","CREATED_QUERY"]