Optimization for Classical Machine Learning Problems on the GPU

Sören Laue, Mark Blacher, Joachim Giesen

Abstract

While deep learning has flourished on GPUs, classical machine learning algorithms with constraints have largely remained CPU-bound. This paper presents a GPU-efficient implementation of the L-BFGS-B algorithm that overcomes the sequential bottlenecks of traditional methods. By utilizing a working set approach and integrating with the GENO framework, the proposed solver achieves speedups of several orders of magnitude over existing state-of-the-art GPU solvers.

Introduction

The success of deep learning is inextricably linked to the availability of high-performance GPU kernels for unconstrained optimization. However, many classical machine learning models—such as Support Vector Machines (SVMs) and fairness-constrained logistic regression—require solving optimization problems with box constraints or linear equalities. The standard algorithm for these problems, L-BFGS-B, is notoriously difficult to parallelize due to its sequential Cauchy point calculation. Consequently, standard GPU implementations of L-BFGS-B often fail to outperform CPU versions.

Methodology

To address these limitations, we propose a modified L-BFGS-B algorithm designed for massive parallelism:

  1. Working Set Strategy: We replace the sequential Cauchy point search with a working set approach. In each iteration, variables are partitioned into those at their boundaries and "free" variables. This allows the underlying quasi-Newton system to be solved in parallel across GPU cores.
  2. Projection-Based Search: Instead of scalar-heavy line searches, we employ a projection step to maintain feasibility, combined with a parallelizable backtracking line search satisfying the Armijo condition.
  3. Augmented Lagrangian: For general constraints beyond simple box bounds, the solver is embedded within an Augmented Lagrangian framework.
  4. Automatic Code Generation: The solver is integrated into the Generic Optimization (GENO) framework, which generates optimized Python/CuPy code from high-level mathematical specifications, eliminating the need for manual CUDA programming.

Experimental Results

We evaluated the proposed solver on several benchmark tasks, including fairness-constrained logistic regression and dual SVM problems.

Fairness in Machine Learning

We applied the solver to logistic regression with fairness constraints using the Adult and Census-income datasets. As shown in Figure 1, the proposed GPU solver consistently outperforms existing baselines like Fairlearn and SCS GPU, often by multiple orders of magnitude.

Training times for logistic and linear constraints on Adult and Census datasets. The proposed GPU solver significantly outperforms Fairlearn and SCS GPU.

Support Vector Machines

The performance gains are equally pronounced for dual SVM problems. On the Adult dataset (a1a-a8a), our solver demonstrated a 100x speedup over cuOSQP and nearly a 1000x speedup over SCS GPU.

Performance comparison on dual SVM problems. The proposed method (blue) maintains a significant lead over cuOSQP and SCS GPU as the number of samples (n) increases.

Conclusion

This work demonstrates that with appropriate algorithmic modifications, classical machine learning can benefit from GPU acceleration as much as deep learning. By removing sequential bottlenecks in L-BFGS-B and leveraging automatic code generation through GENO, we provide a path for scaling constrained optimization to massive datasets. Future work will explore extending this framework to non-differentiable objectives and evolving hardware architectures.

Summary updated

BibTeX
@inproceedings{laue2022optimization,
  author = {Sören Laue and Mark Blacher and Joachim Giesen},
  title = {{Optimization for Classical Machine Learning Problems on the GPU}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i7.20692},
}
Figure