robotology / osqp-eigen

Simple Eigen-C++ wrapper for OSQP library
https://robotology.github.io/osqp-eigen/
BSD 3-Clause "New" or "Revised" License
385 stars 114 forks source link

Any plan to support cuosqp? #92

Closed ZhenshengLee closed 3 years ago

ZhenshengLee commented 3 years ago

Hi everyone,

osqp for cuda has been released for a year.

It provides python api and the backend is a branch of osqp main repo.

Any plan to support cuosqp?

thanks.

S-Dafarra commented 3 years ago

Hi @ZhenshengLee, thanks for opening the issue. osqp-eigen is meant to be an interface to use osqp in C++ using eigen objects. If you are interested in the python API I would suggest to use directly the one provided with osqp.

For what concerns the cuda support, I think we never tested it on our side. On the other hand, as far as I understood, osqp started supporting cuda as backend, although it has not properly released yet. I think you can still install osqp with the cuda support, and keep using osqp-eigen normally since the API should not have changed. In any case, this is mainly a supposition of mine, since we did not test this workflow yet.

Feel free to comment or to open a specific issue if the current implementation of osqp-eigen prevents the use of osqp with cuda.

traversaro commented 3 years ago

To complement what @S-Dafarra wrote, I think a prerequisite of supporting/documenting explicitly this use case is that the use of OSQP with CUDA via the C interface is explicitly documented/supported in a released (i.e. listed in https://github.com/oxfordcontrol/osqp/releases) version of OSQP, I do not know if that is already the case or it is planned, perhaps @gbanjac or @bstellato are the right person to ask (I guess that the corresponding OSQP upstream issue is https://github.com/oxfordcontrol/osqp/issues/30 ).

gbanjac commented 3 years ago

CUDA support for OSQP implemented in cuda-1.0 branch is not a part of any official release yet. It was built on top of develop-1.0 branch that allows an easy transition between different implementations of linear algebra. OSQP with CUDA will be documented and supported once we have OSQP 1.0 version released. We don't know right now when this will happen.

traversaro commented 3 years ago

Thanks a lot for the quick response @gbanjac .

ZhenshengLee commented 3 years ago

Feel free to comment or to open a specific issue if the current implementation of osqp-eigen prevents the use of osqp with cuda.

some data structure has been changed due to cuda interface

I think a prerequisite of supporting/documenting explicitly this use case is that the use of OSQP with CUDA via the C interface is explicitly documented/supported in a released

I understand that the version of cuda was not released, and the api may not be stable, even I guess the development of this branch was stopped after the paper was published.

The cuda branch of code is still experimental, but with impressive speed up in some usecases.

May be we should add some #ifdef CUOSQP_SUPPORT codes?

I will have a try first.

thanks!

S-Dafarra commented 3 years ago

I am not sure if those differences are functional, or the result of a divergence between the released version and the cuda branch. In this case, maintaining the interface to be compatible with both versions would be problematic.

I think we will wait for the official release before supporting it as well.

ZhenshengLee commented 3 years ago

I think we will wait for the official release before supporting it as well.

Understood, thanks!