-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Huge memory consumption while generating model file #251
Comments
Right now the Pyomo differentiate function is a sympy wrapper. We haven't
had a use case for something more sophisticated, but your model might be a
reason to do so. One option could be a tie in with CasADi.
On Tue, Nov 7, 2017, 12:31 Volker Diels-Grabsch ***@***.***> wrote:
I observe a huge memory consumption of Pyomo while generating a
somewhat-bigger model file for IPOPT. Moreover, generating the model takes
longer than running IPOPT to solve it.
However, the initial creation of the model objects using Pyomo expressions
is fast and does not consume much memory.
How can I debug this? I suppose it might be the generation of derivatives,
but I don't know how to verify this.
Regarding derivatives: Does Pyomo create simple-minded symbolic
derivatives, or does it use some techniques of algorithmic differentiation
(a.k.a. automatic differentiation, i.e. at least reusing common
subexpressions and/or using AD reverse mode for gradient calculations).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#251>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFowrAUTXe7XNnk3kcOnmwl76ek09y90ks5s0JPQgaJpZM4QVKl_>
.
--
-----------
Qi Chen
PhD Candidate
Center for Advanced Process Decision-Making
[email protected]
|
Pyomo does not generate derivatives. It interfaces to Ipopt through that solver's AMPL interface, which is compiled against the AMPL Solver Library (ASL) where all of the AD happens (in C). I am unsure about the specifics of the AD implementation in the library.
Does the spike in memory happen during the solve or during the writing of the NL file (before Ipopt is launched)? You can try writing the file and launching Ipopt in separate steps to be sure about this. E.g.,
# assuming model is a ConcreteModel or something returned from create_instance(…)
model.write("junk.nl")
Then from the shell, launch
$ ipopt junk.nl <http://junk.nl/>
Gabe
… On Nov 7, 2017, at 12:30 PM, Volker Diels-Grabsch ***@***.***> wrote:
I observe a huge memory consumption of Pyomo while generating a somewhat-bigger model file for IPOPT. Moreover, generating the model takes longer than running IPOPT to solve it.
However, the initial creation of the model objects using Pyomo expressions is fast and does not consume much memory.
How can I debug this? I suppose it might be the generation of derivatives, but I don't know how to verify this.
Regarding derivatives: Does Pyomo create simple-minded symbolic derivatives, or does it use some techniques of algorithmic differentiation (a.k.a. automatic differentiation, i.e. at least reusing common subexpressions and/or using AD reverse mode for gradient calculations).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#251>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACM5ZrDYawaJh7lJ30mRNmwkoJHT8o1gks5s0JPQgaJpZM4QVKl_>.
|
Can you provide more detail about what you are doing? If you are working with an AbstractModel, then the initial model parse should be very fast and use little memory, with the time+memory coming when the model is actually constructed (that is, populated). There is also the possibility that the writer is duplicating a lot of the model (this happens, for example, when generating the canonical representation used by the LP writer -- something similar may be happening with the NL writer). Can you share your model? Alternatively, can you run it with |
Let me ditto John's request. I'm in the process of profiling performance
issues like this, and it would really help to see your model.
…--Bill
On Tue, Nov 7, 2017 at 1:30 PM, John Siirola ***@***.***> wrote:
Can you provide more detail about what you are doing? If you are working
with an AbstractModel, then the initial model parse should be very fast and
use little memory, with the time+memory coming when the model is actually
*constructed* (that is, populated). There is also the possibility that
the writer is duplicating a lot of the model (this happens, for example,
when generating the canonical representation used by the LP writer --
something similar may be happening with the NL writer).
Can you share your model? Alternatively, can you run it with pyomo solve
--report-timing and report the time breakdowns?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#251 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAsb-Kb-4LGKAptKkyzW0CMUwK8ywUUaks5s0L3OgaJpZM4QVKl_>
.
|
@ghackebeil I'm pretty sure the huge memory consumption occurs during generation of the nl file, but I'll verify that, just to be sure. @jsiirola It's just a ConcreteModel, I haven't yet used AbstractModels. @whart222 That sounds great. I'll provide a standalone example as soon as possible. |
The following test program is fully self-contained including the sample data: Notes:
Any suggestions how to improve speed and memory usage of that test program, or how to improve Pyomo to fix this issue? Thanks in advance! |
Have you been able to take a look at the model? Is there anything I can to do make the example program easier to analyze for you? Any pointers on how to analyze the memory consumption issue on my own? Regards, |
Archived on the master Performance Proposals Issue (#1430). Closing this performance proposal until active development has begun. |
I observe a huge memory consumption of Pyomo while generating a somewhat-bigger model file for IPOPT. Moreover, generating the model takes longer than running IPOPT to solve it.
However, the initial creation of the model objects using Pyomo expressions is fast and does not consume much memory.
How can I debug this? I suppose it might be the generation of derivatives, but I don't know how to verify this.
Regarding derivatives: Does Pyomo create simple-minded symbolic derivatives, or does it use some techniques of algorithmic differentiation (a.k.a. automatic differentiation, i.e. at least reusing common subexpressions and/or using AD reverse mode for gradient calculations).
The text was updated successfully, but these errors were encountered: