Primal-Dual iLQR for GPU-Accelerated Learning and Control in Legged Robots
Lorenzo Amatucci, João Sousa-Pinto, Giulio Turrisi, Dominique Orban, Victor Barasuol, Claudio Semini · 2025
Read Primal-Dual iLQR for GPU-Accelerated Learning and Control in Legged Robots by Lorenzo Amatucci, João Sousa-Pinto, Giulio Turrisi, Dominique Orban, Victor Barasuol, Claudio Semini (2025) 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-2506-07823.txt.
Introduction
Lorenzo Amatucci and co-authors speed up motion planning for legged robots by moving the math onto graphics chips. Their 2025 paper presents a controller that looks ahead over a horizon and picks the best moves. The core solve step is rebuilt so work spreads across both time steps and state parts at once. A scan method handles the linked system in far fewer steps than older solvers need.
Trials against two leading solvers show strong gains. Runtime improves by a large share for whole-body planning and by several-fold for a simpler body model as the horizon grows. The solver also scales well with state size. One shared controller can steer many legged robots at once within a tight time budget. Since the code runs in a learning-friendly framework, training can include the controller in the loop.
Catalog record
| CREATOR | Lorenzo Amatucci, João Sousa-Pinto, Giulio Turrisi, Dominique Orban, Victor Barasuol, Claudio Semini |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 43 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2506-07823
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Primal-Dual iLQR for GPU-Accelerated Learning and Control in Legged Robots Lorenzo Amatucci, João Sousa-Pinto, Giulio Turrisi, Dominique Orban, Victor Barasuol, Claudio Semini Abstract This paper introduces a novel Model Predictive Control (MPC) implementation for legged robot locomotion that leverages GPU parallelization. Our approach enables both temporal and state-space parallelization by incorporating a parallel associative scan to solve the primal-dual Karush-Kuhn-Tucker (KKT) system. In this way, the optimal control problem is solved in 𝒪 ( n log N + m ) \mathcal{O}(n\log{N}+m) complexity, instead of 𝒪 ( N ( n + m ) 3 ) \mathcal{O}(N(n+m)^{3}) , where n n , m m , and N N are the dimension of the system state, control vector, and the length of the prediction horizon. We demonstrate the advantages of this implementation over two state-of-the-art solvers (acados and crocoddyl), achieving up to a 60% improvement in runtime for Whole Body Dynamics (WB)-MPC and a 700% improvement for Single Rigid Body Dynamics (SRBD)-MPC when varying the prediction horizon length. The presented formulation scales efficiently with the problem state dimensions as well, enabling the definition of a centralized controller for up to 16 legged robots that can be computed in less than 25 ms. Furthermore, thanks to the JAX implementation, the solver supports large-scale parallelization across multiple environments, allowing the possibility of performing learning with the MPC in the loop directly in GPU. Note: The code associated with this work can be found at: https://github.com/iit-DLSLab/mpx . I Introduction Among the many well-known control approaches available, Model Predictive Control (MPC) has proven to be highly effective in generating and controlling complex dynamic behaviors in robotic systems, especially legged robots, as shown by [ 1 ] and [ 2 ] . At the core of an MPC is the transcription of a task we want the robot to perform into an Optimal Control Problem (OCP) and the ability to solve it fast enough to be used in a closed-loop controller. One of the most widely used methods in robotics for solving such OCP is Differential Dynamic Programming (DDP) , which gained renewed attention through the work of Todorov et al. [ 3 ] , who introduced a variant known as Iterative Linear Quadratic Regulator (iLQR) . iLQR discards the second-order terms of the dynamics in the Hessian, sacrificing the local quadratic convergence of DDP in favor of faster update rates. However, a key limitation of this method is its single-shooting nature, which requires a feasible initial guess as a starting point and often exhibits critical numerical issues. [ 4 ] overcame such limitation presenting a multiple shooting variant of the iLQR algorithm. More recently, [ 5 ] proposed a feasibility-driven multiple shooting approach to DDP with notable results also on real hardware [ 6 ] . Fig. 1 : Top left: the quadruped robot Aliengo performing a barrel roll. Top right: the humanoid robot Talos walking blindly on uneven terrain. Bottom left: an example of the massive parallelization achievable with our JAX formulation. Bottom right: Aliengo robot walking blindly on uneven terrain in a lab experiment. Another common approach to the solution of the OCP is Sequential quadratic Programming (SQP) . Compared to DDP -like algorithms, SQP has been more extensively developed for general-purpose solvers due to its flexibility in handling a broader range of constraints and objectives, as well as its robustness in dealing with infeasible iterations. Solvers like OCS2 [ 7 ] and acados [ 8 ] also showed relevant results on real hardware as demonstrated in [ 9 ] and [ 10 ] , thanks to the tailoring of the solver to the structure of OCP . Recent work like [ 11 ] highlights the connection between SQP and DDP , describing how the sparsity structure of the OCP can be exploited not only in DDP -like solvers but also in other solver types, such as SQP or interior point-based solvers. While the above methods have been shown to exploit the structure of the OCP , they have struggled to exploit new hardware accelerators like GPUs. Compared to CPUs, graphics cards can massively parallelize computation and are specifically designed for high-throughput linear algebra operations. Jeon et al. [ 12 ] tried to bridge the gap by developing Cusadi, a tool to convert expressions written in the well-known framework CasADI [ 13 ] to GPU. Cusadi only translates closed-form expressions into GPU-compatible code, lacking the branching and looping capabilities necessary for most solvers. [ 14 ] introduced a GPU accelerated Quadratic Programming (QP) solver, Relu-QP, leveraging the Alternating Direction Method of Multipliers (ADMM) algorithm, achieving performance superior to state-of-the-art CPU-based solutions. However, its applicability to Nonlinear Programming (NLP) is constrained by the need to pre-compute offline part of the algorithm. Lee et al. [ 15 ] implements an iLQR controller on GPU but only partially leverages its capabilities, limiting parallelization to the line search and gradient computation. In contrast, [ 16 ] focuses only on batching, solving multiple OCP s in parallel without exploiting state or temporal parallelism. [ 17 ] extends the approach of [ 15 ] by incorporating the temporal parallelization strategy introduced in [ 1 ] . However, [ 1 ] requires introducing approximations in the backward pass and performing a consensus sweep to maintain consistency. Särkkä et al. [ 18 ] showed how parallel associative scan operations can be utilized to improve the computational complexity of DDP . When parallelized on GPU, associative scans can compute the optimal control policy in \mathcal{O}(n\log{N}+m) instead of the \mathcal{O}(N(n+m)^{3}) of the classical Riccati Recursion found in DDP , where n and m are the dimensions of the system state and control input, and N is the prediction horizon length. In this work, we designed a SQP method that uses an associative scan-based LQR solver to solve the primal-dual Karush-Kuhn-Tucker (KKT) system efficiently. The solver avoids the offline precalculation necessary for Relu-QP [ 14 ] . Our method benefits from a multiple shooting implementation, instead of the single shooting approach presented in [ 18 ] . Our algorithm fully exploits the parallelization capabilities of GPUs both in the temporal and the state space dimensions, while maintaining, in contrast to [ 17 ] , an exact backward pass. We tailored the formulation for the deployment as a receding horizon controller for legged robot locomotion and analyzed its impact on learning and control. Control: At first, the reduction in the computational complexity of the solver may appear to have limited significance in a practical application. Some of the already described methods, like OCS2 [ 7 ] and crocoddyl [ 5 ] , have been successfully used for whole-body MPC even for experiments, as shown in [ 19 ] and [ 2 ] . To ensure that such an MPC formulation can run online on real hardware, the prediction horizon length and the number of robots that can be controlled simultaneously are constrained by the time complexity of the underlying algorithm. In particular, for solvers like OCS2, acados, and crocoddyl, the complexity scales linearly with the horizon length and cubically with the state dimension. In contrast, our approach scales logarithmically with the horizon length and linearly with the state dimension. This improved scaling