proxsuite icon indicating copy to clipboard operation
proxsuite copied to clipboard

Time consumption VS OSQP(with MPC problem)

Open LiuisStupid opened this issue 2 years ago • 10 comments

Excuse me, In your paper it was shown that PROXQP should be faster than OSQP. But in my case, I need to solve a MPC question with state dim : 9 dim * X(editable) horizon , and inequality constraints with double size. when X = 25, PROXQP(all with vectorization speed up) takes about 1.1 ms while OSQP takes 1.6 ms, PROXQP is indeed faster. but when horizon X comes to 70+, OSQP is about 1.7 times faster than PROXQP. I want to know, if there are any approaches to speed up my PROXQP solver, for example finetuning( I have done something on that , which is shown in the image below). I really hope to replace OSQP with PROXQP, any suggestions would be appreciated.

Best regards

PRXOQP

LiuisStupid avatar Jun 06 '23 02:06 LiuisStupid

Hello @LiuisStupid, thank you for your interest in using ProxQP. It would be very helpful if you could share a more complete code snippet to understand your problem setup. Then we could check if you are using the API in the most beneficial way for your setup (dense vs sparse backend, warm start, init vs update, etc). Best regards

fabinsch avatar Jun 07 '23 07:06 fabinsch

@LiuisStupid Did you warm-start the solver with the previous solutions?

jcarpent avatar Jun 07 '23 12:06 jcarpent

You can also decrease the value of rho to something closed to 1e-8.

jcarpent avatar Jun 07 '23 12:06 jcarpent

@jcarpent @fabinsch Thanks for your reply, the problem im trying to solve is attached below, I hope I described clearly. The problem Im solving is a typical MPC problem. Now my question is , when the state dim is lower than 2000, PROXQP is faster, but when it comes to 2000+, OSQP will be a little bit faster than PROXQP. I guess with the increase of dim, the advantage of OSQP will be more obvious. For the setup you mentioned, I use sparse backend because my "H" matrix is a diagonal matrix, and I also tried with warm_start with the previous solutions, but it makes the time consumption even worse, so I banned it. For the other setup, everything I modified are shown in the image in my question above, all the others are default. If there are any others parameters I can modify to improve the time consumption problem? Thanks again and look forward to your reply.

Best regards 1111

LiuisStupid avatar Jun 08 '23 03:06 LiuisStupid

Could you provide your code to help us to improve the timings? Starting from the previous solutions should not give worst results.

jcarpent avatar Jun 08 '23 09:06 jcarpent

We are currently updating the solver to make it more efficiency, more stable and more adapted to robotics applications.

jcarpent avatar Jun 08 '23 09:06 jcarpent

Could you provide your code to help us to improve the timings? Starting from the previous solutions should not give worst results.

our code is hardware and sensors dependent, all the data are dynamic, so i'm not sure if it makes any sense to provide my PROXQP related code, because there is no real data included.

LiuisStupid avatar Jun 08 '23 12:06 LiuisStupid

Could you save two consecutive QP problems and share ?

jcarpent avatar Jun 08 '23 12:06 jcarpent

Could you save two consecutive QP problems and share ?

could you maybe leave me your email? If my leader allows, I could cut matrixes at two consecutive timestamps for you. but because the problem has 2000+ dimension, so I can not attach it here. maybe I could send the data in CSV form to you.

LiuisStupid avatar Jun 08 '23 12:06 LiuisStupid

[email protected] Thanks a lot.

jcarpent avatar Jun 08 '23 12:06 jcarpent