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

Implement `copy_to`

Open odow opened this issue 6 years ago • 5 comments

An efficient implementation of MOI.copy_to is needed when JuMP is used in AUTOMATIC mode.

See https://github.com/JuliaOpt/Gurobi.jl/pull/188#issuecomment-459385303.

odow avatar Jan 31 '19 16:01 odow

Not that a copy_to is only used if the layer structure is Cache-LQOI or Cache-Bridges-Cache-LQOI To have a similar speedup with Cache-Bridges-LQOI we can build the matrix with the allocate-load API like SCS (requires https://github.com/JuliaOpt/MathOptInterface.jl/issues/523)

blegat avatar Jan 31 '19 19:01 blegat

Would there be any benefit to adding a few basic solver traits as part of this? I am thinking of something that signifies columnwise(Clp) vs rowwise(gurobi) data structures.

I haven't gotten a chance to run the benchmark yet but I would imagine that for Clp it would be much faster to add "empty" constraints, then add the coefficients when you add the variable (column)

ndinsmore avatar Mar 11 '19 15:03 ndinsmore

Would there be any benefit to adding a few basic solver traits as part of this? I am thinking of something that signifies columnwise(Clp) vs rowwise(gurobi) data structures.

I think this is an argument for solver-specific implementations.

Basically, we need to decide the trade-off between

  • code duplication (CPLEX and Gurobi are very similar)
  • code complexity dealing with different types of backends.

We also have to consider that LQOI is another level of abstraction between JuMP and the solver.

I'm coming round to the idea that solver-specific implementations (with duplication) are worthwhile. Particularly so now that MOI is more settled.

odow avatar Mar 11 '19 20:03 odow

I dont think LQOI need to be another layer. It could be part of MOIU. I am against code duplication. Unless its proven that code Is significantly different.

joaquimg avatar Mar 11 '19 21:03 joaquimg

I actually find the LQOI interface much easier to read. If there was a way with helper functions or macros to make MOI more friendly that would be awesome and a maybe a reason to sunset LQOI.

That being said the changes to LQOI I have made recently: https://github.com/JuliaOpt/LinQuadOptInterface.jl/pull/96 Has really moved the performance bottleneck onto the expression Dicts in LQOI and OrderedDicts in MOI.

ndinsmore avatar Mar 12 '19 16:03 ndinsmore