LinearOperators.jl
LinearOperators.jl copied to clipboard
Inefficient implementation of LBFGS multiply
https://github.com/JuliaSmoothOptimizers/LinearOperators.jl/blob/4575ca56d78d1cd21a080280af54540c384b3add/src/lbfgs.jl#L195-L197
This is highly inefficient. There are too many memory accesses being performed. We should replace with
@. q += bx .* data.b[k] - ax .* data.a[k]
In the same function there is also
https://github.com/JuliaSmoothOptimizers/LinearOperators.jl/blob/4575ca56d78d1cd21a080280af54540c384b3add/src/lbfgs.jl#L190
which should be improved with the @inbounds macro.
@dpo I am already getting huge improvements just with this (regarding the discussion we had this morning on Zulip).
Thanks. That code was probably written before the dot notation existed.