Contributor
WilliamZijieZhang

Boosting canonicalization performance by replacing N-dimensional sparse tensor representation


Mentors
sdiamond, Philipp Schiele, Riley Murray
Organization
NumFOCUS
Technologies
Python, Scipy
Topics
back-end, Canonicalization, Tensor Manipulations
(This project is for CVXPY) The performance of canonicalization procedures for optimization problems is an important metric for CVXPY users. Typically, this process is quite slow for large Disciplined Parametrized Programs(DPP). However, it is possible to improve upon the canonicalization by replacing the way 3D sparse tensors are represented. One of the major updates of CVXPY 1.3 was the addition of a SciPy backend, which allowed a performance speedup for certain types of optimization problems. This new backend offers an alternative to the original C++ backend implementation (CVXCORE), and enables easier development. The SciPy backend has some limitations especially when it comes to manipulating sparse tensors with 3 dimensions. The current representation of a 3D sparse tensor is to use a list of 2D matrices. However, a sparse tensor of large dimension could be represented as a single strided matrix, which can make CVXPY backend operations orders of magnitude more efficient.