Closed
Description
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).
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
qtothec commentedon Nov 7, 2017
ghackebeil commentedon Nov 7, 2017
jsiirola commentedon Nov 7, 2017
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?whart222 commentedon Nov 8, 2017
vog commentedon Nov 9, 2017
@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.
vog commentedon Nov 17, 2017
The following test program is fully self-contained including the sample data:
test_model.py
Notes:
create_pyomo_model
function.test_model.nl
file is fast and consumes almost no additional memory.test_model.nl
file, and takes quite some time for that.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!
vog commentedon Nov 29, 2017
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,
Volker
jsiirola commentedon May 8, 2020
Archived on the master Performance Proposals Issue (#1430). Closing this performance proposal until active development has begun.