Ipopt.jl icon indicating copy to clipboard operation
Ipopt.jl copied to clipboard

Refactor linear/quadratic model handling

Open odow opened this issue 1 year ago • 2 comments

I started looking at how we can make in-place resolves of Ipopt fast, but it got tricky because the linear/quadratic components are messy.

At some point, we can refactor the utils.jl file into MOI to solve: https://github.com/jump-dev/MathOptInterface.jl/issues/1397

odow avatar Jul 15 '22 03:07 odow

Codecov Report

Merging #320 (fdb557e) into master (e5f978c) will increase coverage by 3.58%. The diff coverage is 98.39%.

@@            Coverage Diff             @@
##           master     #320      +/-   ##
==========================================
+ Coverage   87.80%   91.39%   +3.58%     
==========================================
  Files           3        4       +1     
  Lines         697      732      +35     
==========================================
+ Hits          612      669      +57     
+ Misses         85       63      -22     
Impacted Files Coverage Δ
src/MOI_wrapper.jl 88.48% <96.19%> (+0.57%) :arrow_up:
src/utils.jl 99.51% <99.51%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e5f978c...fdb557e. Read the comment docs.

codecov[bot] avatar Jul 15 '22 03:07 codecov[bot]

Nice reduction in allocations:

Current

julia> @time bench_opf_acp(; case = "pglib_opf_case2000_goc.m")
# [ ... ]
FEASIBLE_POINT
13.729058980941772
 15.410575 seconds (21.57 M allocations: 946.675 MiB, 5.64% gc time)

(nlp-jump-examples) pkg> st
      Status `~/Documents/lanl-ansi/nlp-jump-examples/Project.toml`
  [f6369f11] ForwardDiff v0.10.30
  [b6b21f68] Ipopt v1.0.3
  [4076af6c] JuMP v1.1.1
  [6fe1bfb0] OffsetArrays v1.12.6
  [c36e90e8] PowerModels v0.19.5
  [47a9eef4] SparseDiffTools v1.24.0
  [684fba80] SparsityDetection v0.3.4
  [0c5d862f] Symbolics v4.7.0
  [8bb1440f] DelimitedFiles
  [37e2e46d] LinearAlgebra

This PR

julia> @time bench_opf_acp(; case = "pglib_opf_case2000_goc.m")
# [ ... ]
FEASIBLE_POINT
12.106645822525024
 14.401220 seconds (15.76 M allocations: 915.635 MiB, 2.07% gc time, 9.35% compilation time)

(nlp-jump-examples) pkg> st
      Status `~/Documents/lanl-ansi/nlp-jump-examples/Project.toml`
  [f6369f11] ForwardDiff v0.10.30
  [b6b21f68] Ipopt v1.0.3 `~/.julia/dev/Ipopt`
  [4076af6c] JuMP v1.1.1
  [6fe1bfb0] OffsetArrays v1.12.6
  [c36e90e8] PowerModels v0.19.5
  [47a9eef4] SparseDiffTools v1.24.0
  [684fba80] SparsityDetection v0.3.4
  [0c5d862f] Symbolics v4.7.0
  [8bb1440f] DelimitedFiles
  [37e2e46d] LinearAlgebra

odow avatar Jul 18 '22 04:07 odow