Principle:Google deepmind Mujoco MJX Model Transfer
| Knowledge Sources | |
|---|---|
| Domains | GPU_Computing, Physics_Simulation, JAX |
| Last Updated | 2026-02-15 06:00 GMT |
Overview
Process of converting a CPU-resident MuJoCo model into a JAX-compatible representation on a GPU or TPU device.
Description
MJX Model Transfer takes a standard mujoco.MjModel object and converts it into an mjx.Model — a JAX pytree containing all model parameters as JAX arrays on the target device. This enables the model to be used with JAX transformations (jit, vmap, grad). The transfer supports multiple backends: JAX (pure functional), Warp (NVIDIA CUDA kernels), C (C FFI), and CPP.
Usage
Use after loading a model on CPU with mujoco.MjModel.from_xml_path. The returned mjx.Model is used with mjx.step and other MJX functions. The model is immutable and can be shared across batched simulations.
Theoretical Basis
The transfer involves converting C struct arrays into JAX device arrays:
- Extract all numerical arrays from the C mjModel struct
- Convert each to the appropriate JAX array dtype
- Place arrays on the target device (GPU/TPU/CPU)
- Wrap in an mjx.Model pytree for JAX compatibility