forum.alglib.net
http://forum.alglib.net/

minlmoptimize in commercial edition
http://forum.alglib.net/viewtopic.php?f=2&t=3826
Page 1 of 1

Author:  belmic [ Wed Nov 22, 2017 10:35 pm ]
Post subject:  minlmoptimize in commercial edition

I use in my program the function of minlmoptimize. Will there be an acceleration of the performance of this function when buying a commercial library edition (multithreaded version with "smp_" prefix)?

Author:  Sergey.Bochkanov [ Thu Nov 23, 2017 9:24 am ]
Post subject:  Re: minlmoptimize in commercial edition

In minlm - no multithreading. Optimization is inherently sequential, so it is very hard to parallelize. In ALGLIB 3.14 we will introduce more fine-grained parallelism, but still optimization is a tricky.

However, on large-scale problems you may get speed-up from utilizing high performance linear algebra kernels (Intel MKL). Two questions: a) do you use C++ or C#? b) how many variables do you have?

Author:  belmic [ Thu Nov 23, 2017 9:53 am ]
Post subject:  Re: minlmoptimize in commercial edition

Sergey.Bochkanov wrote:
Two questions: a) do you use C++ or C#? b) how many variables do you have?

a) C++
b) The number of variables is from 3 to 12

Author:  Sergey.Bochkanov [ Thu Nov 23, 2017 10:13 am ]
Post subject:  Re: minlmoptimize in commercial edition

It is quite small-scale problem. So, both commercial and open source versions should have similar performance.

By the way, about performance - what is running time for LM? Is it fast or not?

Author:  belmic [ Thu Nov 23, 2017 10:25 am ]
Post subject:  Re: minlmoptimize in commercial edition

Sergey.Bochkanov wrote:
By the way, about performance - what is running time for LM? Is it fast or not?

For simple models with 3 parameters and a total number of approximations 50, the speed of the function is about 280 ms. In this case, for each approximation, a model function is performed for each of the 100 points of the curve.

Author:  Sergey.Bochkanov [ Thu Nov 23, 2017 11:58 am ]
Post subject:  Re: minlmoptimize in commercial edition

1. 280 ms for 50 runs of algorithm... not 100% sure, but sounds like a bit more than expected. Did you set scale of the variables with minlmsetscale()?
2. Do you provide derivatives? Or you let algorithm calculate them numerically?
3. How many iterations algorithm performs? (Optimization report has iteration counter)

If you need parallel speed-up, you can perform these independent approximations in parallel. ALGLIB is thread-safe, so if you create N independent instances of the optimizer, they will work correctly when used from N threads.

Author:  belmic [ Thu Nov 23, 2017 12:10 pm ]
Post subject:  Re: minlmoptimize in commercial edition

Sergey.Bochkanov wrote:
1. 280 ms for 50 runs of algorithm... not 100% sure, but sounds like a bit more than expected. Did you set scale of the variables with minlmsetscale()?
2. Do you provide derivatives? Or you let algorithm calculate them numerically?
3. How many iterations algorithm performs? (Optimization report has iteration counter)

1. Yes, I specify the boundaries of each variable using the function minlmsetscale, Ymin = 0.1*Y, Ymax=10*Y
2. 10 iterations are performed with accuracy 0.01
Source code for the function minlmoptimize:
Code:
   minlmcreatev(NT, x, 0.01, state);
   minlmsetbc(state, bndl, bndu);
   minlmsetscale(state, scale);
   minlmsetcond(state, epsg, epsf, epsx, maxits);
   minlmsetxrep(state, true);

   minlmoptimize(state, ThreadFitFunction, UpdateFunctionPtr, this);
   minlmresults(state, x, rep);

Author:  Sergey.Bochkanov [ Thu Nov 23, 2017 12:22 pm ]
Post subject:  Re: minlmoptimize in commercial edition

I feel that significant amount of time is spent in numerical differentiation. 12 additional evaluations per step (3 vars, 4-point formula). You may get up to 10x speed-up if you calculate derivatives yourself.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/