FlashSinkhorn: IO-Aware Entropic Optimal Transport
Felix X. -F. Ye, Xingjie Li, An Yu, Ming-Ching Chang, Linsong Chu, Davis Wertheimer
TL;DR
FlashSinkhorn introduces an IO-aware GPU solver for Entropic OT with squared Euclidean cost by recasting stabilized Sinkhorn updates as row-wise LogSumExp reductions of biased dot-product scores, enabling online, fused streaming kernels that avoid materializing the dense $n \times m$ score matrix. By leveraging FlashAttention-style tiling and SRAM-based online normalization, it reduces high-bandwidth memory traffic while preserving linear memory in $O((n+m)d)$ and achieving substantial speedups (up to $32\times$ forward and $161\times$ end-to-end) on A100 GPUs. The approach includes streaming Hessian–vector products for second-order optimization and a streaming transport-application operator that yields $P^*V$ without forming $P^*$. Empirical results across synthetic benchmarks and OT-driven downstream tasks demonstrate improved scalability for point-cloud OT, OTDD, and regression problems, with competitive accuracy and reduced memory footprints. This work significantly advances practical, large-scale EOT by combining IO-aware numerical reductions with end-to-end differentiable streaming kernels, though it currently focuses on the squared Euclidean cost and leaves general cost extensions for future work.
Abstract
Entropic optimal transport (EOT) via Sinkhorn iterations is widely used in modern machine learning, yet GPU solvers remain inefficient at scale. Tensorized implementations suffer quadratic HBM traffic from dense $n\times m$ interactions, while existing online backends avoid storing dense matrices but still rely on generic tiled map-reduce reduction kernels with limited fusion. We present \textbf{FlashSinkhorn}, an IO-aware EOT solver for squared Euclidean cost that rewrites stabilized log-domain Sinkhorn updates as row-wise LogSumExp reductions of biased dot-product scores, the same normalization as transformer attention. This enables FlashAttention-style fusion and tiling: fused Triton kernels stream tiles through on-chip SRAM and update dual potentials in a single pass, substantially reducing HBM IO per iteration while retaining linear-memory operations. We further provide streaming kernels for transport application, enabling scalable first- and second-order optimization. On A100 GPUs, FlashSinkhorn achieves up to $32\times$ forward-pass and $161\times$ end-to-end speedups over state-of-the-art online baselines on point-cloud OT, improves scalability on OT-based downstream tasks. For reproducibility, we release an open-source implementation at https://github.com/ot-triton-lab/ot_triton.
