SciML / Optimization.jl

Mathematical Optimization in Julia. Local, global, gradient-based and derivative-free. Linear, Quadratic, Convex, Mixed-Integer, and Nonlinear Optimization in one simple, fast, and differentiable interface.
https://docs.sciml.ai/Optimization/stable/
MIT License
704 stars 77 forks source link

Inclusion of PRIMA solvers in Optimization.jl #593

Closed zaikunzhang closed 10 months ago

zaikunzhang commented 11 months ago

Dear Optimization.jl maintainers,

This is Dr. Zaikun Zhang from The Hong Kong Polytechnic University. Together with Professor N.I.M. Gould, I am responsible for maintaining the renowned derivative-free optimization solvers of the late Professor M.J.D. Powell, namely COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. I am the author of PRIMA, which provides the reference implementation for these solvers. They are widely used by engineers and scientists. For instance, see Section 1 of a recent paper on Powell's solvers as well as the Google searches of COBYLA and BOBYQA.

I note that there has been an interest in including derivative-free solvers in Optimization.jl, as mentioned in a previous issue by @ChrisRackauckas. I hope PRIMA will help you to achieve this goal. I will be happy to assist on the Fortran side if you would like to do so.

FYI, three of these solvers (COBYLA, NEWUOA, BOBYQA) have been included in NLopt.jl. However, NLopt did it based on the unmaintained Fortran 77 implementation (indeed, a C translation by f2c). Although the Fortran 77 implementation is truly a masterpiece, it contains many bugs (mostly due to the language itself), which can lead to segmentation faults or infinite loops. For example, see Section 4.4 of the above paper and many GitHub issues. It is strongly discouraged to use the Fortran 77 version of these solvers anymore.

Besides, the inclusion of PRIMA solvers in SciPy is under discussion, and the major SciPy maintainers are quite positive.

Finally, the following by @amontoison may be interesting to you:

https://github.com/JuliaPackaging/Yggdrasil/blob/master/P/PRIMA/build_tarballs.jl

Thanks and regards, Zaikun ZHANG Ph.D. and Assistant Professor Dept. App. Math., Hong Kong Polytechnic University

Vaibhavdixit02 commented 11 months ago

Thanks for the comment @zaikunzhang. It would great to get PRIMA added as a solver package in this repo. I'll take a look into adding it soon.

ChrisRackauckas commented 11 months ago

Yeah with the binarybuilder piece already done, someone just needs to make the extension that does the ccall's from Optimization.jl's interface. That shouldn't be too bad. I think it would be great to have these since while we work so much on getting differentiation working in as many cases as possible, many times using a good enough derivative-free solver can be the right choice and presenting the best ones available is a nice option to have.

zaikunzhang commented 11 months ago

Thank you @ChrisRackauckas and @Vaibhavdixit02 for the response. I will be very happy to provide assistance regarding the Fortran source code of PRIMA whenever you need it.

zaikunzhang commented 10 months ago

Hi @ChrisRackauckas and @Vaibhavdixit02 , for your information, PRIMA now has an official Julia interface:

https://github.com/libprima/prima.jl

Hope this will be useful to you.

Thanks.