scs icon indicating copy to clipboard operation
scs copied to clipboard

Save the result of each iteration for shutdown robustness

Open IgnacioRubioScola opened this issue 8 years ago • 1 comments

I'm solving pretty huge problems with CVXPY and SCS using the GPU (1-2M variables and about 2-3 days calculation on a GTX 970), i want to know if there exist any possibility to save the state after each iteration to resume the optimization in case of shutdown. Thank you in advance.

IgnacioRubioScola avatar Mar 05 '17 22:03 IgnacioRubioScola

Right now there isn't really a good way to automatically checkpoint the state of the algorithm. Your best bet is to do something along the following lines:

  1. Get CVXPY to give you the canonical cone form of the problem, it has an api to do that: http://www.cvxpy.org/en/latest/tutorial/advanced/#getting-the-standard-form
  2. Call SCS from python directly with the standard form data with relatively small max_iters.
  3. SCS will return the 'best guess' after that many iterations (hopefully it will be feasible, if not you have to increase the number of max_iters), at which point you can save everything to disk.
  4. Feed back in the 'best guess' as a warm start using functionality here https://github.com/cvxgrp/scs/blob/master/python/scs.py#L28 (basically adding x,y,s as probdata), which should continue from where it left off.
  5. Do this a few times until convergence.
  6. At the end, invert the canonicalization via CVXPY.

bodono avatar Mar 06 '17 10:03 bodono