Skip to main content

mjbatch

mjbatch is a Python library for running thousands of MuJoCo simulations in parallel on CPU.

Features include:

  • C++ thread pool execution, with the GIL released;
  • Live array access to simulation state and controls across the batch;
  • Per-simulation model parameters, with set_const to recompute derived constants.

For example:

import mujoco, numpy as np
from mjbatch import Batch

model = mujoco.MjModel.from_xml_path("scene.xml")
batch = Batch(model, num_sims=4096)  # threads default to every logical CPU
qpos, ctrl = batch.bind("qpos"), batch.bind("ctrl")
batch.expand("geom_friction")[:, :, 0] = np.random.uniform(0.4, 1.2, (4096, 1))
for _ in range(1000):
  ctrl[:] = policy(qpos)             # your controller, all 4096 at once
  batch.step()                       # step them in parallel; qpos updates in place

Examples

We showcase a range of applications built using mjbatch: RL, MPC, SysID, and hardware co-design. Each example is a self-contained, performant implementation. For instance, the Go1 RL controller learns to walk in under a minute on a five-year-old M1 laptop.

cart-pole swing-up cart-pole MPC
A two-pole cart swung upright with iLQR A cart-pole swing-up controller using predictive sampling
G1 backflip Go1 joystick
A G1 humanoid tracking a reference backflip with receding-horizon iLQR A Go1 quadruped joystick controller trained with PPO
throwing arm co-design Rizon inertia identification
CEM jointly optimizes a robot arm's proportions, gears, and controls Damped Gauss–Newton fits a Rizon arm's inertial parameters to synthetic motion data

Run with uv run examples/<file>.py; some need uv sync --group examples. The ones that open a window need a display; --headless runs the solver without one.

License

