cvxgrp/cvxpylayers

Segmentation Fault for Minimization Problem

jusevitch opened this issue · 0 comments

I'm getting a segmentation fault when running the following MWE using cvxpylayers:

import jax
import jax.numpy as jnp
import cvxpy as cp
from cvxpylayers.jax import CvxpyLayer


if __name__ == "__main__":

    v1 = jnp.array([
        [1., 1.],
        [1., 3.],
        [3., 3.],
        [3., 1.]
    ])
    t = 1.0

    th_x = cp.Variable((4, 1), name="th_x")
    V_x = cp.Parameter((4, 2), name="V_x")

    problem = cp.Problem(
        cp.Minimize(cp.norm(V_x.T @ th_x)),
        [
            cp.log_sum_exp(cp.hstack((0, t*cp.sum(th_x))))/t <= 1 + cp.log(2)/t,
        ]
    )
    cvxpylayer = CvxpyLayer(
        problem,
        parameters = [V_x],
        variables=[th_x]
    )
    
    th_xstar = cvxpylayer(v1)

Output:

Segmentation fault (core dumped)

System information:

  • Ubuntu 22.04
  • cvxpy version 1.5.3
  • cvxpylayers version 0.1.6
  • JAX version 0.4.33