How many cores can MOSEK effectively utilize?

144 views
Skip to first unread message

maur...@gmail.com

unread,
Jan 30, 2018, 12:54:22 AM1/30/18
to mosek
When solving a convex problem (more specifically convex objective and linear constraints) using the interior-point optimizer, how many cores can MOSEK effectively utilize? What sorts of computations can be performed in parallel? Thank you

Erling D. Andersen

unread,
Jan 30, 2018, 1:18:17 AM1/30/18
to mosek
What kind of convex objective do you have? Quadratic? 

First of all we recommend reformulating the problems as conic optimization problem if possible. Also the conic optimizer is better parallelized than the convex optimizer.

MOSEK will try to exploit all the cores available. However, for smallish problems you will not see much benefit. 

maur...@gmail.com

unread,
Jan 30, 2018, 1:00:18 PM1/30/18
to mosek
I have a mix of quadratic, exponential, and logarithmic functions in the objective. So I don't believe I can reformulate into a conic problem. I am using mskscopt in the MOSEK MATLAB interface. My test environment only has 4 cores, I'm just curious up to what number of cores good scaling can be expected, and at what number of cores will there be greatly diminishing returns. Thank you

Erling D. Andersen

unread,
Jan 30, 2018, 1:08:04 PM1/30/18
to mosek
We are extending MOSEK to handle the exponential cones which allows you to do the exponential and logarithmic stuff you currently only can do with Scopt. 

Anything about speed up is guess work at best. You have to try it out.

Btw you can dump scopt models to disk (I can tell you gow). And if you are willing to give them to me I can convert them conic form and tell you speedup for both the separable and conic form.
I have a computer with a huge number of cores.

maur...@gmail.com

unread,
Jan 31, 2018, 12:40:54 PM1/31/18
to mosek
Please let me know about dumping models to the disk. That would be very helpful.

Erling D. Andersen

unread,
Feb 1, 2018, 1:16:43 AM2/1/18
to mosek
You can upload the files to our dropbox mentioned at


This is the function you need (param and cmd is optional):



function  [res] = mskscwri(filename,opr,opri,oprj,oprf,oprg,c,a,blc,buc,blx,bux,param,cmd)
%
% Syntax : mskscwri(filename,opr,opri,oprj,oprf,oprg,c,a,blc,buc,blx,bux,param,cmd)
%
% Purpose: Write an scopt problem to the files filename.sco and filename.mps
%

maur...@gmail.com

unread,
Feb 6, 2018, 12:41:49 AM2/6/18
to mosek
Hi Dr. Andersen. I uploaded two sample problems to the dropbox, one has a power objective and the other is exponential. On my system using 4 cores (i5 4670k) each problem is solved in roughly 2 and a half minutes. Would greatly appreciate if you can provide a sense of how the solution times scale as cores increase, I imagine that at some point there are diminishing returns. 

On another note I tried to set MSK_IPAR_NUM_THREADS to 1, 2 and 3 but my CPU usage still showed 100% when running the problem. Not sure why.

Erling D. Andersen

unread,
Feb 6, 2018, 1:19:41 AM2/6/18
to mosek
Thanks. Will get back shortly.

Erling D. Andersen

unread,
Feb 6, 2018, 3:00:21 AM2/6/18
to mosek
Are you minimizing or maximizing?


Erling D. Andersen

unread,
Feb 6, 2018, 6:01:55 AM2/6/18
to mosek
Assuming you are maximizing and using the current and very preliminary version 9. 

Below I show the time for 1,2,4,8,12 threads. There is some benefits up to 8 threads, Well, for the bigger one 12 threads is still useful


Optimizer time (medium)
Nametime runtest-conic-1t-d-default-diaztime runtest-conic-2t-d-default-diaztime runtest-conic-4t-d-default-diaztime runtest-conic-8t-d-default-diaztime runtest-conic-12t-d-default-diaziter runtest-conic-1t-d-default-diaziter runtest-conic-2t-d-default-diaziter runtest-conic-4t-d-default-diaziter runtest-conic-8t-d-default-diaziter runtest-conic-12t-d-default-diaz
Sum127.32285.50263.59359.98458.3706868676969
N. wins00001
Nametime runtest-conic-1t-d-default-diaztime runtest-conic-2t-d-default-diaztime runtest-conic-4t-d-default-diaztime runtest-conic-8t-d-default-diaztime runtest-conic-12t-d-default-diaziter runtest-conic-1t-d-default-diaziter runtest-conic-2t-d-default-diaziter runtest-conic-4t-d-default-diaziter runtest-conic-8t-d-default-diaziter runtest-conic-12t-d-default-diaz
c-diaz_test_a106127.32285.50263.59359.98458.3706868676969
Optimizer time (large)
Nametime runtest-conic-1t-d-default-diaztime runtest-conic-2t-d-default-diaztime runtest-conic-4t-d-default-diaztime runtest-conic-8t-d-default-diaztime runtest-conic-12t-d-default-diaziter runtest-conic-1t-d-default-diaziter runtest-conic-2t-d-default-diaziter runtest-conic-4t-d-default-diaziter runtest-conic-8t-d-default-diaziter runtest-conic-12t-d-default-diaz
Sum188.154117.20292.52377.28873.76199961009999
N. wins00001
Nametime runtest-conic-1t-d-default-diaztime runtest-conic-2t-d-default-diaztime runtest-conic-4t-d-default-diaztime runtest-conic-8t-d-default-diaztime runtest-conic-12t-d-default-diaziter runtest-conic-1t-d-default-diaziter runtest-conic-2t-d-default-diaziter runtest-conic-4t-d-default-diaziter runtest-conic-8t-d-default-diaziter runtest-conic-12t-d-default-diaz
c-diaz_test_c47188.154117.20292.52377.28873.76199961009999

Erling D. Andersen

unread,
Feb 6, 2018, 6:06:39 AM2/6/18
to mosek
Time is seconds btw.

maur...@gmail.com

unread,
Feb 6, 2018, 11:29:24 AM2/6/18
to mosek
Thank you, this is very helpful. Yes, it is a utility maximization problem. Quite impressive that gains can still be made from 8 to 12 threads, kudos to you and your team. As larger numbers of cores become common, do you think it's worthwhile to try increasing parallelization in MOSEK's algorithms (non-integer problems)? How much room for improvement is still left?

On Tuesday, February 6, 2018 at 6:06:39 AM UTC-5, Erling D. Andersen wrote:
Time is seconds btw.

Erling D. Andersen

unread,
Feb 6, 2018, 12:14:09 PM2/6/18
to mosek
If you increase the size of the problem you are solving, then more 12 cores be could useful. However, frequently the cores cannot get data fast enough to keep all the cores busy.
So the memory is bottleneck. 
 
For that reason and Amdahls law it is hard to improve the speed ups but some improvement is always possible. 
Reply all
Reply to author
Forward
0 new messages