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

Is a matrix-free implementaion available or planned? #179

Open
IlyaKull opened this issue Oct 7, 2021 · 2 comments
Open

Is a matrix-free implementaion available or planned? #179

IlyaKull opened this issue Oct 7, 2021 · 2 comments

Comments

@IlyaKull
Copy link

IlyaKull commented Oct 7, 2021

Greetings,

I have been using SCS 2.1.0 with YALMIP in Matlab to solve the small to medium instances of my SDP.
For the large instances, I simply don't have enough memory to store the matrix A (even though it is sparse and I am using a high memory node on an HPC cluster).
I would like to run a matrix-free implementation (providing A and A^T as function handles---this requires very little memory in my case).
I tried installing https://github.com/mfopt/mf_cvxpy and https://github.com/mfopt/mf_scs but couldn't get them to work (some files were missing in the installation process). I did not file an issue there as it looked like the repo was not being updated.

I am wondering if you plan to implement a matrix-free version in further releases (as far as I can tell from the documentation, the current version still requires A to be specified as a matrix and not passed as a function).

Many thanks for all the great work!

@bodono
Copy link
Member

bodono commented Oct 8, 2021

Currently just passing in a function pointer is not really supported. But you can hack it in by first following the instructions here to hack in the function pointer there, compiling SCS with -DNOVALIDATE and passing in NULL for A, then overwriting the methods accum_by_a and accum_by_atrans.

However, I'm surprised that the problem is so large that A cannot fit in memory but we can do the SDP projection step, which is usually much more expensive. Also in practice the indirect linear solver is quite slow, and without access to the matrix in order to do the equilibration / normalization step (which tries to balance the data) it can be even slower.

@IlyaKull
Copy link
Author

IlyaKull commented Oct 8, 2021

Thanks!
I will have a look at the hack you suggested.
My variables live in a product of small SDP cones so the projection can be done separately for each.

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