Skip to main content

NablaEngine

Thousands of worlds per call on one GPU, with analytic gradients for learning, control and system identification, aligned with MuJoCo.

Pronounced "Nabla Engine".

News

  • 2026-11-28, 1.0.5: the PyTorch and MLX interfaces on Apple GPUs (Metal, experimental; docs/api_torch.md), per-world actuator gains on the forest engine, fixes.
  • 2026-11-23, 1.0.2: on PyPI: pip install nablaengine.
  • 2026-11-23, 1.0.1: Pollen Robotics' Microduck with BAM servo checks (#3), and an overview of the supported scenes.
  • 2026-11-22, 1.0.0: the forest engine (several trees, motors, meshes, equality constraints, tendons, noslip), per-world parameters, dynamics queries, the BAM servo model, and DeepMind Control Suite / Brax tasks.
  • 2026-11-07, 0.2.0: other legged robots (Unitree Go1, Go2, A1 and H1 (#1), ANYbotics ANYmal C, Boston Dynamics Spot, Booster T1, ROBOTIS OP3, Berkeley Humanoid; docs/robots.md) and terrain: boxes, heightfields and a height scan (docs/terrain.md). The G1's results are unchanged.
  • 2026-10-31, 0.1.0: first release: the Unitree G1.

All release notes: Releases, CHANGELOG.md.

Forward step: NablaEngine 1.21 ms per control step, against MuJoCo Warp, Genesis, Isaac Lab, MJX and MuJoCo C

A step and its gradient: NablaEngine 1.78 ms, MuJoCo Warp with its adjoint pull request 20.5 ms

Time per PPO iteration: NablaEngine 0.123 s, MuJoCo Warp 0.355 s

One 20 ms control step for 4096 Unitree G1 worlds on one NVIDIA RTX PRO 6000 (forward, and forward with the gradient from the input state), and one PPO iteration (4096 environments x 24 steps, plus 20 gradient steps) with the same configuration, on the G1 engine (DK_ENGINE=tree; the forest engine, the default since 1.0.0, is measured against it in docs/engines.md). MuJoCo Warp and MJX simulate the same model (medians over 3 processes, docs/results/paper_rtx6000/paper_bench.md); Isaac Lab runs its own G1 asset with its task defaults (median over rounds, docs/results/physx_rtx6000/physx_bench_results.md). Other GPUs (H100, RTX 3090, V100): the project page.

NablaEngine is a differentiable GPU physics engine, built first for the Unitree G1 humanoid and since 1.0.0 for a wider class of MuJoCo models. It simulates thousands of worlds per call with MuJoCo's physics and returns analytic gradients of every step with respect to the state and the actions, for first-order policy learning, trajectory optimization and system identification. It plugs into JAX (jax.jit, jax.grad, lax.scan) and PyTorch (torch.autograd, CUDA graphs, torch.compile) as a differentiable function, with bitwise the same results in both.

  • Fast. One control step of 4096 worlds in 1.21 ms, its gradient in 1.78 ms, and the full 71x99 Jacobian of the step in 9.7 µs per world (RTX PRO 6000, the G1 engine).
  • Exact. Against float64 MuJoCo on 16,384 held-out states: forward median relative error 8.5e-7, gradient median relative errors 3.6e-5 / 1.0e-5 / 1.9e-6 (qpos / qvel / ctrl) against float64 finite differences (docs/results/paper_accuracy_heldout_v100.md).
  • Deterministic. Outputs and gradients are bitwise identical from run to run.

Used by. ∇Mimic (NablaMimic), whole-body motion tracking learned with the engine's simulation gradients.

Paper. ∇Mimic: Ultra-Efficient Humanoid Control with Differentiable Simulation (project page)

Scope

Two code generators share one interface; the engine is picked from the model (docs/engines.md):

  • Forest engine (default): several kinematic trees, hinge and slide roots, motors and affine actuators, Euler and implicitfast, up to 64 bodies; planes, spheres, capsules, boxes, cylinders, ellipsoids and convex meshes; equality constraints and fixed tendons; noslip; per-world parameters; dynamics queries; the DeepMind Control Suite and Brax tasks (nablaengine.envs).
  • G1 engine: one free tree with position servos (the mjlab G1 and the robots of docs/robots.md); select it with DK_ENGINE=tree or engines.prefer_tree(m).

Both run MuJoCo's Newton solver in float32 with analytic gradients, terrain builds (docs/terrain.md) and the BAM servo model (docs/actuators.md). Experimental features are listed in CHANGELOG.md. Unsupported models are rejected with an error that names the missing features.

Requirements: Linux x86_64, an NVIDIA GPU of compute capability 7.0 or newer (tested: V100, RTX 3090, H100, RTX PRO 6000), Python 3.12, and a CUDA 12.x toolkit (nvcc) for the one-time build of the CUDA library (about 15 s, cached).

Apple silicon (experimental): on macOS 14 or later on arm64, nablaengine.torch_ffi runs on the Mac's GPU through Metal, selected automatically (DK_BACKEND=cuda|metal overrides). It needs the Command Line Tools (xcode-select --install) and pip install "nablaengine[torch,dmc]" (dmc: the DeepMind Control Suite tasks; one command, so that pip keeps the mujoco version the package needs); python -m nablaengine.metal.check checks the installation. nablaengine.mlx_ffi gives the same step on MLX arrays (nablaengine[mlx], no PyTorch needed). The JAX interface is CUDA only. Details: docs/api_torch.md, "Apple GPUs (Metal)".

What you can simulate

  • Humanoids on mixed terrain: the Unitree G1 and other humanoids on stairs, steps, boxes and rough heightfields, with a height scan and moving platforms (docs/terrain.md, docs/robots.md). Motion tracking built on the engine: ∇Mimic.
  • Humanoid-object interaction and loco-manipulation: humanoids and arms with free objects in one scene (forest engine): contacts with boxes and convex meshes, per-world objects, contact forces and distance queries with gradients (docs/engines.md, docs/api.md; example scene scripts/forest/models/g1box.xml).
  • Legged robots: Unitree Go1, Go2, A1 and H1, ANYmal C, Spot, Booster T1, OP3, Microduck and others (docs/robots.md, scripts/robots/).
  • Control benchmarks: DeepMind Control Suite and Brax tasks (nablaengine.envs, docs/envs.md).
  • Actuator models: the BAM servo model and torque-speed limits (docs/actuators.md).
  • Experimental: models with up to 128 dofs, spatial tendons and muscles (docs/engines.md, docs/equality.md).

Installation

From PyPI (Linux, Python 3.12, an NVIDIA GPU):

pip install "nablaengine[jax,cuda]"   # the JAX interface, with JAX's CUDA 12 plugin
pip install "nablaengine[torch]"      # the PyTorch interface (on a V100 the cu126 wheels of torch)

The CUDA library is compiled on first use, so a CUDA 12.x toolkit is needed as well (nvcc on PATH, or NVCC=/path/to/cuda-12.x/bin/nvcc). The package includes the G1 model and the corpus of the quick start; the checks, the scripts and the other robot models need a checkout:

git clone https://github.com/sailab-ai/NablaEngine.git NablaEngine && cd NablaEngine
scripts/setup_env.sh               # a Python 3.12 environment in .dk_env/ with the tested versions
source .dk_env/activate.sh
scripts/verify.sh --quick          # checks the installation in a few minutes

For PyTorch, add it to that environment and build the engine's library once (docs/api_torch.md):

pip install torch                  # a CUDA 12 build; on a V100 the cu126 wheels
python -m nablaengine.torch_ffi build

Options, a PyTorch-only environment, a manual installation and the packaged files: docs/install.md.

Quick start

JAX:

import jax
import jax.numpy as jnp

from nablaengine import fixtures, jax_ffi

jax_ffi.init()                         # builds the CUDA library on first use, then loads it from the cache
z = fixtures.load_corpus("mf_s0")      # 4096 states of the G1
B = 256
qpos, qvel, warm, ctrl, friction, com = (jnp.asarray(z[k][:B]) for k in
                                         ("qpos", "qvel", "qacc_warmstart", "ctrl", "friction", "com"))

qpos1, qvel1, warm1 = jax_ffi.step(qpos, qvel, warm, ctrl, friction, com)  # one control step: 4 substeps of 5 ms


def loss(ctrl):
    q, v, _ = jax_ffi.step(qpos, qvel, warm, ctrl, friction, com)
    return jnp.sum(v ** 2)


g = jax.jit(jax.grad(loss))(ctrl)      # through the analytic adjoint

PyTorch (no JAX needed):

import torch

from nablaengine import fixtures, torch_ffi

device = "cuda" if torch.cuda.is_available() else "cpu"   # an Apple silicon Mac: CPU tensors, the GPU through Metal
torch_ffi.init()                       # loads the library built by `python -m nablaengine.torch_ffi build`
z = fixtures.load_corpus("mf_s0")
qpos, qvel, warm, ctrl, friction, com = (torch.from_numpy(z[k][:256]).to(device) for k in
                                         ("qpos", "qvel", "qacc_warmstart", "ctrl", "friction", "com"))
ctrl.requires_grad_()
qpos1, qvel1, warm1 = torch_ffi.step(qpos, qvel, warm, ctrl, friction, com)
(qvel1 ** 2).sum().backward()          # ctrl.grad through the analytic adjoint

Inputs are float32 arrays with the worlds as the leading dimension: qpos (B, 36), qvel (B, 35), the solver's warm start warm (B, 35), the position targets ctrl (B, 29), and per-world foot friction (B,) and torso centre-of-mass offset com (B, 3) for domain randomization. By default each world holds up to 64 contacts and 192 constraint rows (init(max_contacts=, max_rows=) raises them); a world beyond them (e.g. deep interpenetration after a fall) drops the extra ones and is flagged and counted (docs/api.md, Diagnostics, Capacity).

Documentation

  • docs/api.md: the JAX interface: options, gradient modes, kinematics outputs, rollouts with lax.scan and jax.checkpoint, diagnostics.
  • docs/api_torch.md: the PyTorch interface: the build artifact, CUDA graphs, torch.compile, several GPUs, Apple GPUs (Metal).
  • docs/engines.md: the two engines: which model goes where, what each supports, measurements.
  • docs/equality.md: equality constraints, fixed and spatial tendons, muscles (forest engine).
  • docs/envs.md: the DeepMind Control Suite and Brax tasks and the MuJoCo model converter.
  • docs/robots.md: other robots: exporting and checking a model, accuracy and timings.
  • docs/terrain.md: terrain builds: boxes, heightfields, the height scan.
  • docs/sensors.md: per-world objects, their geometry per world (object_geometry), and the G1's sensors (depth, segmentation, RGB, LiDAR, height scan, IMU) with their gradients.
  • docs/verification.md: what scripts/verify.sh checks, against which references.
  • docs/actuators.md: the BAM servo model.
  • docs/configuration.md: environment variables and build switches.
  • docs/orin.md: build notes for Jetson Orin (sm_87).
  • benchmarks/README.md, scripts/paper_bench/README.md: reproduce the accuracy tables and the timings.

Licence

Apache License 2.0 (LICENSE), Copyright 2026 The NablaEngine Authors. NOTICE and THIRD_PARTY_NOTICES.md list the code derived from MuJoCo Warp and MuJoCo (Apache-2.0) and the model, which is derived from MuJoCo Menagerie's Unitree G1 (BSD-3-Clause, fixtures/mjlab/LICENSE) with mjlab's configuration (Apache-2.0).

Citation

A paper reference will be added here. Until then, please cite the software (CITATION.cff):

@software{nablaengine,
  title  = {NablaEngine: fast and exact differentiable physics simulation for embodied AI},
  author = {{The NablaEngine Authors}},
  year   = {2026},
  url    = {https://github.com/sailab-ai/NablaEngine}
}

Metadata

Release files for nablaengine 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nablaengine 1.0.5
File Size Uploaded Provenance Actions
nablaengine-1.0.5.tar.gz 11.1 MB With provenance Details for nablaengine-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nablaengine 1.0.5
File Interpreter ABI Platform Actions
nablaengine-1.0.5-py3-none-any.whl Python 3 none any Details for nablaengine-1.0.5-py3-none-any.whl

Total release size: 22.2 MB

Release files / nablaengine-1.0.5.tar.gz

Download URL nablaengine-1.0.5.tar.gz
Size 11.1 MB
Tags Source
SHA-256 checksum
How to use checksums
df56fe5dce04f048ff26e34bc62f76d01aefbb8f8f5a69308a2069627af43703
BLAKE2b-256 checksum
How to use checksums
b525a9ee326bdb6f566e855d4fef5e764ac450afb106dd01b47a2a79f9afd299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / nablaengine-1.0.5-py3-none-any.whl

Download URL nablaengine-1.0.5-py3-none-any.whl
Size 11.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a60e5df6fd42734dd3a63f43844d41eae104f80384ff59835c5f360734b8a1c8
BLAKE2b-256 checksum
How to use checksums
316f2b8c05831e3c59ae08b32d449e4afce948d7b666afdfd4487d7d16c95aa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for nablaengine 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nablaengine-1.0.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files Full provenance

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