Apache-2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mjbatch-0.1.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mjbatch-0.1.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (155.0 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

mjbatch-0.1.0-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (147.1 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

mjbatch-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl (128.8 kB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

mjbatch-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (153.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

mjbatch-0.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (145.3 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

mjbatch-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (126.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

mjbatch-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (153.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

mjbatch-0.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (145.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

mjbatch-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (125.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

mjbatch-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (153.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

mjbatch-0.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (145.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

mjbatch-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (125.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mjbatch-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (154.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

mjbatch-0.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (146.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

mjbatch-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (126.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mjbatch-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (154.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

mjbatch-0.1.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (146.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

mjbatch-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (126.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file mjbatch-0.1.0.tar.gz.

File metadata

  • Download URL: mjbatch-0.1.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mjbatch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eb02edd3f61c3f9a593ddec61e0cebefa248fa186a841a820df5b4d030b07a48
MD5 ca61025d25fd2bd1591b1f716d852a49
BLAKE2b-256 7815ad8267e88d46f7fe4f543604035915ece7268fe76b6ac1bbc230bf0ee4b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0.tar.gz:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b7692c8c328f443b7ce1bca76eef00326dafccff3dacdb5d6e9dfcda695f7575
MD5 4c71a989fcc30197182c7c0b543976e5
BLAKE2b-256 2a023c1dd5e0c9f6e0ade7fb245db11f7db3bc1692b0ce3503b66e97d482feed

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 54e7deb7922a69147efd62afa8e44bda062ec39fba599a0e7e6b8041ccac77f7
MD5 77237a29741d0206d85242d6c6ff2920
BLAKE2b-256 fc5b6482ec6b5943927032a50b8d0141e638e016b2a2d0cb16de27a411b446cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d8567522363a582bbbe46f9d97904d53578382540d916e9d7efde7044f5e48e
MD5 2d016608911826c8ddcc3172c168da56
BLAKE2b-256 43868889c98fa2c85c5583a685877549fde35c141e118b9eb949a4a907c5af27

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9c7b9d3642f3b7eae696dfc11af9722c8a2770855522fffc7600ba4988c7ec5c
MD5 324c85d980ada2424db736b0bf27e53c
BLAKE2b-256 765f01af3e86eeb4f50d1ec81037c4075b6d48dff76799afb88b7e39b1b3fae0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5b078a8587a0f7808ee4d7cd0689bed6b0f682458209ca47347aa6c028374e90
MD5 084d43cb9371fed4c68eeeb608dd477d
BLAKE2b-256 76bf1f402267232694c0c3d4713a7860a087907c6c41c8d036c2e7429d72cedd

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 add1be91776a3be790a1a2976ca3fdb4f409d1714943588d2575330ef4e14b79
MD5 00690a6e16ce978d5394d0cd4c4382f1
BLAKE2b-256 2ac880abe575701e65406a2a70906a96e22ed71670aed538a6777a1d82db34d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d788155e37df6e0cc3cfab06b05161400b7a55dc54ef7a40f9c3d83ab414c9d3
MD5 112bf6076957c3e5d32cda760d9c6075
BLAKE2b-256 b71f6cd4de8c0a3f62e68f0fc7ea9b9e68a9064ba597ab4a1efc9df0789c2f2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c61415dd1f597c00ea01a42fb10c71a3de19d27e94a8f491148c4b42f279e1f8
MD5 85432535b90a430dd099467342e2da31
BLAKE2b-256 4c25b047bd840b9c27a5d215bac0456fde04b93a16c49446e0935dfbd8ffc482

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 137c62d8ed20b60d7d23d070cc50591d59aaf6f379ded38e8d8759477921ce29
MD5 ccadd3fbb73a8033675ecd8acd86c25d
BLAKE2b-256 3e66b5e7df60be0ef66be8a86a756e6f4e3efb7828791eb850daf4f10bb304ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 02efee795e12473789ad299c08cc258b1f894c102c98099bbcca406d4e46e729
MD5 4bf6ecb80ee1cd9b1442447cc08459cd
BLAKE2b-256 b417014fd658e804bdc8c28941607ce7875ef167a935abcab9a0d933ce743628

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 acc5f2521406a10d512f1c1e5b681e88bc71f388236faa0c75fd13611a8f5fc4
MD5 c37599ab9c54024b2c21763d6fb702be
BLAKE2b-256 ce51005dafea76aaea6eda724cdbfc571b4ed30377d9d46352d3752f67142b11

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 95987a757f5e5ba9c410f36b93540767d3a403d266ebbd4c2f4496a3ed18804c
MD5 f48152116a707e97c5c8b737f1a3ee50
BLAKE2b-256 a565cda1c6a7b92625876f76787682b60d736bd3b27f1f948c2a3237bf00d6f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 761ab53e0ed8493f7d18c1b9b5c35775c9c2843601251b0069a2aba823a44914
MD5 319b467c08630f7e370ff3b35ea62e3f
BLAKE2b-256 71bf7337e46c814d31bd5a33e73f48f68581112b035515d5204a2000da080688

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fc49bea54614f9c4a8437a1bde062f779ec1d24be633665d9f3a79c29329d7a6
MD5 c89c3bc7a1f37af151976716d41c0a69
BLAKE2b-256 d07412b19f06909f3468b58448063328e3e8928556a45f94478fdba8a93657dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 886d0bffb3a5c0f57e776d78885e36eac39f800a3ee417475993d7594f9e42d6
MD5 6f9fbc9c083f2e8abf54fffd77f3f8fa
BLAKE2b-256 bc18fbcf1ed65d61d6a57200072bc83628fc1881f26db0c82903afc627ffbe80

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5750d00b0cd22cc22c40c773aced30c2aaaf2f04884af97bf6b2cdc2402c053f
MD5 80741f9868d0e92fa484d1b2924f0287
BLAKE2b-256 c0e0079b26bf3ab76f60d749619d0870eb1991a16260f2d8dd1405913a44da81

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5be00d533b4a2aac6a0be14c2508a62ca0e5e03d78d978aa20edb896d4f10eb1
MD5 5b9abab17df94bb2a540b3d61feece20
BLAKE2b-256 c07b52d5d0489d6209c45159f8b665debd656685d6dc05c9ba5405401b658065

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mjbatch-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mjbatch-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5f49f2a07b233992078183ea79381bb07611299a8ec48eec4a0abcb0a2150606
MD5 6874b0bef05cd87776ccf3a30309dc5f
BLAKE2b-256 e2d0fdcd4ca3909266426b78756a23664ca70050dffb833d67e368a11bfff9b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mjbatch-0.1.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: ci.yml on kevinzakka/mjbatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

19 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page