cuda OSQP examples #681
-
|
I was looking for resources to find examples where the CUDA back-end beats the CPU, unfortunately couldn't find any. I was wondering if anyone could provide examples/code for such problems. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 23 replies
-
|
@Eqedos - the repo osqp-benchmarks has a lot of sample problems. In particular, the A sample standalone script representing the Running on my local machine gives me: |
Beta Was this translation helpful? Give feedback.
-
|
Thank you! very helpful. Are there perhaps classes of problems the cuda OSQP backend can't solve at all or does not converge on? I've tried solving a reasonably small problem, and cuda osqp does not converge via CVXPY. I was wondering if CVXPYs canonicalization had anything to do with it, or perhaps it's the type of problem. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, @vineetbansal , Just a follow-up, I wonder if the api has changed recently? I can not run the example you posted here since Traceback (most recent call last):
File "/home/user/test_osqp.py", line 100, in <module>
solvers = [OSQP(algebra="builtin"), OSQP(algebra="cuda")]
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: OSQP.__init__() got an unexpected keyword argument 'algebra'Maybe I should use the latest code from github? I would appreciate it very much if anyone could help me here. |
Beta Was this translation helpful? Give feedback.
-
|
@rydeveraumn - it appears that the GPU is invisible to cuda toolkit. Look at discussion 738 and see if it helps in your case. |
Beta Was this translation helpful? Give feedback.


@Eqedos - the repo osqp-benchmarks has a lot of sample problems. In particular, the
Huberclass of problems benefit from the CUDA backend, for higher dimensions of problems. See a benchmark graphic below (blue is built-in backend, orange is cuda backend):A sample standalone script representing the
Huberproblem would be: