Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor linear/quadratic model handling #320

Merged
merged 7 commits into from
Aug 17, 2022
Merged

Refactor linear/quadratic model handling #320

merged 7 commits into from
Aug 17, 2022

Conversation

odow
Copy link
Member

@odow odow commented Jul 15, 2022

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: jump-dev/MathOptInterface.jl#1397

@codecov
Copy link

codecov bot commented Jul 15, 2022

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%) ⬆️
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.

Copy link
Member

@blegat blegat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's simpler in a separate file. Having it in MOI as an MOI layer would be a good move as well. It can be in the NLP MOI module that is subject to change.

@odow odow force-pushed the od/inplace-resolve branch from c54dffc to 1ece872 Compare July 17, 2022 23:10
@odow odow changed the title WIP: Refactor out linear/quadratic parts Refactor linear/quadratic model handling Jul 17, 2022
@odow
Copy link
Member Author

odow commented Jul 18, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants