[AMPL 18371] Improving Speed

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 18371] Improving Speed

Nick Tsivanidis
Hi,

I'm solving a problem with AMPL (using Knitro) and am wondering about general advice on improving speed.

I run a problem using two sets of settings:
  1. Aggregating units to 112 locations, my problem has 229 variables are 27119+26335 nonzero in the Jacobian+Hessian.

  2. Leaving my units of observation at their initial level, there are 630. This results in 1235 variables, and a really dense Jacobian+Hessian (787327+763230 nonzero, respectively).
The first problem runs very quickly, about 90s. This is faster that a more rudimentary global search method with constraints solved at each parameter guess (i.e. nested fixed point) in Matlab. But the second problem takes hours, and is slower than the nested fixed point approach.

I'm wondering what are the best options to reduce times taken for dense problems in AMPL. Does increasing cores/RAM do it, or should I expect such dense problems with a large number of variables to be slow?

Thanks,

-Nick

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

[AMPL 18373] Re: Improving Speed

charlotte.mouret
Dear Nick,

A priori, I would say that you are more likely to improve performance by adjusting Knitro's parameter.
The number of non-zeros you mention is not excessive so it should not take hours.

May I suggest you run the automatic Knitro tuner (setting option tuner = 1).
You may also want to play with the parallel features of Knitro (see online doc) if you are using a multi-core computer.

An alternative could be to use a different formulation that would reduce the number of non-zeros.
Sometimes, adding intermediate variables and additional constraints allows to decrease the density of some constraints, and thus decrease the number of non-zeros in the Jacobian / Hessian.
This is not a recommended approach in general, but it can be beneficial in some cases.

If you could also share your model, it could be useful. If not possible, the logs would be a start.

Regards,
Sylvain Mouret


Le mercredi 13 mars 2019 00:59:14 UTC+1, Nick Tsivanidis a écrit :
Hi,

I'm solving a problem with AMPL (using Knitro) and am wondering about general advice on improving speed.

I run a problem using two sets of settings:
  1. Aggregating units to 112 locations, my problem has 229 variables are 27119+26335 nonzero in the Jacobian+Hessian.

  2. Leaving my units of observation at their initial level, there are 630. This results in 1235 variables, and a really dense Jacobian+Hessian (787327+763230 nonzero, respectively).
The first problem runs very quickly, about 90s. This is faster that a more rudimentary global search method with constraints solved at each parameter guess (i.e. nested fixed point) in Matlab. But the second problem takes hours, and is slower than the nested fixed point approach.

I'm wondering what are the best options to reduce times taken for dense problems in AMPL. Does increasing cores/RAM do it, or should I expect such dense problems with a large number of variables to be slow?

Thanks,

-Nick

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 18377] Improving Speed

AMPL mailing list
I have received the files privately and will be responding soon.

--
Robert Fourer
[hidden email]
{#HS:800348577-38360#}
On Wed, Mar 13, 2019 at 4:26 PM UTC, Ampl Modeling Language <[hidden email]> wrote:
Dear Nick,

A priori, I would say that you are more likely to improve performance by
adjusting Knitro's parameter.
The number of non-zeros you mention is not excessive so it should not take
hours.

May I suggest you run the automatic Knitro tuner (setting option tuner = 1).
You may also want to play with the parallel features of Knitro (see online
doc <https://www.artelys.com/tools/knitro_doc/2_userGuide/parallelism.html>;)
if you are using a multi-core computer.

An alternative could be to use a different formulation that would reduce
the number of non-zeros.
Sometimes, adding intermediate variables and additional constraints allows
to decrease the density of some constraints, and thus decrease the number
of non-zeros in the Jacobian / Hessian.
This is not a recommended approach in general, but it can be beneficial in
some cases.

If you could also share your model, it could be useful. If not possible,
the logs would be a start.

Regards,
Sylvain Mouret



On Tue, Mar 12, 2019 at 11:59 PM UTC, Ampl Modeling Language <[hidden email]> wrote:
Hi,

I'm solving a problem with AMPL (using Knitro) and am wondering about general advice on improving speed.

I run a problem using two sets of settings:
  1. Aggregating units to 112 locations, my problem has 229 variables are 27119+26335 nonzero in the Jacobian+Hessian.

  2. Leaving my units of observation at their initial level, there are 630. This results in 1235 variables, and a really dense Jacobian+Hessian (787327+763230 nonzero, respectively).
The first problem runs very quickly, about 90s. This is faster that a more rudimentary global search method with constraints solved at each parameter guess (i.e. nested fixed point) in Matlab. But the second problem takes hours, and is slower than the nested fixed point approach.

I'm wondering what are the best options to reduce times taken for dense problems in AMPL. Does increasing cores/RAM do it, or should I expect such dense problems with a large number of variables to be slow?

Thanks,

-Nick
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.