Abstract: We introduce a convex optimization modeling framework that transforms a convex optimization problem expressed in a form natural and convenient for the user into an equivalent cone program in a way that preserves fast linear transforms in the original problem. By representing linear functions in the transformation process not as matrices, but as graphs that encode composition of linear operators, we arrive at a matrix-free cone program, i.e., one whose data matrix is represented by a linear operator and its adjoint. This cone program can then be solved by a matrix-free cone solver. By combining the matrix-free modeling framework and cone solver, we obtain a general method for efficiently solving convex optimization problems involving fast linear transforms.
Introduction
Convex optimization modeling systems such as CVXPY and CVX have become indispensable tools for researchers, allowing them to specify complex optimization problems in a high-level, human-readable format. However, these systems traditionally encounter a "scaling wall." To communicate with standard solvers, they must canonicalize the user's mathematical expressions into standard cone programs where all linear relationships are represented as explicit, sparse matrices.
In domains like image processing and medical imaging, problems frequently involve operators such as the Discrete Fourier Transform (DFT) or convolution. While these operators are mathematically linear, representing them as explicit matrices is computationally prohibitive. For instance, a convolution that takes $O(n \log n)$ time to compute would require an $O(n^2)$ matrix to store. Consequently, traditional modeling systems struggle with problems exceeding a few thousand variables, whereas specialized "matrix-free" algorithms can handle millions. This research introduces a framework that brings matrix-free efficiency to general-purpose convex modeling.
Methodology
The core contribution of this work is a new approach to canonicalization that preserves the structure of fast linear transforms. Instead of flattening expressions into matrices, the framework utilizes two primary abstractions:
- Forward-Adjoint Oracles (FAOs): Rather than storing a matrix $A$, the system uses an FAO—a computational routine capable of evaluating both the forward function $f(x) = Ax$ and its adjoint $f^*(y) = A^T y$.
- FAO Directed Acyclic Graphs (DAGs): Complex linear expressions are represented as DAGs where each node is a simple FAO (e.g., a sum, a crop, or an FFT). This allows the system to compose operations without ever explicitly forming a single large matrix.
Automatic Adjoint Generation and Solving
A critical technical insight is the automatic generation of adjoints. If a DAG exists for a function $f$, the system can automatically generate the DAG for its adjoint $f^*$ by reversing the edges and replacing each node with its corresponding adjoint operator.
To solve these problems, the authors modified existing first-order solvers, specifically SCS and POGS, to accept FAO DAGs instead of traditional matrices. This allows the solver's internal iterations to leverage fast transforms. Additionally, the framework employs a graph-coloring heuristic to minimize the memory footprint of intermediate arrays during DAG evaluation, effectively solving a register-allocation problem for optimization variables.
Experimental Evaluation
The framework was evaluated using large-scale benchmarks designed to test scaling limits:
- Nonnegative Deconvolution: A signal reconstruction problem using Gaussian kernels, scaled from $10^2$ to $10^7$ variables.
- Sylvester Linear Programs: Common in control theory, these involve matrix variables and Kronecker products, which typically lead to very large, structured matrices.
Key Results
The matrix-free approach demonstrated significant performance gains over traditional methods:
- Scaling Efficiency: On the nonnegative deconvolution task, traditional interior-point solvers (like ECOS) exhibited $O(n^3)$ scaling, failing beyond $n=10^4$. In contrast, the matrix-free approach scaled at approximately $O(n \log n)$, successfully solving problems with $10^7$ variables on a single machine.
- Speedup: For Sylvester LPs with $n \approx 10^5$, the matrix-free version of SCS was nearly 100x faster than traditional ECOS.
- Hardware Acceleration: By utilizing the matrix-free POGS solver, the authors demonstrated that FAO DAGs can be mapped to GPUs. This resulted in nearly constant solve times for problems up to $n=10^5$ due to the massive parallelism inherent in the underlying transforms.
Discussion and Limitations
While the matrix-free framework offers a path to solving massive problems, it relies primarily on first-order optimization algorithms. These algorithms scale excellently but often require more iterations to reach high precision compared to second-order interior-point methods. Furthermore, for very small problems, the overhead of managing the DAG and launching computational kernels (especially on GPUs) can exceed the cost of simple sparse matrix multiplication.
Future work involves increasing the robustness of matrix-free solvers to make them as "plug-and-play" as current matrix-based solvers. Nevertheless, this framework bridges the gap between the convenience of high-level modeling and the performance of specialized large-scale algorithms, enabling the solution of optimization problems that were previously inaccessible to general-purpose modeling languages.
Summary updated