Skip to content

Conversation

odow
Copy link
Member

@odow odow commented Mar 22, 2022

Alternative to #1780

This will need JuMP to lower-bound it's dependence on MOI, but that's okay. This is really a bug-fix, so I plan to tag as 1.1.1.

julia> using MathOptInterface; const MOI = MathOptInterface
MathOptInterface

julia> MOI.instantiate(MOI.FileFormats.NL.Model)
An AMPL (.nl) model

julia> MOI.instantiate(MOI.FileFormats.NL.Model; with_bridge_type = Float64)
MOIB.LazyBridgeOptimizer{MOIU.CachingOptimizer{MOI.FileFormats.NL.Model, MOIU.UniversalFallback{MOIU.Model{Float64}}}}
with 0 variable bridges
with 0 constraint bridges
with 0 objective bridges
with inner model MOIU.CachingOptimizer{MOI.FileFormats.NL.Model, MOIU.UniversalFallback{MOIU.Model{Float64}}}
  in state EMPTY_OPTIMIZER
  in mode AUTOMATIC
  with model cache MOIU.UniversalFallback{MOIU.Model{Float64}}
    fallback for MOIU.Model{Float64}
  with optimizer An AMPL (.nl) model

julia> MOI.instantiate(MOI.FileFormats.MPS.Model; with_bridge_type = Float64)
MOIB.LazyBridgeOptimizer{MOIU.GenericModel{Float64, MOIU.ObjectiveContainer{Float64}, MOIU.VariablesContainer{Float64}, MOI.FileFormats.MPS.ModelFunctionConstraints{Float64}}}
with 0 variable bridges
with 0 constraint bridges
with 0 objective bridges
with inner model A Mathematical Programming System (MPS) model

@odow odow requested a review from blegat March 23, 2022 01:55
@blegat
Copy link
Member

blegat commented Mar 23, 2022

This will need JuMP to lower-bound it's dependence on MOI

I still don't understand why this would while the other fix wouldn't since none of them require a change in JuMP so what's the difference between the two fixes that I am missing ?

@odow
Copy link
Member Author

odow commented Mar 23, 2022

JuMP doesn't use instantiate:
https://github.com/jump-dev/JuMP.jl/blob/7fdd4d41f5275f2f5a0775f5d89252c689128413/src/file_formats.jl#L51-L55
So when we switch to MOI.instantiate(MOI.FileFormats.XXX.Model) it won't work on an earlier version of MOI

@odow
Copy link
Member Author

odow commented Mar 23, 2022

This does need a change in JuMP. #1780 fixes it on the MOI side, so it doesn't need a change in JuMP.

@odow odow merged commit c589802 into master Mar 23, 2022
@odow odow deleted the od/relax-instantiate branch March 23, 2022 05:49
@blegat blegat mentioned this pull request Mar 23, 2022
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