google-deepmind / google-deepmind/mujoco
Causes of different behaviour in MJX and CPU MuJoCo
- Dominant language
- C++
- Stars
- 15.2k
- Forks
- 1.8k
- Avg merge
- 10d 16h
- Merged PRs (30d)
- 25
Description
I've been taking a look at MJX, and I'm impressed with how smooth the usage is. As I've been playing around more with the tutorial code on my system, I noticed how e.g. a humanoid running policy that performs great in MJX usually ends up failing eventually when transferred to CPU MuJoCo.
https://github.com/google-deepmind/mujoco/assets/41113387/a078013a-3f1c-445a-9bc8-231b91509286
(video from the "MJX Policy in MuJoCo" cell of the [tutorial](https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/mjx/tutorial.ipynb), with `rng = jax.random.PRNGKey(2)`)
This is of course not too unexpected, considering that I didn't use any domain randomization or other methods that would help with sim2sim transfer. I'm aware of this discussion about FP precision differences between MJX and regular MuJoCo: #1203. Beyond FP precision, are there other key differences in the two versions of the engine that can cause a failure to transfer policies (provided only [features](https://mujoco.readthedocs.io/en/stable/mjx.html#feature-parity) that are officially supported in both versions are used)? Are there certain settings that can be used with CPU MuJoCo to make it behave closer to MJX (or vice versa)?
Contributor guide
Assessment
This issue has not been assessed yet.