Backend='numpy' #397
Replies: 5 comments 19 replies
-
Opty has existed for almost 10 years and it ran the Cython backend. So changing to use the NumPy backend (even for low operation count) is (sort of) a backwards incompatible change. I'm not sure I want to do that. There is also a computational cost to running count_ops(). If the equations are really huge, count_ops() may take a very long time. So we'd need a function that short circuits once 50,000 operations are counted. Maybe that already exists in SymPy. Given that someone can set |
Beta Was this translation helpful? Give feedback.
-
I am basically a VERY interested user of opty, how could I be a co author?? Being acknowledged is an honor for me! Then we should maybe put it in the docstrings that backend='numpy' is better for small op_counts? Yes, count_ops takes time. But nothing compared to 'cyipopt' |
Beta Was this translation helpful? Give feedback.
-
Thanks! I like to make them - within my limitations. I pushed a change in the docstrings. I did not think about backwards compatibility. I will close this comment as taken care of, I will continue my list. |
Beta Was this translation helpful? Give feedback.
-
I expanded the comparison list as follows: NB: |
Beta Was this translation helpful? Give feedback.
-
I ran my simple comparisons again, checking the time to solve the problem, too.
Seems my #398 was a bit premature. Can you easily de-merge it or is it better I make a new PR where I take it out? |
Beta Was this translation helpful? Give feedback.
-
I made a comparison between the backends, using mosty examples for examples-gallery and got these results for running ``Problem.
Currently, the default backend is cyipopt.
Based on my data, backend='numpy' has a huge advantage for low number of operations in the eoms, and backend='cyipopt' has a big one for large numbers.
I suppose the cutoff may be around 50,000 - 75,000 operations.
I suggest this:
I think, the exact number is not very crucial: for small op_count, say, 2,000 numpy is MUCH faster, for large op_counts, say 300,000 cyipot is.
If #393 will be successful before the next release of opty, we can easily change this number or make 'numpy' the default, if it beats cyipot on any number.
25-03-05 backend_comparisons.xlsx
Beta Was this translation helpful? Give feedback.
All reactions