FlashSinkhorn: IO-Aware Entropic Optimal Transport

Felix X.-f. Ye, Xingjie Li, An Yu, Ming-Ching Chang, Linsong Chu, Davis Wertheimer

Sure, here's a blog-style summary of the paper "FlashSinkhorn: IO-Aware Entropic Optimal Transport":

TL;DR

This paper introduces FlashSinkhorn, a novel GPU-optimized algorithm for Entropic Optimal Transport (EOT) that significantly speeds up computations by minimizing data movement between GPU memory. It achieves up to 161x speedups over existing methods, making large-scale EOT practical for various machine learning tasks.

What Problem Does This Paper Address?

Entropic Optimal Transport (EOT) is a powerful tool in machine learning, used in areas like generative modeling and data alignment. However, existing GPU implementations of EOT, particularly those using Sinkhorn iterations, are often inefficient at scale. This is primarily due to the massive amount of data that needs to be moved between different levels of GPU memory (HBM and SRAM). Tensorized methods store dense matrices, leading to quadratic memory traffic, while online methods, though avoiding dense storage, still rely on generic kernels that lack efficient fusion and tiling. This computational bottleneck limits the practical application of EOT in large-scale, high-dimensional problems.

Methods

FlashSinkhorn tackles this by reformulating stabilized log-domain Sinkhorn updates as row-wise LogSumExp (LSE) reductions, similar to how attention mechanisms are computed in models like transformers. This allows FlashSinkhorn to leverage techniques from FlashAttention, enabling:

  • IO-Aware Tiling and Fusion: Fused Triton kernels stream data tiles through on-chip SRAM, performing computations like cost calculation and dual potential updates in a single pass. This drastically reduces the need to write intermediate results back to slower HBM.
  • Streaming Kernels: The algorithm provides streaming kernels for both the core Sinkhorn iterations and for applying the transport matrix, which are crucial for downstream tasks like optimization and differentiation.
  • Attention-Form Reformulation: By rewriting EOT updates in an attention-like form, FlashSinkhorn can reuse optimized kernels and techniques from the highly efficient FlashAttention library.

Datasets

The paper evaluates FlashSinkhorn on:

  • Synthetic benchmarks: Used to compare performance against existing methods like GeomLoss and OTT-JAX.
  • MNIST and Fashion-MNIST datasets: Used for the OTDD (Optimal Transport Dataset Distance) application, employing ResNet18 embeddings (d=512).
  • Cornell Flow Cytometry dataset: Used for demonstrating saddle escape detection in OT-based regression.

Key Insights and Ideas

  • Memory Bandwidth is the Bottleneck: The paper strongly emphasizes that for EOT on GPUs, the primary performance limitation is not computation but the slow movement of data between HBM and SRAM.
  • Leveraging Attention Kernels for EOT: The core insight is that the mathematical structure of EOT updates can be mapped to the structure of attention computations, allowing for the reuse of highly optimized IO-aware kernels.
  • Fusion is Key for Efficiency: By fusing multiple operations (score computation, bias addition, LSE reduction) into a single kernel, FlashSinkhorn avoids costly intermediate memory writes and kernel launch overheads.
  • Scalability Through IO-Awareness: The IO-aware approach allows FlashSinkhorn to scale to much larger problem sizes (e.g., n=50,000) where other methods run out of memory or become prohibitively slow.

Key Results

  • Significant Speedups: FlashSinkhorn achieves up to 32x forward-pass and 161x end-to-end speedups over state-of-the-art online baselines on point-cloud OT.
  • Improved Scalability: The method demonstrates superior memory efficiency, maintaining linear memory growth (O(nd)) compared to the quadratic growth (O(n²)) of tensorized methods, enabling runs at n=50,000 where others OOM.
  • Efficient Second-Order Methods: The streaming Hessian-vector product (HVP) implementation enables practical second-order optimization at scales previously infeasible.
  • Practical Applications: FlashSinkhorn enables faster and more scalable OTDD computations and saddle escape detection in OT-based regression.

Limitations and Future Work

  • Cost Function Limitations: The current fused kernels are optimized for squared Euclidean cost and similar forms. Extending this fused-streaming approach to other cost functions (e.g., raw Euclidean, learned neural costs) is noted as future work.
  • Rectangular Shapes: While FlashSinkhorn handles rectangular shapes, performance degrades for extreme aspect ratios. Future work could explore more advanced work-partitioning strategies for these cases.
  • Numerical Precision: While generally stable, very low epsilon values (ε=0.01) can lead to numerical challenges, though the method maintains good precision.

Summary updated

BibTeX
@inproceedings{ye2026flashsinkhorn,
  author = {Felix X.-F. Ye and Xingjie Li and An Yu and Ming-Ching Chang and Linsong Chu and Davis Wertheimer},
  title = {{FlashSinkhorn: IO-Aware Entropic Optimal Transport}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=VzIA4MASxK},
}
Figure