Scaly: an Optimizing Compiler for Optimal Control
eess.SY, cs.SY, math.OC
Submitted: 2026-10-30
Updated: 2026-10-30
Code: https://github.com/PREDICT-EPFL/scaly
License: http://creativecommons.org/licenses/by/4.0/
The gist: We present Scaly, an open-source optimizing compiler for optimal control, written in Python, that generates fast C code.
Terminology
Abstract
We present Scaly, an open-source optimizing compiler for optimal control, written in Python, that generates fast C code. Scaly provides a modeling language embedded in Python for the parametric optimization problems that arise in model predictive control and moving horizon estimation, and computes the sparse derivatives that standard optimization solvers need. Scaly accepts general nonlinear programs but applies optimizations specific to optimal control, which preserve the repeated structure of a problem, such as the stages of a horizon, through differentiation down to the generated loops. The generated C depends only on the C math library and never allocates memory dynamically. On three benchmark problems, Scaly evaluates the Hessian of the Lagrangian up to 26 times faster than CasADi, with smaller binaries and build times that stay nearly constant with the horizon. With the same solver, Scaly shortens the solver time per control step on every benchmark, by a factor of up to 9.
Sources
- MLIR: A Compiler Infrastructure for the End of Moore's Law
- System Identification for Dynamic Modeling of Large Steering Angle Vehicles
Related papers
- Industrial Load Modeling and Optimization for Market-Based Interaction with Power Systems
- Exact and Approximate Convex Reformulation of Linear Stochastic Optimal Control with Chance Constraints
- Certified Set Convergence for Piecewise Affine Systems
- Symbolic Control for Stochastic Systems via Finite Parity Games
- Multiobjective optimization-based design and dispatch of islanded, hybrid microgrids for remote, off-grid communities in sub-Saharan Africa
- Physiology-informed layered sensing for intelligent human-exoskeleton interaction