-
Notifications
You must be signed in to change notification settings - Fork 240
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
Long runtimes on Windows for code using parameter estimate #293
Comments
@lbianchi-lbl: Looking at the profile, can you try setting |
One other thing I am thinking of is that I should probably remove the bootstrapping cell at the end. This leads to two problems: randomness and time required to converge. A simple fix will be to point to paramest docs about bootstrapping. |
Actually, I am not sure that just changing |
@jsiirola I've tried to set
|
@jghouse88: I am pretty sure that the problem is not the bootstrap per se. It is that the infrastructure around subprocess management on windows is less than efficient. Bootstrapping just highlights it because of the number of solves. @lbianchi-lbl, I feel that the problem is really around a polling interval that we have to use on Windows (because windows lacks a import pyomo.common.tee
pyomo.common.tee._poll_interval = 0.01 |
@jsiirola this makes sense, I think understand where that comes into play now. I tried the fix you suggested, which helped a bit (runtime is ~150 s). Lowering it to 0.001 doesn't seem to reduce it further though, so I believe that the issue might lie in the Windows-specific parts of the code that's running inside the |
@lbianchi-lbl Great! This is good progress (we are down to "only" 2x what I would consider the minimum (looking at the profiles, it looked like the solver was eating up ~65s, and there will always be Pyomo overhead). I will be interested in hearing what you discover. I was poking around Python's implementation of ...but changing the default timeout to 0.01 upstream seems like something we should pursue. (it is used in two places: both for polling when processing the output from the solver, and when cleaning up. It would be interesting to see the relative impact those two uses have: do we need to shorten both, or just the one?) |
I'll test this again but @jsiirola thinks this should be fixed on the Pyomo side. |
@jsiirola I've managed to get some notebook runtime duration numbers from IDAES/examples-pse#64. My very crude analysis consists of:
From this analysis, it looks like the only significant difference (factor ~3) between Windows and Linux is in the degeneracy hunter notebook (https://github.com/IDAES/examples-pse/blob/main/src/Examples/Tools/degeneracy_hunter.ipynb); however, the absolute duration is small enough (<10 s) that it shouldn't negatively impact either interactive use or CI runs. See also the interactive plot (should be a standalone HTML file, zipped because of GitHub restrictions on attachments: examples-durations.zip TL;DR
|
This looks good. Thanks for digging into it! |
This makes sense. The Degeneracy Hunter notebook has an example of a simple but poorly formulated optimization problem for which Ipopt has many line search evaluations (for good mathematical/numerical reasons). I would not be surprised if Ipopt behaved differently on Windows and Linux for this problem. I've observed exact same versions of NLP solvers give different answers across platform on the same problem. Anyways, just posting here to archive my thoughts. |
This was originally reported on #249, where we noticed that example notebooks in
Tutorials/Advanced/ParamEst
take approximately 10 times longer to complete on Windows than on Ubuntu. This might or might not be related to recent changes in Pyomo and/or PySP.I've started to look into this in more detail using one of the
ParamEst
notebooks,parameter_estimation_NRTL_using_state_block_solution_testing
. Here's a summary of what I found out:parmest_state_block.py
, attached insideparmest.zip
)python parmest_state_block.py
on Ubuntu and Windows seems to confirm the fact that the runtime on Windows (~400 s) is much longer than on Ubuntu (~40 s)ubuntu.log
andwin.log
, attached), my untrained eye didn't spot any glaring differences between the twopip list
for each system is attachedcProfile
compiler (python -m cProfile -o parmest.prof parmest_state_block.py
) on the two OSes resulted in the two.prof
files attached insideparmest.zip
snakeviz
tool (pip install snakeviz && snakeviz parmest.prof
)parmest.zip
)parameter_estimation_NRTL_using_state_block_solution_testing.pdf
parmest.zip
pip-list-ubuntu.txt
pip-list-win.txt
ubuntu.log
win.log
The text was updated successfully, but these errors were encountered: