Replies: 3 comments
-
@pnachtwey I think that no one would object to having individual fits use multiple cores. I tried something like this many (~10) years ago, and it did not actually make much of an improvement, but I am completely willing to say that it could definitely give a very large improvement. I am not aware of anyone doing that with Python, though I can certainly believe someone has, and it sort of sounds like you have some information on this. I think that using Python multiprocessing for fitting is Not Easy (TM), and doing it at the highest level from Python/Lmfit might be challenging. It may be that the latest "multiple interpreters" effort (maybe coming in 3.12 -- I am not sure) would help. If you have a modified version of MINPACK that supports multi-core from the Fortran level, that would definitely be worth exploring. I might suggest that is most suitable for Anyway, if you are interested in pursuing this, I would definitely encourage that, and let us know how we might be able to help. |
Beta Was this translation helpful? Give feedback.
-
Python 3.11 has made multiprocessing easier. The Jacobian part isn't big. What would be better yet is to have a standardized call to the parallel processing Jacobian function so that other minimizing algorithms can use it. |
Beta Was this translation helpful? Give feedback.
-
I don't believe it [code] does not format code. |
Beta Was this translation helpful? Give feedback.
-
I have a function with 15 parameters that I am fitting 3040 points and sometimes even more. It takes about 0.5 seconds for each function evaluation. Python now makes it easy to do multi-processing so all the evaluations to compute the Jacobian can be spawned at the same time and then 'joined'. Most modern CPUs have 16 threads so this technique would speed up computing the Jacobian significantly.
I have implemented Levenberg-Marquardt in our auto tuning product. The original code was modified from Argonne Labs Fortran version. I am looking a the Jacobian now. It doesn't seem like it would be too much work for a "HUGE" speed up if Python's multi processing overhead is too bad.
BTW, I have tried all the other 'methods' and none work as well as lmfit.
Beta Was this translation helpful? Give feedback.
All reactions