Package: qpbenchmark
QP solvers benchmarkBenchmark for quadratic programming (QP) solvers available in Python.The objective is to compare and select the best QP solvers for given use cases. The benchmarking methodology is open todiscussions. Standard and communitytest setsare available: all of them can be processed using theqpbenchmarkcommand-line tool, resulting in standardized reports evaluating allmetricsacross all QP solvers available on the test machine.Test setsThe benchmark comes with standard and community test sets to represent different use cases for QP solvers:Free-for-all: community-built test set, new problemsare welcome!Maros-Meszaros: a standard test set with problems designed to be difficult.Model predictive control: model predictive control problems arisinge.g.in robotics.New test sets are welcome! Theqpbenchmarktool is designed to make it easy to wrap up a new test set without re-implementing the benchmark methodology. Check outcreating a new test set.SolversSolverKeywordAlgorithmMatricesLicenseClarabelclarabelInterior pointSparseApache-2.0CVXOPTcvxoptInterior pointDenseGPL-3.0DAQPdaqpActive setDenseMITECOSecosInterior pointSparseGPL-3.0GurobigurobiInterior pointSparseCommercialHiGHShighsActive setSparseMITHPIPMhpipmInterior pointDenseBSD-2-ClauseMOSEKmosekInterior pointSparseCommercialNPPronpproActive setDenseCommercialOSQPosqpDouglas–RachfordSparseApache-2.0PIQPpiqpProximal Interior PointDense & SparseBSD-2-ClauseProxQPproxqpAugmented LagrangianDense & SparseBSD-2-ClauseQPALMqpalmAugmented LagrangianSparseLGPL-3.0qpOASESqpoasesActive setDenseLGPL-2.1qpSWIFTqpswiftInterior pointSparseGPL-3.0quadprogquadprogGoldfarb-IdnaniDenseGPL-2.0SCSscsDouglas–RachfordSparseMITMetricsWe evaluate QP solvers based on the following metrics:Success rate:percentage of problems a solver is able to solve on a given test set.Computation time:time a solver takes to solve a given problem.Optimality conditions:we evaluate all threeoptimality conditions:Primal residual:maximum error on equality and inequality constraints at the returned solution.Dual residual:maximum error on the dual feasibility condition at the returned solution.Duality gap:value of the duality gap at the returned solution.Shifted geometric meanEach metric (computation time, primal and dual residuals, duality gap) produces a different ranking of solvers for each problem. To aggregate those rankings into a single metric over the whole test set, we use theshifted geometric mean(shm), which is a standard to aggregate computation times inbenchmarks for optimization software. This mean has the advantage of being compromised by neither large outliers (as opposed to the arithmetic mean) nor by small outliers (in contrast to the geometric geometric mean). Check out thereferencesbelow for further details.Here are some intuitive interpretations:A solver with a shifted-geometric-mean runtime of $Y$ is $Y$ times slower than the best solver over the test set.A solver with a shifted-geometric-mean primal residual $R$ is $R$ times less accurate on equality and inequality constraints than the best solver over the test set.ResultsThe outcome from running a test set is a standardized report comparingsolversagainst the differentmetrics. Here are the results for the variousqpbenchmarktest sets:Free-for-all resultsMaros-Meszaros resultsModel predictive control resultsYou can check out results from a variety of machines, and share the reports produced by running the benchmark on your own machine, in the Results category of the discussions forum of each test set.LimitationsHere are some known areas of improvement for this benchmark:Cold start only:we don't evaluate warm-start performance for now.CPU thermal throttling:the benchmark currently does not check the status of CPU thermal throttling. Adding this feature is agood way to start contributingto the benchmark.Check out the issue tracker for ongoing works and future improvements.InstallationThe recommended process is to install the benchmark and all solvers in an isolated environment usingconda:conda env create -f environment.yamlconda activate qpbenchmarkAlternatively, you can install the benchmarking tool individually bypip install qpbenchmark. In that case, the benchmark will run on all supported solvers it can import.UsageThe benchmark works by runningqpbenchmarkon a Python script describing the test set. For instance:qpbenchmark my_test_set.py runThe test-set script is followed by a benchmark command, such as "run" here. We can add optional arguments to run a specific solver, problem, or solver settings:qpbenchmark my_test_set.py run --solver proxqp --settings defaultCheck outqpbenchmark --helpfor a list of available commands and arguments.PlotsThe command line ships aplotcommand to compare solver performances over a test set for a specific metric. For instance, run:qpbenchmark maros_meszaros_dense.py plot runtime high_accuracyTo generate the following plot:ContributingContributions to improving this benchmark are welcome. You can for instance propose new problems, or share the runtimes you obtain on your machine. Check out thecontribution guidelinesfor details.CitationIf you useqpbenchmarkin your scientific works, please cite ite.g.as follows:@software{qpbenchmark2024,author={Caron, Stéphane and Zaki, Akram and Otta, Pavel and Arnström, Daniel and Carpentier, Justin and Yang, Fengyu},license={Apache-2.0},month=feb,title={{qpbenchmark: Benchmark for quadratic programming solvers available in Python}},url={https://github.com/qpsolvers/qpbenchmark},version={2.2.1},year={2024}}See alsoReferencesHow not to lie with statistics: the correct way to summarize benchmark results: why geometric means should always be used to summarize normalized results.Optimality conditions and numerical tolerances in QP solvers: note written while figuring out thehigh_accuracysettings of this benchmark.Other benchmarksBenchmarks for optimization softwareby Hans Mittelmann, which includes reports on the Maros-Meszaros test set.jrl-qp/benchmarks: benchmark of QP solvers available in C++.osqp_benchmarks: benchmark examples for the OSQP solver.proxqp_benchmark: benchmark examples for the ProxQP solver.