libprima / PRIMA.jl

a Julia interface to PRIMA, a Reference Implementation for Powell's methods with Modernization and Amelioration
MIT License
20 stars 5 forks source link

Issues with `AutoForwardDiff` #27

Open zaikunzhang opened 3 months ago

zaikunzhang commented 3 months ago

Hi @amontoison and @emmt ,

Could you have a look at the following correlated issues?

https://github.com/SciML/Optimization.jl/issues/719

https://github.com/soldasim/BOSS.jl/issues/28

I do believe this is a problem with the Julia interface. Shouldn't we just ignore anything related to automatic deafferentation, since PRIMA does not use it at all?

Quoting the first issue:

The COBYLA algorithm apparently uses AD for automatic detection of linear/nonlinear constraints (despite being derivative-free). It should not error when AD is provided though.

This isn't the case, right?

Quoting the second issue:

Created an issue at Optimization.jl: https://github.com/SciML/Optimization.jl/issues/719

For all the unconstrained algorithms, pass keyword autodiff = nothing to OptimizationAM and OptimizationMLE as a workaround.

COBYLA is probably just broken until this is resolved. (Unless other AD backends work. (?))

This is important for us. People believe that PRIMA.jl is broken ...

Thanks!

Zaikun

amontoison commented 3 months ago

@zaikunzhang The issue is upstream, they didn't interfaced correctly PRIMA.jl. It seems that they already fixed the problem in SciML/Optimization.jl: https://github.com/SciML/Optimization.jl/pull/721

emmt commented 3 months ago

No PRIMA.jl is certainly not broken (there is however the Windows issue with CUTEst) and does not use AD at all, just the values returned by the objective function. The reported issue is clearly a misuse of the method, I think that's what has been already answered.

soldasim commented 3 months ago

Hello, the issue https://github.com/SciML/Optimization.jl/issues/719 was definitely on the side of Optimization.jl, not PRIMA.jl itself. (And it also only occurred when using PRIMA.jl via Optimization.jl.) That's why I opened the issue there.

Similarly, the AD is used for detection of lin/nonlin constraints by Optimization.jl, not COBYLA itself.

I just worded myself poorely. Sorry about that. :)

PS: Thanks for the great implementation of great algorithms! :)) PRIMA has quickly become my favorite robust derivative-free optimization library.

zaikunzhang commented 3 months ago

Hi @soldasim ,

Great! Thank you for letting us know!

Best regards, Zaikun