Skip to main content

Quadratic Programming Solver for Robotics and beyond.

Project description

Proxsuite Logo

License Documentation CI - Linux/OSX/Windows - Conda PyPI version Conda version

ProxSuite is a collection of open-source, numerically robust, precise, and efficient numerical solvers (e.g., LPs, QPs, etc.) rooted in revisited primal-dual proximal algorithms. Through ProxSuite, we aim to offer the community scalable optimizers that deal with dense, sparse, or matrix-free problems. While the first targeted application is Robotics, ProxSuite can be used in other contexts without limits.

ProxSuite is actively developed and supported by the Willow and Sierra research groups, joint research teams between Inria, École Normale Supérieure de Paris and Centre National de la Recherche Scientifique localized in France.

ProxSuite is already integrated into:

  • CVXPY modeling language for convex optimization problems,
  • CasADi's symbolic framework for numerical optimization in general and optimal control. ProxQP is available in CasADi as a plugin to solve quadratic programs,
  • TSID: robotic software for efficient robot inverse dynamics with contacts and based on Pinocchio.

We are ready to integrate ProxSuite within other optimization ecosystems.

ProxSuite main features

Proxsuite is fast:

  • C++ template library,
  • cache-friendly.

Proxsuite is versatile, offering through a unified API advanced algorithms specialized for efficiently exploiting problem structures:

  • dense, sparse, and matrix-free matrix factorization backends,
  • advanced warm-starting options (e.g., equality-constrained initial guess, warm-start or cold-start options from previous results),

with dedicated features for

  • handling more efficiently box constraints, linear programs, QP with diagonal Hessian, or with far more constraints than primal variables,
  • solving nonconvex QPs,
  • solving batches of QPs in parallel,
  • solving the closest feasible QP if the QP appears to be primal infeasible,
  • differentiating feasible and infeasible QPs.

Proxsuite is flexible:

  • header only,
  • C++ 14/17/20 compliant,
  • Python and Julia bindings for easy code prototyping without sacrificing performance.

Proxsuite is extensible. Proxsuite is reliable and extensively tested, showing the best performances on the hardest problems of the literature. Proxsuite is supported and tested on Windows, Mac OS X, Unix, and Linux.

Documentation

The online ProxSuite documentation of the last release is available here.

Getting started

ProxSuite is distributed to many well-known package managers.

Quick install with :

   pip install proxsuite

This approach is available on Linux, Windows and Mac OS X.

Quick install with :

   conda install proxsuite -c conda-forge

This approach is available on Linux, Windows and Mac OS X.

Quick install with :

   brew install proxsuite

This approach is available on Linux and Mac OS X.

Alternative approaches

Installation from source is presented here.

Compiling a first example program

For the fastest performance, use the following command to enable vectorization when compiling the simple example.

g++ -O3 -march=native -DNDEBUG -std=gnu++17 -DPROXSUITE_VECTORIZE examples/first_example_dense.cpp -o first_example_dense $(pkg-config --cflags proxsuite)

Using ProxSuite with CMake

If you want to use ProxSuite with CMake, the following tiny example should help you:

cmake_minimum_required(VERSION 3.10)

project(Example CXX)
find_package(proxsuite REQUIRED)
set(CMAKE_CXX_STANDARD 17) # set(CMAKE_CXX_STANDARD 14) will work too

add_executable(example example.cpp)
target_link_libraries(example PUBLIC proxsuite::proxsuite)

# Vectorization support via SIMDE and activated by the compilation options '-march=native' or `-mavx2 -mavx512f`
add_executable(example_with_full_vectorization_support example.cpp)
target_link_libraries(example_with_full_vectorization_support PUBLIC proxsuite::proxsuite-vectorized)
target_compile_options(example_with_full_vectorization_support PUBLIC "-march=native")

If you have compiled ProxSuite with the vectorization support, you might also use the CMake target proxsuite::proxsuite-vectorized to also link against SIMDE. Don't forget to use -march=native to get the best performance.

ProxQP

The ProxQP algorithm is a numerical optimization approach for solving quadratic programming problems of the form:

