Teach a simulated humanoid 40 motions in 22 minutes, on a MacBook.
A simulated Unitree G1 humanoid learns to copy 40 human motion-capture clips, from walking and sprinting to dancing, getting up off the floor and a cartwheel, on a MacBook Pro (M4 Pro). MuJoCo simulates 4,096 robots on the CPU while MLX trains the networks on the GPU. No CUDA, no cloud, MIT licensed.
Time to the benchmark target
The target: each of the 40 clips is played from its first frame to its last, and the robot must score at least 0.82 on average (1.0 is a perfect copy of the motion) without failing any clip (failing means falling or straying from the motion: the pelvis more than 25 cm above or below the reference's, or the torso tilted far from it). This has to hold at three checkpoints in a row, 100 training iterations apart; the time shown is the first of the three. All runs used the same MacBook and the same simulator, rewards and evaluation.
MacMimic reaches the target 2.04 times faster than the BlinkMimic port and at least 2.6 times faster than the XMimic port.
How it works
MacMimic is BlinkMimic's algorithm (SuperMimic's method, refined), run with XMimic's overlap of simulator and learner, and tuned for a Mac. The idea: first learn a model of the robot's physics, then improve the policy by differentiating through that model. One training iteration, about 0.9 seconds, runs these three steps:
-
Simulate
4,096 copies of the G1 run in MuJoCo on the CPU cores, each following a stretch of one clip with the current policy. Every step is stored.
-
Learn the physics
A neural network, the world model, learns to predict the robot's next state from its current state and motor commands, trained on the stored steps on the GPU with MLX.
-
Learn the motion
The policy plays 32 steps (0.64 s) ahead inside the world model and is improved by backpropagating the tracking error through them; a second network, the critic, estimates how the motion goes on after that.
The CPU and the GPU work at the same time, on separate threads, sharing the Mac's unified memory. Every 60 iterations, a probe also plays all 40 clips with the current policy, in 12-second windows, to find where it fails; afterwards, 30% of the robots' restarts begin just before those spots.
What made it fast
From the BlinkMimic port's 44 minutes to 29 with the first version, then to 22. The changes that held up across runs:
| Change | Effect |
|---|---|
44 to 29 minutes: the first version (--preset macmimic_v1) | |
| Simulator and learner run at the same time on separate threads (XMimic's idea); bf16 matrix math where this GPU runs it faster | 0.61 to 0.65–0.76 iterations per second for the same algorithm |
| Policy batch of 1,024 samples instead of 2,048 | 38% less time per iteration for about 200 more iterations: faster overall |
| Probes from iteration 400 instead of 1,000, every 60 iterations instead of 125, on a worker thread | failing clips are found and practised earlier, without stalling the GPU |
| Learning-rate decay from iteration 1,100 instead of 1,400 | recovers about 100 iterations of the smaller batch's deficit |
| Policy averaged over the last ~100 iterations (0.99) instead of ~200 | fewer clips failing late in training |
| Rotation math unrolled into fusable operations; next batches gathered while the GPU is busy | a policy update about 4% faster, and 2.5% more iterations per second |
29 to 22 minutes: MacMimic (--preset macmimic) | |
| The world model trained at 8 times the learning rate | it learns the physics faster; failing clips are cleared about 300 iterations earlier, at no extra cost |
| 3 world-model updates per iteration instead of 5 | enough at that learning rate: 19% less time per iteration |
| From iteration 400, a policy batch of 1,280, with 10% of the imagined rollouts started where the probes found failures | uses the GPU while the CPU runs the probes; the hardest clip, a cartwheel, is learned earlier |
| Learning-rate decay from iteration 800 instead of 1,100 | the score rises about 100 iterations earlier |
| LayerNorm on bf16 activations | about 3% more iterations per second |
The experiments that did not help are recorded too, more than 100 training runs in all: what worked and what didn't.
About these numbers
- The baselines are this repository's ports of BlinkMimic and XMimic to MLX, timed on the same MacBook. This is not a comparison with the original CUDA code on an NVIDIA GPU.
- MacMimic's time is the mean of three runs with different seeds (21.0 to 22.5 minutes; the slowest alone is 1.95 times faster than the BlinkMimic port). The baselines are one run each. Between seeds, the iteration at which the target is reached varies by about 100.
- The target is a threshold, not equal quality. When each reaches it, BlinkMimic tracks a little more precisely: a score of 0.847 and 3.9 cm average body position error, against 0.822 and 4.4 cm for MacMimic. How long MacMimic needs to match BlinkMimic's precision was not measured.
- Everything here is simulation. The policy has not been run on a physical robot.
Train it yourself
git clone https://github.com/air23zj/macmimic
cd macmimic
uv sync
bash tools/download_data.sh # motion clips and robot model
uv run python tools/urdf_to_mjcf.py
bash scripts/train.sh macmimic logs/macmimic_s0 --seed 0
You need a Mac with Apple silicon, uv and curl. The full 2,000 iterations take about 30 minutes on an M4 Pro; the target is usually reached by iteration 1,400–1,500. Settings that only affect speed and memory (simulator threads, bf16 or fp32, memory limits) are chosen automatically for the Mac you run on.
The same repository trains SuperMimic, BlinkMimic and XMimic (--preset), evaluates checkpoints and
renders videos like the one above.
Built on
- BlinkMimic the algorithm and presets ported here (MIT)
- SuperMimic the method, Liao et al. 2026 (Apache-2.0)
- XMimic running the simulator and the learner at the same time
- supermimic_vibed and InstantTrack code BlinkMimic builds on (MIT)
- MuJoCo physics simulation, on the CPU
- MLX the world model, policy and critic, trained on the GPU
- LAFAN1 by Ubisoft La Forge, G1 by Unitree motions (CC BY-NC-ND 4.0) and robot model (BSD-3-Clause)