-
Notifications
You must be signed in to change notification settings - Fork 0
Uno interface #119
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
base: master
Are you sure you want to change the base?
Uno interface #119
Conversation
|
I think this looks very reasonable. On my ubuntu laptop, I can do pip install unopy and run https://github.com/cvanaret/Uno/blob/main/interfaces/Python/example/example_hs015.py, so I don't encounter the same build issuze as you @Transurgeon |
|
Hi @Transurgeon, I have added some more Python wheels a couple of days ago, can you try again to install unopy? Unless you have Windows, in which case unopy is built from the sources. Happy to look at the log :) |
|
Benchmarks that have stayed the same: |
Sorry for the late reply. The example which fails for SQP is as follows (written in cvxpy syntax): def test_qcp(self, solver):
# Use IPM for UNO on this test, SQP converges to a suboptimal point: (0, 0, 1)
if solver == 'UNO':
solver = 'UNO_IPM'
x = cp.Variable(1)
y = cp.Variable(1, bounds=[0, np.inf])
z = cp.Variable(1, bounds=[0, np.inf])
objective = cp.Maximize(x)
constraints = [
x + y + z == 1,
x**2 + y**2 - z**2 <= 0,
x**2 - cp.multiply(y, z) <= 0
]
problem = cp.Problem(objective, constraints)
problem.solve(solver=solver, nlp=True)
assert problem.status == cp.OPTIMAL
assert np.allclose(x.value, np.array([0.32699284]))
assert np.allclose(y.value, np.array([0.25706586]))
assert np.allclose(z.value, np.array([0.4159413]))it was found from the JuMP examples.
Thanks for doing this! It seems to work. uno is now running in our CI successfully. We removed the windows tests since they were also causing some problems on cvxpy master. |
This PR adds the Uno interface to DNLP.
CC. @cvanaret could you double check that our implementation makes sense? (I have mostly used claude code for it so there might be things that are not done well). The good news is that almost all tests pass directly using uno's SQP (except one which converges to a sub-optimal point.. uno's IPM is used instead for that test).
BTW, I also tried to install uno directly through pip (by running
pip install unopy). But I seemed to be getting errors that a linear solver was not available when importing unopy after that. I can try to replicate the error if needed.. just wanted to let you know for now.