Skip to content

Inefficient implementation of LBFGS multiply #378

@MaxenceGollier

Description

@MaxenceGollier

for j eachindex(q)
q[j] += bx * data.b[k][j] - ax * data.a[k][j]
end

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

for i = 1:(data.mem)

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions