Solving SDP problem is 100x slower than Matlab CVX

On my mac, Hypatia.jl code above solves the original problem in ~3 seconds which is good enough for my purposes. Thank you very much!

For the approach using Dualization.jl, I’m getting roughly 9 seconds, but it seems to be solving to greater accuracy than Matlab’s CVX.

function julia_dual(Sigma::Matrix)
    p = size(Sigma, 1)
    svar = Variable(p)
    problem = maximize(sum(svar), svar ≥ 0, 1 ≥ svar, 2*Sigma - Diagonal(svar) == Semidefinite(p))
    solve!(problem, Dualization.dual_optimizer(SCS.Optimizer))
    return evaluate(svar)
end
@time s_dual = julia_dual(Sigma) # compile
@time s_dual = julia_dual(Sigma)

  9.215603 seconds (2.61 M allocations: 222.878 MiB, 0.49% gc time, 0.32% compilation time)
 11.798738 seconds (2.53 M allocations: 218.782 MiB, 0.38% gc time)
------------------------------------------------------------------
	       SCS v3.0.0 - Splitting Conic Solver
	(c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 80401, constraints m: 60701
cones: 	  z: primal zero / dual free vars: 40201
	  l: linear vars: 400
	  s: psd vars: 20100, ssize: 1
settings: eps_abs: 1.0e-04, eps_rel: 1.0e-04, eps_infeas: 1.0e-07
	  alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
	  max_iters: 100000, normalize: 1, warm_start: 0
	  acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct
	  nnz(A): 121201, nnz(P): 0
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.25e+01  2.00e+00  1.50e+04 -7.12e+03  1.00e-01  2.68e-02 
   250| 4.05e-03  2.54e-04  1.95e-02  1.73e+02  1.00e-01  4.25e+00 
   475| 1.72e-04  2.62e-04  8.63e-03  1.72e+02  1.02e+00  8.69e+00 
------------------------------------------------------------------
status:  solved
timings: total: 8.82e+00s = setup: 1.28e-01s + solve: 8.69e+00s
	 lin-sys: 1.07e+00s, cones: 7.06e+00s, accel: 8.35e-02s
------------------------------------------------------------------
objective = 172.107787
------------------------------------------------------------------
------------------------------------------------------------------
	       SCS v3.0.0 - Splitting Conic Solver
	(c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 80401, constraints m: 60701
cones: 	  z: primal zero / dual free vars: 40201
	  l: linear vars: 400
	  s: psd vars: 20100, ssize: 1
settings: eps_abs: 1.0e-04, eps_rel: 1.0e-04, eps_infeas: 1.0e-07
	  alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
	  max_iters: 100000, normalize: 1, warm_start: 0
	  acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct
	  nnz(A): 121201, nnz(P): 0
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.25e+01  2.00e+00  1.50e+04 -7.12e+03  1.00e-01  3.85e-02 
   250| 4.05e-03  2.54e-04  1.95e-02  1.73e+02  1.00e-01  5.77e+00 
   475| 1.72e-04  2.62e-04  8.63e-03  1.72e+02  1.02e+00  1.11e+01 
------------------------------------------------------------------
status:  solved
timings: total: 1.13e+01s = setup: 1.88e-01s + solve: 1.11e+01s
	 lin-sys: 1.38e+00s, cones: 9.03e+00s, accel: 1.04e-01s
------------------------------------------------------------------
objective = 172.107787
------------------------------------------------------------------

I will try to see how to adjust convergence tolerance

2 Likes