-
Notifications
You must be signed in to change notification settings - Fork 525
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
Use C/C++ extensions for file writers #1158
Comments
To clarify, what are POEK and COEK? Google doesn't turn up useful results. |
POEK and COEK are some experimental codes for expressing optimization models in C++ and Python, with a goal towards reassessing the computational bottleneck's we've seen in Pyomo. These have not been released (yet), but they'll be available for use at the hackathon. |
The perf_poek_writer branch includes a preliminary demonstration. Comparing the writing time of pmedian8 to files foo.lp and foo.poeklp, the writing time of poeklp is about 17% faster. This demonstration (a) creates a Pyomo model, (b) creates a POEK model, and (c) calls C++ to write the POEK model to an LP file. This performance test used Pybind11, which is slower than the cffi interface (which I'm not sure is working yet for COEK). |
On this front, I am particularly interested in having a persistent interface to poek/coek which can then be used to write lp and nl files. This would essentially give us a fast persistent interface to all of the most used solvers. |
FWIW, I testing with the cppyy binding, and writing poeklp was 24% faster for pmedian. |
@whart222 Do you happen to have the comparison of just translating the model to an lp file (i.e., excluding the time to generate the pyomo/poek models)? |
The perf_poek_writer branch now includes a preliminary demonstration for writing NL files with POEK. Comparing the writing time of pmedian8 to files foo.nl and foo.poeknl, the writing time of poeknl is about 20% faster. This demonstration (a) creates a Pyomo model, (b) creates a POEK model, and (c) calls C++ to write the POEK model to an NL file. |
@michaelbynum I'm not sure what "just translating" the model means. The comparison here is fair in that I'm comparing the time it takes for Pyomo to write with the time it takes to convert to POEK and then write. The conversion to POEK is automatic. |
Archived on the master Performance Proposals Issue (#1430). Closing this performance proposal until active development has begun. |
The key idea is to use C extension libraries to create problem files (LP, NL, GAMS, etc). Preliminary work with POEK and COEK indicates that this approach could significantly reduce the time needed to process a Pyomo model and generate a standard data file.
Specifically, here's a concrete experiment we should be able to easily do:
Note that step (2) does not involve creating a canonical expression. Further, step (3) pushes all file I/O to C/C++. Both of these will likely lead to significant improvement in the total runtime using LP files.
Some limitations of this approach:
Note that this approach does not require the use of COEK solver interfaces. This is merely using COEK's ability to (a) express linear/quadratic models, and (b) write them in standard formats.
The text was updated successfully, but these errors were encountered: