-
Notifications
You must be signed in to change notification settings - Fork 41
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
Apparent non-determinism when using OSQP via CVXPY #116
Comments
Thanks for reaching out. We don't employ randomness or stochasticity in the algorithm, and I actually wouldn't expect it to converge to two solutions if it is a convex problem (we should always be converging to be near the global solution). I haven't tried running it yet, but do you observe the difference starting near where a rho value update has happened? By default OSQP will do an automatic rho update using time measures, so that could be slightly different if some computations take longer certain times. One thing you could try is to fix the rho update interval to a set number of iterations and see if the behaviors change. |
@imciner2's explanation about time-based rho updated is very likely the correct one. See osqp/osqp#239, which was the same issue. |
Alternative suggestion : in your example, use:
which uses an interior point method instead. That solver is always deterministic and will also give higher accuracy solutions. |
Hi @imciner2 and @goulart-paul, Thank you both for your quick replies. Your suggestion about the adaptive rho appears to be the cause of our observations. My (maybe naive) fix for this has been to specify the keyword argument Have you considered documenting this potential behaviour in the rho setp-size section? I think indicating that this non-determinism is possible when the same computations take different times could be valuable to other users. Then again, it seems that this is a rare occurrence. We will look into the use of Clarabel, thanks for the suggestion. Thank you very much again, |
I think you might be better served by instead setting I agree that this should be better documented. |
Hi,
We are noticing that for some specific Quadratic Programming Problem in CVXPY we are getting two different solutions seemingly randomly.
I have included more context in https://github.com/timothy-nunn/cvxpy-non-determinism which also includes a reproduction of the issue.
We have only observed this issue for this fairly specific set of inputs but have observed the behaviour over multiple operating systems and versions of OSQP.
I will also note that we observe two different logs when running in verbose mode which shows where these two solutions are coming from. One solution is found after 50 iterations and cannot be polished, whilst the other is found after 75 and can be polished:
log.txt
The main questions are:
The text was updated successfully, but these errors were encountered: