Skip to content
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

Time consumption VS OSQP(with MPC problem) #227

Open
LiuisStupid opened this issue Jun 6, 2023 · 10 comments
Open

Time consumption VS OSQP(with MPC problem) #227

LiuisStupid opened this issue Jun 6, 2023 · 10 comments

Comments

@LiuisStupid
Copy link

LiuisStupid commented Jun 6, 2023

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

@fabinsch
Copy link
Collaborator

fabinsch commented Jun 7, 2023

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

@jcarpent
Copy link
Member

jcarpent commented Jun 7, 2023

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

@jcarpent
Copy link
Member

jcarpent commented Jun 7, 2023

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

@LiuisStupid
Copy link
Author

LiuisStupid commented Jun 8, 2023

@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

@jcarpent
Copy link
Member

jcarpent commented Jun 8, 2023

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

@jcarpent
Copy link
Member

jcarpent commented Jun 8, 2023

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

@LiuisStupid
Copy link
Author

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.

@jcarpent
Copy link
Member

jcarpent commented Jun 8, 2023

Could you save two consecutive QP problems and share ?

@LiuisStupid
Copy link
Author

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.

@jcarpent
Copy link
Member

jcarpent commented Jun 8, 2023

[email protected] Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants