Batched Differentiable Rigid Body Dynamics in PyTorch for GPU-Accelerated Robot Learning

Yue Wang, Yanran Xu, Wenbo Wu, Chuanhang Qiu, Zhaoxing Li · 2026

Read Batched Differentiable Rigid Body Dynamics in PyTorch for GPU-Accelerated Robot Learning by Yue Wang, Yanran Xu, Wenbo Wu, Chuanhang Qiu, Zhaoxing Li (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-31481.txt.

Introduction

Wang and colleagues present BARD, a self-contained PyTorch version of Featherstone's rigid-body dynamics algorithms for batched GPU use with automatic differentiation. CPU-bound tools slow GPU robot training, so BARD uses a lazy cache, matmul-free joint transforms, and level-parallel propagation. On five robot models it matches the Pinocchio library numerically while reaching up to 64 times its throughput for forward kinematics at batch size 4096, and runs 8.5 times faster in a live robot-learning pipeline.

Catalog record

CREATORYue Wang, Yanran Xu, Wenbo Wu, Chuanhang Qiu, Zhaoxing Li
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE36257
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.31481

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Batched Differentiable Rigid Body Dynamics in PyTorch for GPU-Accelerated Robot Learning Yue Wang, Yanran Xu, Wenbo Wu, Chuanhang Qiu, Zhaoxing Li Abstract As robot control shifts toward large-scale reinforcement learning with in-loop dynamics computation, the community’s reliance on CPU-bound libraries such as Pinocchio creates a throughput bottleneck in GPU-based training pipelines. We present bard ( B atched A rticulated R igid-body D ynamics), a self-contained PyTorch implementation of Featherstone’s rigid-body dynamics algorithms, optimized for batched GPU evaluation and automatic differentiation. Three design choices make this efficient: a tiered lazy-evaluation cache that avoids redundant tree traversals, matmul-free joint transforms via pre-computed Rodrigues constants, and level-parallel propagation that reduces sequential operations to tree-depth batched steps. On five robot models (7–23 DOF), bard matches Pinocchio numerically while reaching up to 64 × 64\times higher throughput for Forward Kinematics and 63 × 63\times for Jacobians at batch size 4096 on an NVIDIA H200. We validate differentiability through gradient-based system identification on a 7-DOF manipulator, recovering link masses to 1.24 % 1.24\% mean error under 5 % 5\% torque noise, and integrate bard into an Isaac Lab AMP training pipeline for an 11-DOF spined quadruped with 4096 parallel environments, where it is 8.5 × 8.5\times faster than Pinocchio and 2.0 × 2.0\times faster than ADAM for in-loop dynamics. bard is open-sourced at: https://github.com/YueWang996/bard-pytorch-dynamics . 1 Introduction With the increasing complexity of both robot structures [ 1 , 26 , 32 , 10 ] and deployment environments [ 31 , 22 , 16 , 28 , 12 ] , control techniques have shifted from trajectory optimization [ 25 ] to large-scale reinforcement learning [ 21 , 9 ] to achieve more generalizable behavior. To reduce exploration in high-dimensional action spaces, rigid-body dynamics can be included in the training loop as a guide. For example, they can serve as differentiable models for gradient-based system identification [ 11 ] , or as analytical operators (Jacobians, inverse dynamics) within physics-informed reward and constraint formulations [ 11 ] . These applications need standalone dynamics operators (e.g. a Jacobian or mass-matrix call) that can be embedded in a custom loss function, not a monolithic simulator whose internals are inaccessible. Current RL training frameworks such as Isaac Lab [ 14 ] and MuJoCo Playground [ 29 ] use a PyTorch [ 18 ] backend with batched GPU execution for efficiency; however, the community’s standard dynamics library, Pinocchio [ 3 ] , is CPU-bound and sequential, neither exploiting GPU parallelism nor avoiding the CPU–GPU data transfer overhead introduced at every call. Existing GPU alternatives like Brax [ 7 ] and MuJoCo MJX [ 29 ] provide high throughput but are tied to non-PyTorch ecosystems (JAX), making them hard to integrate into PyTorch training loops. Differentiable off-the-shelf dynamics libraries such as ADAM [ 13 ] sacrifice GPU throughput for backend generality (see Section 2 ). A native, high-performance, modular dynamics library for batched GPU evaluation within PyTorch is still missing. We present bard ( B atched A rticulated R igid-body D ynamics), a pure-PyTorch library implementing Featherstone’s robot dynamics algorithms [ 5 ] , designed for batched GPU evaluation. While Featherstone’s algorithms are well established, their inherently serial tree traversals resist parallelisation, making them hard to deploy in modern RL training pipelines. We address this by reorganizing traversals into level-parallel batched operations and adding a multi-tier lazy-evaluation cache that skips redundant computation across successive calls. The entire code path is compatible with torch.compile , allowing the PyTorch compiler to fuse the resulting operator graph. On an NVIDIA H200 at batch size 4096, bard is up to 64 \times faster than a sequential Pinocchio baseline for forward kinematics (FK) and Jacobian evaluation. We test bard on gradient-based system identification of a 7-DOF manipulator and inside an Isaac Lab RL pipeline for the SPARC quadruped [ 26 ] , where bard achieves 8.5 \times higher throughput than Pinocchio and 2 \times higher than ADAM for in-loop dynamics computation. Our contributions are: 1. bard , an open-source, pure-PyTorch dynamics library for batched GPU evaluation. 2. Systems-level techniques for running recursive tree computations on GPUs, including a kinematics cache, pre-allocated workspaces, and level-parallel propagation. 3. Validation on gradient-based identification and large-scale RL training with 4096 parallel environments. 2 Related Work We review CPU dynamics libraries, GPU simulators, and differentiable dynamics tools, focusing on why each falls short for batched PyTorch workloads. Pinocchio [ 3 ] is the standard for Featherstone’s spatial-vector algebra algorithms [ 5 ] , offering highly optimized single-threaded C++ routines and analytical derivatives [ 2 ] . RBDL [ 6 ] and Drake [ 23 ] provide similar CPU-based functionality, and downstream frameworks such as Crocoddyl [ 15 ] build on these libraries for trajectory optimization. Although these libraries provide excellent performance for single-robot configurations, they suffer from two problems when embedded in GPU training loops. First, their sequential execution model requires looping over environments one by one, leaving GPU cores idle. Second, calling a CPU library from a PyTorch pipeline forces a CPU–GPU data transmission at every evaluation; this overhead grows linearly with batch size and quickly becomes a training bottleneck. To improve throughput, frameworks such as Brax [ 7 ] , MuJoCo MJX [ 29 ] , and Isaac Gym [ 14 ] move the entire simulation onto the GPU, achieving efficient training via massive parallelism across robots. However, they are architected as monolithic end-to-end simulators that bundle contact detection, time integration, and dynamics into a single pipeline. This design makes it difficult to extract a standalone operator. For instance, when only a subsystem’s dynamics is required (such as a robot arm mounted on a quadruped), an RNEA call for gravity compensation or a CRBA call for mass-matrix analysis cannot be obtained from these simulators, and therefore cannot be embedded in a custom loss function or controller to regulate that subsystem’s behavior. Beyond modularity, ecosystem compatibility is a concern: MJX is built on JAX, which precludes native integration into the PyTorch training loops used by Isaac Lab and similar frameworks. DiffTaichi [ 8 ] achieves high-performance differentiable simulation but likewise requires a programming model distinct from standard PyTorch workflows. Recent efforts have attempted to provide modular, differentiable dynamics operators within PyTorch, but they often face performance trade-offs at scale. ADAM [ 13 ] supports multiple backends (CPU, GPU, JAX) through a shared abstraction layer, but this generality prevents PyTorch-specific optimizations such as kernel fusion and compile-time graph capture, and its throughput falls well below hardware capacity at large batch sizes. PyTorch-Kinematics [ 30 ] provides batched FK and Jacobians in PyTorch but omits core dynamics algorithms (RNEA, CRBA, ABA). GRiD [ 20 ] delivers high-performance GPU dynamics with analytical gradients, yet relies on generated CUDA kernels outside the Python autograd ecosystem, raising the integration barrier for typical PyTorch research code. Other efforts either target single-configuration workloads rather than batched training [ 17 ] , or predate modern GPU-accelerated RL pipelines altogether [ 4 , 27 ] . To our knowledge, existing tools have not been designed with torch.compile compatibility in mind, and data-dependent control flow in their implementations causes graph breaks that prevent the PyTorch compiler from fusing operations across the computation graph. 3 Methodology Figure 1: Architecture of bard . A URDF

Read the complete text