$$ \begin{align} \min_{x} & ~\frac{1}{2}x^{T}Hx+g^{T}x \ \text{s.t.} & ~A x = b \ & ~l \leq C x \leq u \end{align} $$

where $x \in \mathbb{R}^n$ is the optimization variable. The objective function is defined by a positive semidefinite matrix $H \in \mathcal{S}^n_+$ and a vector $g \in \mathbb{R}^n$. The linear constraints are defined by the equality-contraint matrix $A \in \mathbb{R}^{n_\text{eq} \times n}$ and the inequality-constraint matrix $C \in \mathbb{R}^{n_\text{in} \times n}$ and the vectors $b \in \mathbb{R}^{n_\text{eq}}$, $l \in \mathbb{R}^{n_\text{in}}$ and $u \in \mathbb{R}^{n_\text{in}}$ so that $b_i \in \mathbb{R},~ \forall i = 1,...,n_\text{eq}$ and $l_i \in \mathbb{R} \cup { -\infty }$ and $u_i \in \mathbb{R} \cup { +\infty }, ~\forall i = 1,...,n_\text{in}$.

Citing ProxQP

If you are using ProxQP for your work, we encourage you to cite the related paper.

Numerical benchmarks

The numerical benchmarks of ProxQP against other commercial and open-source solvers are available here.

For dense Convex Quadratic Programs with inequality and equality constraints, when asking for relatively high accuracy (e.g., 1e-6), one obtains the following results.

Random Mixed QP_dense_eps_abs_1e-6

On the y-axis, you can see timings in seconds, and on the x-axis dimension wrt to the primal variable of the random Quadratic problems generated (the number of constraints of the generated problem is half the size of its primal dimension). For every dimension, the problem is generated over different seeds, and timings are obtained as averages over successive runs for the same problems. This chart shows for every benchmarked solver and random Quadratic program generated, barplot timings, including median (as a dot) and minimal and maximal values obtained (defining the amplitude of the bar). You can see that ProxQP is always below over solvers, which means it is the quickest for this test.

For hard problems from the Maros Meszaros testset, when asking for high accuracy (e.g., 1e-9), one obtains the results below.

maros_meszaros_problems_high_accuracy

The chart above reports the performance profiles of different solvers. It is classic for benchmarking solvers. Performance profiles correspond to the fraction of problems solved (on the y-axis) as a function of certain runtime (on the x-axis, measured in terms of a multiple of the runtime of the fastest solver for that problem). So the higher, the better. You can see that ProxQP solves the quickest over 60% of the problems (i.e., for $\tau=1$) and that for solving about 90% of the problems, it is at most 2 times slower than the fastest solvers solving these problems (i.e., for $\tau\approx2$).

Note: All these results have been obtained with a 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz CPU.

QPLayer

QPLayer enables to use a QP as a layer within standard learning architectures. More precisely, QPLayer differentiates over $\theta$ the primal and dual solutions of QP of the form

$$ \begin{align} \min_{x} & ~\frac{1}{2}x^{T}H(\theta)x+g(\theta)^{T}x \ \text{s.t.} & ~A(\theta) x = b(\theta) \ & ~l(\theta) \leq C(\theta) x \leq u(\theta) \end{align} $$

where $x \in \mathbb{R}^n$ is the optimization variable. The objective function is defined by a positive semidefinite matrix $H(\theta) \in \mathcal{S}^n_+$ and a vector $g(\theta) \in \mathbb{R}^n$. The linear constraints are defined by the equality-constraint matrix $A(\theta) \in \mathbb{R}^{n_\text{eq} \times n}$ and the inequality-constraint matrix $C(\theta) \in \mathbb{R}^{n_\text{in} \times n}$ and the vectors $b \in \mathbb{R}^{n_\text{eq}}$, $l(\theta) \in \mathbb{R}^{n_\text{in}}$ and $u(\theta) \in \mathbb{R}^{n_\text{in}}$ so that $b_i \in \mathbb{R},~ \forall i = 1,...,n_\text{eq}$ and $l_i \in \mathbb{R} \cup { -\infty }$ and $u_i \in \mathbb{R} \cup { +\infty }, ~\forall i = 1,...,n_\text{in}$.

