embotech/ecos

Massive RAM in moderate problem

Opened this issue · 0 comments

I have an example of a moderately sized problem which consumes massive RAM memory. I have no idea why this happens. Is there something inherently difficult to this kind of problem? Or is this a bug in ECOS?

I am using ECOS through Convex.jl, ECOS.jl, in Julia. I'm sorry if some people here aren't familiar with Julia. Hopefully someone else can translate this to other language if needed.

To run this code, you need to load the variables N, Adj from the .jld2 file (using JLD2.jl) here:

https://github.com/cossio/cvx_example_data

N is an float 3-dimensional Array, and Adj a sparse matrix.

WARNING: The following code took so much memory that I had to reboot my laptop. Run this in a contained environment where you can constrain memory consumption.

x = Variable(2730)
S, V, T = size(N)
lN = log.(N)
M = vec(sum(N[:,:,2:T]; dims=(2,3)))
H = Adj * x
problem = maximize(-sum(logsumexp(lN[:,v,t] - H) for t = 1:T-1, v = 1:V) - dot(M, H), [x  -1e2, x  1e2])  
solve!(problem, ECOSSolver())  # huge RAM consumption here

I originally reported this here: jump-dev/Convex.jl#254.
But now I realize it's an issue with the solver.