FlashSinkhorn: IO-Aware Entropic Optimal Transport on GPU
FlashSinkhorn is an IO-aware GPU solver for entropic optimal transport that leverages FlashAttention-style fusion and tiling to drastically reduce HBM memory traffic, achieving up to 161× speedups over state-of-the-art baselines while enabling scalable optimization for large-scale point-cloud tasks.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to match two huge crowds of people. One crowd is standing on one side of a field (the "source"), and the other is on the opposite side (the "target"). Your goal is to figure out the most efficient way to pair everyone up so that the total distance everyone has to walk is minimized. This is a classic math problem called Optimal Transport.
In modern machine learning, we often add a little bit of "fuzziness" to this matching process to make the math easier to handle. This is called Entropic Optimal Transport. To solve it, computers use a method called Sinkhorn iterations, which is like a game of "hot potato" where the computer keeps passing notes back and forth between the two crowds, refining the matches over and over until it finds the best solution.
The Problem: The Traffic Jam
The paper explains that while this method works well for small crowds, it hits a massive wall when the crowds get huge (like tens of thousands of people).
Think of the computer's memory like a city:
- HBM (High Bandwidth Memory): This is the city's main highway. It's huge and can hold a lot of data, but it's slow to get to.
- SRAM (On-chip Memory): This is a tiny, super-fast private office right inside the computer's processor. It's incredibly fast but very small.
Older methods for solving this matching problem were like a delivery truck that had to drive from the highway (HBM) to the office (SRAM) and back every single time it needed to check a single pair of people. Because there are millions of possible pairs, the truck was stuck in traffic jams on the highway, constantly moving data back and forth. The computer spent more time waiting for data than actually doing the math.
The Solution: FlashSinkhorn
The authors created a new tool called FlashSinkhorn. They realized that the math behind this matching problem looks exactly like the math used in Transformers (the technology behind AI chatbots like the one you are talking to).
In Transformers, there is a clever trick called FlashAttention that solves a similar traffic jam. Instead of driving the truck back and forth, FlashAttention loads a whole "tile" (a small batch) of data into the fast office, does all the necessary calculations there, and only writes the final result back to the highway.
FlashSinkhorn takes this same "tile-based" strategy and applies it to the matching problem:
- No More Full Maps: Instead of writing down the entire map of every possible connection (which would be too big to fit in memory), it calculates connections on the fly, one small tile at a time.
- The "Office" Strategy: It keeps the current batch of calculations in the fast, small office (SRAM). It updates the "match scores" right there without ever needing to write the massive intermediate list back to the slow highway.
- Streaming: It streams through the data like a conveyor belt, processing and discarding the heavy lifting as it goes, keeping the highway clear.
The Results: Speed and Scale
The paper tested this on powerful GPUs (specifically the A100). The results were dramatic:
- Speed: It was up to 32 times faster for the initial calculation and up to 161 times faster for the full process (including learning from mistakes) compared to the best existing online methods.
- Memory: While older methods would crash (run out of memory) when trying to match crowds of 30,000 people, FlashSinkhorn could handle 50,000 people easily because it never tried to store the whole map at once.
- Real-World Use: They showed it works on real tasks like comparing huge datasets (like thousands of images) and solving complex regression problems where the order of data is mixed up.
The Bottom Line
FlashSinkhorn is like upgrading from a delivery truck stuck in traffic to a high-speed drone. It doesn't change the destination (the math answer is still exact), but it changes how the data is moved. By keeping the heavy lifting inside the computer's fast "office" and only using the slow "highway" for the final results, it makes solving massive matching problems practical and fast, turning a task that used to take hours or crash the computer into something that takes seconds.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.