QPLayer is able to learn more structured architectures. For example, $\theta$ can consists only in learning some elements of $A$ while letting $b$ fixed (see e.g., the example about how to include QPLayer into a learning pipeline). QPLayer can also differentiates over LPs. QPLayer allows for parallelized calculus over CPUs, and is interfaced with PyTorch.

Citing QPLayer

If you are using QPLayer for your work, we encourage you to cite the related paper.

Installation procedure

Please follow the installation procedure here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libproxsuite-0.7.3.tar.gz (54.7 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

libproxsuite-0.7.3-5-py3-none-manylinux_2_28_x86_64.whl (251.2 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

libproxsuite-0.7.3-5-py3-none-manylinux_2_28_aarch64.whl (251.2 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

libproxsuite-0.7.3-5-py3-none-macosx_11_0_arm64.whl (251.2 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

libproxsuite-0.7.3-5-py3-none-macosx_10_9_x86_64.whl (251.2 kB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file libproxsuite-0.7.3.tar.gz.

File metadata

  • Download URL: libproxsuite-0.7.3.tar.gz
  • Upload date:
  • Size: 54.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for libproxsuite-0.7.3.tar.gz
Algorithm Hash digest
SHA256 ae9665cda8fbb8199a611b7b6a06d66dd8db012ee4dd13ef5c4de7e138ddce6b
MD5 bbc7e1f1040d56194a1a794a4dc8148e
BLAKE2b-256 9f0502212e1ada18b7523293dcefa5b8adf7fb99f4b215cf80ab2f6995271a52

See more details on using hashes here.

Provenance

The following attestation bundles were made for libproxsuite-0.7.3.tar.gz:

Publisher: release.yml on cmake-wheel/libproxsuite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libproxsuite-0.7.3-5-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libproxsuite-0.7.3-5-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8c4b3ab4a63b708a0c3713296efebe3ca756db32086f7a7d8f6f11ae6316353f
MD5 8e0cf96deaebed008457be179bb7ffa1
BLAKE2b-256 37f4e2c1a27bd663525509d3c57b85da84aa6b62d0708947193244cdecad1a5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for libproxsuite-0.7.3-5-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on cmake-wheel/libproxsuite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libproxsuite-0.7.3-5-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for libproxsuite-0.7.3-5-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ae8135555d3e329b62d316c44904a28589ec9c40b3e5bab71f660c6c2250d33f
MD5 10026bc4861425cbf64570e55eec3b20
BLAKE2b-256 56ec843b92cf41523f91f0d877b1ccf97efabf10560315d5839e8370ba01883e

See more details on using hashes here.

Provenance

The following attestation bundles were made for libproxsuite-0.7.3-5-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on cmake-wheel/libproxsuite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libproxsuite-0.7.3-5-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libproxsuite-0.7.3-5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 56eb7c465e63df4a765f6deb9195a55f668a719bf6de806c630accd42ff6cfee
MD5 2d01379c83e35e1d2930dfaeb7c48be1
BLAKE2b-256 816c103d7a8379948319b8310b4b9a0b75465160303341016732cc845af9613b

See more details on using hashes here.

Provenance

The following attestation bundles were made for libproxsuite-0.7.3-5-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on cmake-wheel/libproxsuite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libproxsuite-0.7.3-5-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for libproxsuite-0.7.3-5-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 832da90af6e0657da387b64336c2d08196ab591ac9ad937113519e330b85d8f0
MD5 823ff19f5c1b9eba84f19085c84261af
BLAKE2b-256 5aa69df94983a2cbaac208f65a0157516fc7353fddb532bf16665c75f162f960

See more details on using hashes here.

Provenance

The following attestation bundles were made for libproxsuite-0.7.3-5-py3-none-macosx_10_9_x86_64.whl:

Publisher: release.yml on cmake-wheel/libproxsuite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page