cuPIQP¶
CuPIQP is a GPU-native convex Quadratic Programming (QP) solver that implements the PIQP (Proximal Interior Point Quadratic Programming) algorithm entirely on NVIDIA GPUs.
The core strength of cuPIQP is to solve large batches of small-to-medium QPs in parallel while also exposing the solve as a differentiable operation via implicit differentiation.
In addition to batched workloads, cuPIQP can also solve large-scale sparse and dense QPs, alongside GPU solvers such as cuClarabel, cuOpt, and QOCO-GPU.
What cuPIQP solves¶
cuPIQP solves convex QPs of the form
with primal decision variables \(x \in \mathbb{R}^n\), matrices \(P\in \mathbb{S}_+^n\), \(A \in \mathbb{R}^{p \times n}\), \(G \in \mathbb{R}^{m \times n}\), and vectors \(c \in \mathbb{R}^n\), \(b \in \mathbb{R}^p\), \(h_l \in \mathbb{R}^m\), \(h_u \in \mathbb{R}^m\), \(x_l \in \mathbb{R}^n\), and \(x_u \in \mathbb{R}^n\).
Features¶
- Native batched solving — solve multiple independent QPs with the same dimension and sparsity pattern in parallel from a single solver instance by stacking inputs along a leading batch axis.
- Differentiable — efficiently compute VJPs via implicit differentiation
by reusing the condensed factor from the forward solve, with optional
gradient smoothing for smooth
derivatives across active-set changes. The PyTorch layers
plug the solve into
torch.autograd. - Warp-native — every input, internal buffer and result is a
warp.array. Inputs can be any CUDA array (CuPy, PyTorch, JAX, ...), viewed zero-copy through the CUDA Array Interface or DLPack. - Scales to large QPs — the same solver handles large sparse and dense QPs.
- Robust - implements proximal iterior point method, with modern techniques including preconditioner, iterative refinement, etc.
- GPU-resident — the IPM iterations, KKT factorizations, and linear algebra run on the GPU.
- Versatile problem types — supports general dense and sparse QPs, as well as multistage optimization problems such as optimal control problems (OCPs).
Comparison with PIQP¶
cuPIQP implements the same Proximal Interior Point algorithm as PIQP, targeting large-scale QPs on NVIDIA GPUs:
| PIQP (CPU) | cuPIQP (GPU) | |
|---|---|---|
| Language | C++ (with C / Python / Matlab / Julia / Rust bindings) | Python (Warp-native) |
| Execution | CPU (multi-threaded via OpenMP) | GPU-resident (CUDA) |
| Batched solving | Limited | Massive |
| Differentiable | No | Yes, via implicit differentiation |
Dependencies¶
CuPIQP is built on multiple existing libraries, including:
- Warp — the solver's arrays and JIT-compiled CUDA kernels.
- nvmath-python — cuBLAS / cuSOLVER / cuSPARSE / cuDSS bindings and CUDA runtime packages via the selected CUDA extra.
- SciPy — sparse backend only, to build the KKT sparsity pattern
once at
setup(). - NVTX — profiling annotations.
- socu — required by
MultistageSolveras the block-structured linear-system solver (installed by default as a core dependency).
Framework-independent dependencies (numpy, scipy, warp-lang, nvmath-python,
nvtx) resolve cleanly from PyPI; the CUDA-bound packages come from the CUDA extras.
Where to next¶
- New here? Start with Installation and Getting Started.
- Building a controller or learning loop? See Batched Solving.
- Differentiating through a solution? See Differentiation,
or PyTorch Layers to train through the solver with
torch.autograd. - Looking for a specific class or setting? See the API Reference.
Citing¶
If you use cuPIQP in academic work, please cite the underlying PIQP algorithm paper and this implementation. A BibTeX entry will be provided once a cuPIQP-specific publication is available.
License¶
BSD-2-Clause. cuPIQP is developed at the Automatic Control Laboratory, EPFL, with support from NCCR Automation.