MOI backend inefficiencies

Open
#439 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
performance

Research direction

Start by locating eval_hessian_lagrangian and tracing how it calls findnz and indexes sparse arrays during repeated Hessian evaluations. Compare this with the MOI backend's tuple-based sparsity structure and vector-of-values approach. Done means the Hessian path avoids those expensive sparse operations while preserving its existing results.

Written by the indexing model from the issue text.

Description

The MOI backend has a number of performance problems

  • findnz is called for each evaluation of hessians, this allocates
  • a lot of slow indexing of sparse arrays rather than just filling the H.nzval.

In general, the approach taken in MOI appears better in general, they only use vectors of tuples to indicate sparsity structure when the problem is set up, after that, they only operate on the vector of non-zero values rather than dealing with sparse matrices.

The function eval_hessian_lagrangian could probably be rewritten to also do this and save all the expensive sparse matrix operations

Dominant language
Julia
Stars
839
Forks
100
Avg merge
20h 43m
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SciML/Optimization.jl

All issues in SciML/Optimization.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.