Simple-Robotics / proxsuite

The Advanced Proximal Optimization Toolbox
BSD 2-Clause "Simplified" License
376 stars 47 forks source link

Termination issue on QGFRDXPN problem #63

Open stephane-caron opened 1 year ago

stephane-caron commented 1 year ago

Same setting as in https://github.com/Simple-Robotics/proxsuite/issues/62. ProxQP 0.2.2 does not seem to terminate on the QGFRDXPN problem from the Maros and Meszaros test set.

Reproduction steps

Clone qpsolvers_benchmark, then un:

$ python run_benchmark.py --problem QGFRDXPN --solver proxqp

Outcome on my machine: still running after 1 hour. (The maximum number of iterations should be the default 1e4.)

Details

Same as in https://github.com/Simple-Robotics/proxsuite/issues/62.

jcarpent commented 1 year ago

What is the size of this problem? Which back-end do you use?

jcarpent commented 1 year ago

@Bambade Did you try QGFRDXPN problem?

Bambade commented 1 year ago

@stephane-caron thanks for reporting also this issue. @jcarpent, I have not tested yet either this problem, as the Maros benchmarks were restricted for matrices of dimensions <= 1000 (here H is of size 1092 x 1092 and A: 1708 x 1092).

jcarpent commented 1 year ago

@fabinsch Could you try this problem on your computer and report the time to solve an instance? I suspect it is an hard and need long time with sparse backend in fact while the problem is relatively sparse

stephane-caron commented 1 year ago

What is the size of this problem? Which back-end do you use?

I use the sparse backend. The problem is shaped like this:

P.shape=(1092, 1092)
q.shape=(1092,)
A.shape=(548, 1092)
b.shape=(548,)
C.shape=(1228, 1092)
l.shape=(1228,)
u.shape=(1228,)

P.nnz=270
A.nnz=2182
C.nnz=1482
stephane-caron commented 1 year ago

Here is a minimal example. Decompress the matrix file in QGFRDXPN.zip, then run:

import proxsuite
import scipy.io as spio

m = spio.loadmat("QGFRDXPN.mat", squeeze_me=True)
P = m["P"].astype(float).tocsc()
q = m["q"].astype(float)
A = m["A"].astype(float).tocsc()
b = m["b"].astype(float)
C = m["C"].astype(float).tocsc()
l = m["l"].astype(float)
u = m["u"].astype(float)
proxsuite.proxqp.sparse.solve(P, q, A, b, C, l, u)
jcarpent commented 1 year ago

We should investigate a bit more this problem ...

fabinsch commented 1 year ago

With the dense solver backend and the following settings (notably rho = 1e-5)

backend = dense,
eps_abs = 2e-08 eps_rel = 0
eps_prim_inf = 0.0001, eps_dual_inf = 0.0001,
rho = 1e-05, mu_eq = 0.001, mu_in = 0.1,
max_iter = 10000, max_iter_in = 1500,
scaling: on, 
timings: on, 
initial guess: equality constrained initial guess

the problem is solved in 10149 iterations, run_time = 207.162 seconds and 254 mu_updates.

jcarpent commented 1 year ago

I confirm the check of @fabinsch. @Bambade Could you investigate this problem when you have time? I guess there is a difference between the two solvers mostly for the iterative refinement step. What do you think?