Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the performance gap between Matlab fmincons and C++'s NLP solver like ipopt?

I am about to write an algorthim for real-time applications, which involves some high dimensional NLPs (nonlinear programmings).

before implentations, I need to timing my algorithim to see whether it is feasible for real-time applications, therefore I use Matlab's built-in fmincons as a baseline.

As experience shows, matlab algorithms tend to vary from slower to magitudes slower than their C++ counterparts, so I want to estimate what kind of performance gain I can expect with this particular case?

As my work is mostly related to real-time applications, thus I rarely use NLP(nonlinear programming), so I asked my workmates, they recommend me to try ipopt as a start, I googled its website, there is no benchmarks there against Matlab, nor there is much topics regarding the details of their algorithms (at least in Matlab, it is not hard to check the details of their algorthims), so I basically have little idea about the accuracy/robustness/optimality etc. about it.

So any help here regarding NLP's C++ implenmentations will be very helpful, many thanks in advance.

like image 577
user0002128 Avatar asked Nov 10 '12 01:11

user0002128


1 Answers

Many of these sort of problems are dominated by large O(n^~3) matrix multiplications. If that is the case and both systems are using the same algorithm than the performance will be similar and won't depend on the language, as the underlying matrix multiply function will be implemented natively in asm anyway.

If the algorithm isn't dominated by a simple function like this, and instead has a lot of memory management required than the C++ library will win by a lot (3-10 x as fast).

(If performance is critical than many people are using OpenCL to farm stuff off to the GPU which is designing for this type of numerical calculation, and has price/performance differences in the 20-100x range. Or you can farm it off to a cluster if you need even faster.)

like image 117
Andrew Tomazos Avatar answered Nov 09 '22 00:11

Andrew Tomazos