cvxgrp / scs

Splitting Conic Solver
MIT License
545 stars 134 forks source link

Optimization is not solved because of "FATAL: syev failure, info = -5" #238

Closed fraricca closed 7 months ago

fraricca commented 1 year ago

Good evening, I am currently trying to solve an optimization problem with the solver scs (I am currently using it inside the YALMIP toolbox) but at the first iteration I get the following output:

------------------------------------------------------------------
           SCS v3.2.0 - Splitting Conic Solver
    (c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 7708, constraints m: 12772
cones:    z: primal zero / dual free vars: 4368
      l: linear vars: 1584
      q: soc vars: 6820, qsize: 3
      s: psd vars: 0, ssize: 1
settings: eps_abs: 1.0e-04, eps_rel: 1.0e-04, eps_infeas: 1.0e-07
      alpha: 1.50, scale: 5.00e+00, adaptive_scale: 1
      max_iters: 2500, normalize: 1, rho_x: 1.00e-03
      acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct
      nnz(A): 24362733, nnz(P): 0
FATAL: syev failure, info = -5
ERROR: init_cone failure
Failure:could not initialize work

I have tried to fix this issue by myself but I have not found anything related to this problem.

bodono commented 1 year ago

It looks like an issue with type sizes, do you know 1) what size integer SCS is compiled with and 2) what size integer your BLAS/LAPACK lib is compiled with? The two should match.

bodono commented 1 year ago

If that's not it then feel free to send me the data dump following the instructions here: https://www.cvxgrp.org/scs/help/index.html

fraricca commented 1 year ago

Good morning, basically by using YALMIP the only parameters that I can set are: alpha: 1.5000 rho_x: 1.0000e-03 max_iters: 2500 eps: 1.0000e-03 normalize: 1 scale: 5 cg_rate: 2 eliminateequalities: 0 gpu: 0 So I do not know how to check the size integer of SCS and BLAS/LAPACK lib and I can't even send you the data dump. Do you know any other way in which I can check it?

bodono commented 1 year ago

If you can edit the point at which yalmip calls SCS you can pass the arg in there. Otherwise I'm not sure what's going on. I think YALMIP is matlab only, right? If so SCS should be 64 bit ints and mwlapack/mwblas should be 64 bit ints too. The matlab tests appear to be passing (on ubuntu anyway): https://github.com/bodono/scs-matlab

robertgj commented 7 months ago

I am using scs-matlab,scs-3.2.3, octave-10.0.0 and YALMIP on Fedora39. I think this problem occurs because in src/cones.c : set_up_sd_cone_work_space(), n_max==0 is passed to dsyev.f as both the third argument, N, and the fifth argument, LDA. The in-line documentation for dsyev.f says that for argument 5, LDA>=max(1,N). I seem to have fixed this by initialising n_max to 1.

bodono commented 7 months ago

Thanks @robertgj ! I created a pull request with that change. Does this look right?

robertgj commented 7 months ago

Yes, that is what I did.

bodono commented 7 months ago

Thanks!