Closed cdiener closed 11 months ago
Could you elaborate a little on the pros/cons of creating a separate HIGHS interface compared to a combined one? I don't find the fact that it is not suitable for very large problems concerning, since presumably MICOM users would know to use the OSQP interface?
I don't think that the fact that this interface is slower than CPLEX & Gurobi is a problem. It would still be the only open source MILP solver that we have available in optlang. This would be extremely helpful for the memote webservice, for example, where we had to disable the MILPs.
In summary, I'm not sure about splitting the interfaces but I definitely would like to have them ❤️.
Could you elaborate a little on the pros/cons of creating a separate HIGHS interface compared to a combined one? I don't find the fact that it is not suitable for very large problems concerning, since presumably MICOM users would know to use the OSQP interface?
Sorry I wasn't clear here. I think there should be a HIGHS interface in optlang regardless. HIGHS is a great solver and it has another API (somewhat reminiscent of the GLPK API) that would fit well with optlang and be more efficient in terms of basis reuse and getting solution values. The QP solver in HIGHS is also pretty good for decent size problem (thousands of vars).
OSQP is great for QPs but can't solve LPs well, which leads to issues in settings where you need to do both within the same interface. That applies to MICOM but also other examples (MOMA in COBRAPY is another example). So this combines OSQP with HIGHS to cover all bases. Maybe it should even replace the OSQP interface since it would still retain all functionality but would provide an excellent LP/MILP fallback in the same interface as well... :thinking: If that is not a good fit I cold also just add it to MICOM though.
I don't think that the fact that this interface is slower than CPLEX & Gurobi is a problem. It would still be the only open source MILP solver that we have available in optlang. This would be extremely helpful for the memote webservice, for example, where we had to disable the MILPs.
I mean GLPK has a MILP solver, it just struggles with certain types of problems. Which specific MILPs are you running in MEMOTE? I could benchmark some with my COBRAPY branch that has the interface enabled to see if it would be helpful there.
In summary, I'm not sure about splitting the interfaces but I definitely would like to have them ❤️.
Yeah they will definitely both be in optlang eventually. I do want to get on the HIGHS interface as well but it might take a bit longer since it would have to be coded from the ground up and there are more methods to overwrite.
Okay, from my understanding of your description, it sounds like it might be best to have one combined HIGHS-OSQP interface and a separate HIGHS interface.
With regard to MEMOTE, there are a couple of MILP in the test_stoichiometry
module. There is also the paper reference in the docstrings if you want to read the source. GLPK does very poorly at those. Can easily take hours whereas CPLEX/Gurobi finish in about a minute.
Okay perfect, I'll change it into that then.
The only MIPs I found in memote for now where find_unconserved_metabolites
and find_inconsistent_min_stoichiometry
. Running those on iJO1366 cplex and highs were pretty much equally fast. Though, all returned empty sets so maybe should be benchmarked with a problem that has some inconsistencies.
In [10]: mod = load_model("iJO1366")
In [11]: modhy = mod.copy()
In [12]: modhy.solver.configuration.qp_method = "auto"
In [13]: modhy.solver.configuration.lp_method = "auto"
In [14]: modhy.solver = "hybrid"
In [15]: %time find_unconserved_metabolites(mod)
CPU times: user 2.06 s, sys: 6.33 ms, total: 2.06 s
Wall time: 1.99 s
Out[15]: set()
In [16]: %time find_unconserved_metabolites(modhy)
CPU times: user 2.24 s, sys: 7.73 ms, total: 2.25 s
Wall time: 2.25 s
Out[16]: set()
In [17]: from memote.support.consistency import *
In [18]: %time find_inconsistent_min_stoichiometry(mod)
CPU times: user 1.81 s, sys: 0 ns, total: 1.81 s
Wall time: 1.81 s
Out[18]: set()
In [19]: %time find_inconsistent_min_stoichiometry(modhy)
CPU times: user 1.65 s, sys: 3.24 ms, total: 1.65 s
Wall time: 1.65 s
Out[19]: set()
Something like Recon3D is probably the biggest that we have. Super cool to hear about the comparable speed ✌🏼
Something like Recon3D is probably the biggest that we have. Super cool to hear about the comparable speed ✌🏼
Same for Recon3, just takes around 9s for either, but again there are no violations, so I could imagine that it is different for models with actual inconsistencies.
Oh yeah, if there are none, then it is a very fast MILP.
I would probably be inclined to pull this by November 14 (2 month wait) if I get no reviews because it is high priority for us. It is tested pretty extensively now and avoids returning astonishingly wrong/non-optimal LP solutions in the OSQP interface.
By pull, you mean merge? I'm sorry, I didn't realize you were waiting on me. I thought you were still making modifications.
Yep I meant merge. It has been done for a while. I fixed some edge cases that came up testing some larger models, but it has been done for a while .
Thank you!
This is a proposal for a new interface that leverages the matrix interface to combine HIGHS and OSQP in a general purpose large problem solver. This was designed with MICOM in mind, so I am not completely sure whether it's in scope here (see pro-con below). It passes all the generic tests in optlang and also the full COBRAPY suite.
Pro
Cons
So let me know what you think.
COBRAPY tests and benchmarks