-
Notifications
You must be signed in to change notification settings - Fork 25
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
WIP: Implement MathOptInterface #11
Conversation
src/MathOptInterfaceOSQP.jl
Outdated
elseif osqpstatus == :Dual_infeasible | ||
MOI.InfeasibleOrUnbounded | ||
elseif osqpstatus == :Primal_infeasible | ||
MOI.InfeasibleNoResult |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OSQP returns proofs of infeasibility, so this should be MOI.Success
.
src/MathOptInterfaceOSQP.jl
Outdated
elseif osqpstatus == :Interrupted | ||
MOI.Interrupted | ||
elseif osqpstatus == :Dual_infeasible | ||
MOI.InfeasibleOrUnbounded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also MOI.Success
. The dual status correctly reports MOI.InfeasibilityCertificate
.
src/MathOptInterfaceOSQP.jl
Outdated
elseif osqpstatus == :Solved_inaccurate | ||
MOI.AlmostSuccess | ||
elseif osqpstatus == :Primal_infeasible_inaccurate | ||
MOI.InfeasibleNoResult |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AlmostSuccess
Thanks for the feedback. I've fixed the |
Woohoo, all of the |
460d867
to
4d0e4ce
Compare
Codecov Report
@@ Coverage Diff @@
## master #11 +/- ##
==========================================
+ Coverage 78.59% 85.05% +6.45%
==========================================
Files 4 5 +1
Lines 500 850 +350
==========================================
+ Hits 393 723 +330
- Misses 107 127 +20
Continue to review full report at Codecov.
|
6cb7111
to
f4331dc
Compare
I'm getting pretty close now. Problem modification (both objective and constraints) seems to be working, at least for the types of modification covered by MOIT. Let me know if you have any comments. |
6578300
to
a7521e2
Compare
Regarding code coverage: seeing as this is meant to be used through MOIU.CachingOptimizer, should I just get rid of the
as well as |
It wasn't the intention of the API to have solvers that are only usable with CachingOptimizer. For example, let's say you read QP models from a text file and then just want to On the other hand, it is the intention for package authors to only implement what they want to support, so 🤷♂️. CC @blegat |
You can use |
Ah, great. Thanks. |
de5a599
to
1f8ff8d
Compare
I'm seeing some strange behavior related to problem modification and/or warm starting. First, I would have expected this test to pass: https://github.com/oxfordcontrol/OSQP.jl/pull/11/files#diff-db1be9f95f6ecf272979beabd83257ddR228. I'm solving the same problem twice and explicitly setting the warm start before each solve, but the results aren't exactly the same. Is there some additional state in OSQP? Could still be a bug in my code as well. Second, I'm getting random test failures in a test that uses fixed data, namely:
Sometimes when I start Julia, the test passes, sometimes I get that error. @bstellato, any ideas? |
We'll see what Travis says, but locally, not setting |
Test coverage is pretty good now. I think this is pretty much done now. FYI: I need to work on other stuff the next couple of days. |
The The solver is not exactly deterministic. This is because we perform the updates of the step-size If you want OSQP to be deterministic, you can set the |
Thanks. Just setting |
I am surprised Also, Another comment: I am not sure you use |
54bd8b5
to
8626912
Compare
Add support for vector constraints.
(Based off of #9)
I think I at least have the basics down now. For example, the following works:
For this you need:
Status:
copy!
(kind of awaiting resolution of Instance can't store VariablePrimalStart JuliaOpt/MathOptInterfaceBridges.jl#88)[ ] Support for vector constraints.I'm not going to bother with that in this PR. We were also discussing having CachingOptimizer provide fallback support for this.get
/canget
safety)processobjective!
processconstraints!
constant
functionConstraintPrimal
hack after makingConstraintPrimal
tests in MOIT optional.set!
methods for warm start