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

Accuracy issues with batches #32

Open
PaulR-S opened this issue Nov 21, 2019 · 3 comments
Open

Accuracy issues with batches #32

PaulR-S opened this issue Nov 21, 2019 · 3 comments

Comments

@PaulR-S
Copy link

PaulR-S commented Nov 21, 2019

Hi,
I am using the qpth solver to solve many qp's (i.e. core price computations) as batches in parallel. Now, comparing the prices (resulting variables) with the ones I receive from gurobi shows that the ones from qpth differ quite a bit (see below). It seems like this is more likely to happen with a batch size > 1.

image

I tried to use float and double as well as cpu and gpu. The result of qpth is always the same (or at least very similar).
I also compared the result from cvxpylayer to gurobi and they are very close.

This is what I get when setting verbose to True

image

Do you know why the accuracy is so bad and how it can be improved?
I'm using pytorch 1.3.0., qpth 0.0.15, gurobi 8.1.1.
Thanks.

@bamos
Copy link
Member

bamos commented Nov 21, 2019

Hmm, for your problem here, how is the speed in comparison to cvxpylayers? I've been thinking about deprecating this repo and pointing everybody to cvxpylayers

@PaulR-S
Copy link
Author

PaulR-S commented Nov 22, 2019

Cvxpylayers allows batches, however, not on the GPU but CPU only, correct? For the setting I ran, cvxpylayers was significantly slower, in fact it was slower than parallelizing the batch over multiple CPU's and solving each with Gurobi.

@bamos
Copy link
Member

bamos commented Nov 22, 2019

Cvxpylayers allows batches, however, not on the GPU but CPU only, correct? For the setting I ran, cvxpylayers was significantly slower, in fact it was slower than parallelizing the batch over multiple CPU's and solving each with Gurobi.

Hmm, I think we if we add in support for other solvers to cvxpylayers we can outperform qpth by using OSQP, for example. I've added an issue to cvxpylayers you can use to track our development on here -- and if you have some bandwidth you are welcome to help out with the development there to get this in faster: cvxgrp/cvxpylayers#28

\cc @bstellato @sbarratt @akshayka

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

2 participants