Fast Log-Domain Sinkhorn Optimal Transport with Warp-Level GPU Reductions
Organizations: ATLAS AI Lab
Abstract
Entropic regularized optimal transport (OT) via the Sinkhorn algorithm has become a fundamental tool in machine learning, yet existing implementations either suffer from numerical instability for small regularization parameters or incur significant overhead from deep learning frameworks. We present FastSinkhorn, a lightweight, native CUDA implementation of the log-domain Sinkhorn algorithm that combines warp-level shuffle reductions with shared-memory tiling to achieve high GPU utilization without sacrificing numerical stability. Our solver operates entirely in the log-domain, enabling robust computation for regularization parameters as small as epsilon = 10^{-4} where standard-domain methods fail. On dense OT problems with n = m = 8192, our implementation achieves 12x speedup over the widely-used POT library and 5.9x speedup over GPU-accelerated PyTorch baselines, while consuming only 256 MB of GPU memory. We validate our solver on image color transfer, 3D point cloud matching, and convergence analysis, demonstrating that native CUDA kernels with careful numerical treatment provide a practical and efficient foundation for large-scale optimal transport computation.
Figures & tables
| Method | ||||||
|---|---|---|---|---|---|---|
| POT (CPU) | 3.2 | 13.1 | 55.1 | 256.0 | 1097.2 | 4462.1 |
| GeomLoss (T4) | 37.1 | 24.1 | 23.5 | 80.0 | 304.8 | 1193.5 |
| PyTorch Sinkhorn (T4) | 10.5 | 10.3 | 36.6 | 135.9 | 533.5 | 2174.5 |
| Ours (RTX 3090) | 0.3 | 1.3 | 5.1 | 20.7 | 89.1 | 371.6 |
| Speedup vs. POT | 10.0 | 10.4 | 10.8 | 12.4 | 12.3 | 12.0 |
| Speedup vs. PyTorch | 32.4 | 8.2 | 7.2 | 6.6 | 6.0 | 5.9 |
| Configuration | Time (ms) | Slowdown |
|---|---|---|
| Full system (ours) | 14.8 | |
| Shared-memory only (no warp shuffle) | 28.5 | |
| Standard-domain (no log-LSE) † | 16.9 | |
| Block size = 64 (vs. 256) | 21.1 | |
| Block size = 128 | 16.7 | |
| Block size = 512 | 16.8 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Time (ms) | Iterations | Transport cost | Converged | ||
|---|---|---|---|---|---|
| 256 | 0.1 | 0.15 | 31 | 0.0413 | ✓ |
| 256 | 0.01 | 0.32 | 97 | 0.0395 | ✓ |
| 256 | 0.001 | 0.65 | 340 | 0.0391 | ✓ |
| 512 | 0.1 | 0.64 | 30 | 0.0391 | ✓ |
| 512 | 0.01 | 1.26 | 80 | 0.0366 | ✓ |
| 512 | 0.001 | 2.41 | 284 | 0.0406 | ✓ |
| Property | Value |
|---|---|
| Device | NVIDIA GeForce RTX 3090 |
| Compute capability | 8.6 |
| Streaming multiprocessors | 82 |
| CUDA cores | 10496 |
| Memory | 24 GB GDDR6X |
| Memory bandwidth | 936 GB/s |
Optimal Transport
Optimal transport compares and transforms probability distributions by finding low-cost ways to move mass between them.
See all 284 papers