You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tries <- data.frame()
for(i in 1:200)
{
quadraticProgram <- osqp::osqp(P = osqp.P, q = osqp.q, A = osqp.A, l = osqp.l, u = osqp.u, pars = osqp::osqpSettings(eps_abs = 0.000001, eps_rel = 0.000001, verbose = FALSE))
result_RstudioDesktop <- quadraticProgram$Solve()
tries <- rbind(tries, data.frame(try <- i, iter <- result_RstudioDesktop$info$iter, pri_res <- result_RstudioDesktop$info$pri_res, dua_res <- result_RstudioDesktop$info$dua_res))
}
most of the time the solver returns the same result after 950 iterations but few times it ended after 875 or 850 iterations with another result (not far from the other one).
Reading the documentation of the solver, I can't find what is the default starting point of the algorithm (x0, y0, and z0). I wonder if the difference comes from a different starting point or if it comes from machine precision at a key point of the algorithm (test for stopping conditions or checking for a change on step size parameters).
Can you confirm that OSQP should always return the same result when called with the same parameter (cold start)? Can you help me finding out why I observed this unwilled phenomenon?
Kind regards,
Philippe Carpentier
The text was updated successfully, but these errors were encountered:
The reason is that the adaptive_rho feature is configured by default to update rho and refactor the linear system in the solver based on the relative time taken between the factor phase and the iteration phase of the solver. The factorisation code is deterministic, but the execution time can vary b/c it is competing for CPU resources with other things on the machine.
If you want completely repeatable behaviour, I would suggest configuring the solver the update rho instead after a fixed number of iterations (maybe try 50-100 to start).
Many thanks Paul for your quick and comprehensive answer!
It works fine on my side. But just to be sure, can you confirm that I only need to add in osqpSettings:
adaptive_rho_interval = 100
Hi Gentlemen,
I notice that OSQP does not always return the same result eventhough the parameters are the same (see hereafter a test I ran on my PC):
data.zip
load(file = "C:/temp/data.RData")
tries <- data.frame()
for(i in 1:200)
{
quadraticProgram <- osqp::osqp(P = osqp.P, q = osqp.q, A = osqp.A, l = osqp.l, u = osqp.u, pars = osqp::osqpSettings(eps_abs = 0.000001, eps_rel = 0.000001, verbose = FALSE))
result_RstudioDesktop <- quadraticProgram$Solve()
tries <- rbind(tries, data.frame(try <- i, iter <- result_RstudioDesktop$info$iter, pri_res <- result_RstudioDesktop$info$pri_res, dua_res <- result_RstudioDesktop$info$dua_res))
}
most of the time the solver returns the same result after 950 iterations but few times it ended after 875 or 850 iterations with another result (not far from the other one).
Reading the documentation of the solver, I can't find what is the default starting point of the algorithm (x0, y0, and z0). I wonder if the difference comes from a different starting point or if it comes from machine precision at a key point of the algorithm (test for stopping conditions or checking for a change on step size parameters).
Can you confirm that OSQP should always return the same result when called with the same parameter (cold start)? Can you help me finding out why I observed this unwilled phenomenon?
Kind regards,
Philippe Carpentier
The text was updated successfully, but these errors were encountered: