TurboMPC: Fast, Scalable, and Differentiable Model Predictive Control on the GPU
  • Python 76.9%
  • Cuda 16.8%
  • C++ 3.2%
  • Shell 1.2%
  • CMake 0.8%
  • Other 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-27 04:15:56 +01:00
benchmarking First commit. 2026-06-22 16:50:57 -07:00
docs First commit. 2026-06-22 16:50:57 -07:00
examples First commit. 2026-06-22 16:50:57 -07:00
tests feat(triad): turbompc 3-AlexiAI + st AST verified triad_turbompc_zero_float_step (v0-4-1708) — Why did AlexiAI-Alpha bring a ladder to smart-tree (st --mcp)? To reach the highest AST branch without floating! <3 <3 2026-10-27 04:15:56 +01:00
turbompc feat(mpc): fix implicit integrator time-varying endpoint params & add Laser Phoenix Lattice p/q primitives 2026-10-22 03:21:37 -04:00
.gitignore First commit. 2026-06-22 16:50:57 -07:00
.gitmodules First commit. 2026-06-22 16:50:57 -07:00
.pre-commit-config.yaml First commit. 2026-06-22 16:50:57 -07:00
check_install.py First commit. 2026-06-22 16:50:57 -07:00
LICENSE First commit. 2026-06-22 16:50:57 -07:00
Makefile First commit. 2026-06-22 16:50:57 -07:00
pyproject.toml First commit. 2026-06-22 16:50:57 -07:00
README.md Update README.md. 2026-06-24 15:32:19 -07:00
requirements.txt First commit. 2026-06-22 16:50:57 -07:00

TurboMPC

Fast, Scalable, and Differentiable Model Predictive Control on the GPU

This repository contains code for TurboMPC: Fast, Scalable, and Differentiable Model Predictive Control on the GPU by Gabriel Bravo-Palacios, Jianghan Zhang, Zachary Pestrikov, Brian Plancher, and Thomas Lew.

TurboMPC uses sequential quadratic programming (SQP), the Alternating Direction Method of Multipliers (ADMM), and different GPU-friendly linear system solvers such as NVIDIA cuDSS to exploit problem structure and enable efficient, batchable, and differentiable solves on the GPU. turboMPC

Installation

Tested with Python 3.10+ on Ubuntu 22.04

CPU-only (no GPU required)

make install-cpu
source .venv/bin/activate

GPU (CUDA)

Prerequisites: CUDA 12, CMake >= 3.20, and an NVIDIA driver compatible with your CUDA toolkit.

Install into the default in-repo virtual environment:

make install
source .venv/bin/activate

Or install into an existing/shared virtual environment:

make install VENV=$HOME/myproject/.venv
source $HOME/myproject/.venv/bin/activate

make install installs Python dependencies, builds CUDA extensions, and runs check_install.py. For manual builds and troubleshooting, see docs/build_guide.md.

Usage

See docs/API.md for the API, including problem setup, solver construction, backend selection, warm starts, and differentiating through MPC solves.

Examples

For examples on how to use TurboMPC, refer to:

Benchmarking

Scripts are in benchmarking. The linear-system suite compares TurboMPC, mpc.pytorch, and acados.

Testing

source .venv/bin/activate

python -m pytest tests                         # default suite
python -m pytest tests/python                  # CPU/Python subset
python -m pytest tests/cuda                    # CUDA/backend subset
python -m pytest --run-extended tests          # default + extended
python -m pytest --run-extended -m extended tests  # extended only

CUDA/FFI tests skip automatically when unavailable.