Bringing regularized optimal transport to lightspeed: a splitting method adapted for GPUs

Jacob Lindbäck, Zesen Wang, Mikael Johansson

Abstract

Optimal Transport (OT) is a fundamental tool in machine learning, yet practitioners often face a trade-off between the computational efficiency of entropic regularization (Sinkhorn) and the precision of alternative regularizers. We present RDROT (Regularized Douglas-Rachford Optimal Transport), a novel algorithm that leverages Douglas-Rachford splitting and custom GPU kernels to achieve significant speedups. RDROT provides a flexible framework for structured, sparse, and quadratic regularization, outperforming state-of-the-art solvers by up to two orders of magnitude while maintaining the high-quality, sparse transportation plans required for complex tasks like domain adaptation and generative modeling.

1. Introduction

Optimal Transport (OT) provides a robust mathematical framework for comparing probability distributions, with applications ranging from domain adaptation to generative adversarial networks (GANs). Despite its utility, the computational cost of solving the standard OT problem has historically been a bottleneck. The introduction of the Sinkhorn algorithm revolutionized the field by using entropic regularization to enable fast, GPU-accelerated computation. However, entropic regularization introduces a "blurring" bias, often failing to produce the sparse or structured transportation plans necessary for high-precision tasks.

While alternative regularizers—such as Quadratic or Group Lasso—offer better structural properties, they are notoriously difficult to solve efficiently at scale. Most existing solvers for these regularizers do not parallelize well on modern hardware, leaving researchers to choose between a fast-but-blurry Sinkhorn and a slow-but-precise alternative. RDROT addresses this gap, providing a solver that matches the speed of Sinkhorn while supporting a much broader class of regularizers.

2. The RDROT Algorithm

The core of the RDROT algorithm is the application of Douglas-Rachford (DR) splitting to the regularized OT problem. DR splitting decomposes a complex optimization problem into smaller, simpler "proximal" steps that can be solved independently.

2.1 Mathematical Framework

The authors demonstrate that for a wide class of sparsity-promoting regularizers, the proximal steps are computationally inexpensive and highly parallelizable. A significant theoretical contribution of this work is the proof of global convergence. Furthermore, the algorithm exhibits a "local linear convergence rate"—it accelerates significantly once it identifies the correct sparsity pattern of the solution, a phenomenon the authors refer to as the "sparsity identification" moment.

2.2 GPU Optimization and Integration

To achieve "lightspeed" performance, the researchers developed custom CUDA kernels specifically for quadratic and group-lasso regularization. These kernels utilize coalesced memory access to minimize latency and maximize throughput on the GPU, ensuring the hardware is never idling while waiting for data. To ensure accessibility for the broader machine learning community, RDROT includes wrappers for PyTorch and TensorFlow, allowing it to be integrated directly into deep learning pipelines via backpropagation.

3. Experimental Evaluation

The efficacy of RDROT was evaluated across three distinct domains: synthetic benchmarks, domain adaptation, and generative modeling.

3.1 Computational Performance

On synthetic datasets ranging from $1000 \times 1000$ to $10000 \times 10000$, RDROT consistently outperformed L-BFGS, a common quasi-Newton solver. For quadratically regularized OT, RDROT was at least one order of magnitude faster, reaching up to 100x speedups on larger problem instances. The per-iteration cost remains comparable to the Sinkhorn algorithm, making it a viable high-performance alternative.

3.2 Domain Adaptation and Sparsity

In domain adaptation tasks, the choice of regularizer is critical. Unlike entropic regularization, which forces every point to have a tiny connection to every other point (creating "blur"), RDROT handles regularizers that naturally promote sparsity. Using Group Lasso regularization, RDROT avoided the "shrinking" effect common in Sinkhorn-based adaptation, resulting in more accurate and interpretable mappings between datasets.

3.3 Generative Modeling

RDROT was employed as a loss function (Minibatch Energy Distance) to train GANs on the MNIST and CIFAR10 datasets. The algorithm proved robust enough for the demanding environment of neural network training, producing sharp, recognizable images that demonstrate its utility in deep learning applications.

4. Discussion and Limitations

RDROT successfully breaks the "Sinkhorn monopoly" by proving that researchers do not have to sacrifice structural flexibility for GPU speed. By combining the mathematical rigor of DR splitting with hardware-specific optimizations, RDROT provides the best of both worlds: precision and performance.

However, several avenues for future research remain:

  • Initialization: While a smart initialization strategy is proposed to skip early "empty" iterations, further improvements could link the start state to dual potentials.
  • Stepsize Tuning: The current implementation suggests a default stepsize ($\rho = 2(m+n)^{-1}$), but adaptive tuning could yield further performance gains.
  • Memory Constraints: Like most OT solvers, the method requires storing large matrices, which remains a bottleneck for extremely high-dimensional data.

5. Conclusion

RDROT represents a significant advancement in the field of Optimal Transport. By bringing regularized OT to "lightspeed," it opens the door for more sophisticated and precise distribution matching in large-scale machine learning applications.

Code Availability: The implementation is open-source and available on GitHub.

Summary updated

BibTeX
@inproceedings{lindback2023bringing,
  author = {Jacob Lindbäck and Zesen Wang and Mikael Johansson},
  title = {{Bringing regularized optimal transport to lightspeed: a splitting method adapted for GPUs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=bmdnWIuypV},
}
Figure