Embedded Code Generation with CVXPY
Maximilian Schaller, Goran Banjac, Steven Diamond, Akshay Agrawal,, Bartolomeo Stellato, and Stephen Boyd

TL;DR
CVXPYgen is a new tool that automatically generates optimized C code for solving parametrized convex optimization problems, enabling efficient embedded applications and outperforming existing code generation tools.
Contribution
The paper introduces CVXPYgen, a novel code generation tool that creates custom C solvers from convex problems specified in CVXPY, supporting embedded applications.
Findings
Outperforms existing tools in problem size handling
Produces smaller binary code
Achieves faster solve times
Abstract
We introduce CVXPYgen, a tool for generating custom C code, suitable for embedded applications, that solves a parametrized class of convex optimization problems. CVXPYgen is based on CVXPY, a Python-embedded domain-specific language that supports a natural syntax (that follows the mathematical description) for specifying convex optimization problems. Along with the C implementation of a custom solver, CVXPYgen creates a Python wrapper for prototyping and desktop (non-embedded) applications. We give two examples, position control of a quadcopter and back-testing a portfolio optimization model. CVXPYgen outperforms a state-of-the-art code generation tool in terms of problem size it can handle, binary code size, and solve times. CVXPYgen and the generated solvers are open-source.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Advanced Multi-Objective Optimization Algorithms · Software Testing and Debugging Techniques
