← Latest papers
🤖 machine learning

TokenWeave: Efficient Compute-Communication Overlap for Distributed LLM Inference

TokenWeave is a novel system that achieves efficient compute-communication overlap for distributed LLM inference on small batch sizes by fusing the RMSNorm operation with AllReduce communication using specialized GPU features, thereby reducing latency and increasing throughput even when the number of tokens per iteration is as low as 1024.

Original authors: Raja Gond, Nipun Kwatra, Ramachandran Ramjee

Published 2026-05-04
📖 5 min read🧠 Deep dive

Original authors: Raja Gond, Nipun Kwatra, Ramachandran Ramjee

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 running a massive, high-speed factory (a Large Language Model) that processes requests from customers. To make this factory fast enough, you've hired a team of 8 expert workers (GPUs) to work together. They are connected by a super-fast conveyor belt system (NVLink) so they can share their work instantly.

However, there's a problem: The workers spend too much time waiting to talk to each other.

Even with the super-fast conveyor belts, the workers have to stop their actual building (computation) to pass notes back and forth (communication). In the paper, the authors found that for big models, this "talking time" eats up about 20% of the total time. It's like a chef stopping to call the other chefs in the kitchen just to ask, "Do you have the salt?" before they can chop the next vegetable.

The Old Way: Breaking Things Down

Previous attempts to fix this tried to break the work into tiny pieces. The idea was: "While Worker A is passing a note to Worker B, Worker A can start chopping the next vegetable."

But the authors found this didn't work well for small orders (which is what happens when you ask an AI a short question). Breaking a big job into tiny pieces actually made the workers slower because they had to stop and start so many times. It's like trying to run a relay race where you pass the baton every 10 feet; the time spent running is less than the time spent stopping to hand off the baton!

The New Solution: TokenWeave

The authors built a new system called TokenWeave. Think of it as a smart manager who reorganizes the factory floor to eliminate the waiting time. Here is how they did it, using three simple tricks:

1. The "Smart Split" (The Two-Lane Highway)

Instead of trying to break the work into a million tiny pieces, TokenWeave splits the order into just two big chunks.

  • Chunk A starts working on the first half of the job.
  • Chunk B starts working on the second half.
  • The Magic: While Chunk A is busy doing its math, Chunk B is busy passing its notes. Then, they switch. Chunk A passes notes while Chunk B does math.
  • Why it works: The authors figured out exactly how to split the work so that the workers don't get "stuck" waiting for the conveyor belt. They call this "wave-aware," meaning they make sure the workers are always busy, just like a well-timed traffic light system that keeps cars moving without stopping.

2. The "Fused Kernel" (The All-in-One Tool)

In the old factory, the workers had to do two separate things:

  1. Pass the notes (Communication).
  2. Normalize the data (a math step called RMSNorm).

The authors realized that doing these two steps separately was wasteful. It's like having to walk to the supply closet to get a hammer, then walk back to the workbench to hit a nail, then walk back to the closet to get a screwdriver.

  • The Fix: They built a new "super-tool" (a fused kernel) that does the note-passing and the math step at the same time.
  • The Bonus: This super-tool is so efficient that it only needs a tiny fraction of the factory's power (just 2–8 workers out of 132) to run. This leaves the rest of the workers free to focus entirely on the heavy lifting (computation).

3. The "Smart Reordering" (Doing It in the Right Order)

Usually, the factory passes all the notes first, then does the math. But the authors realized that the math step (RMSNorm) could be done during the note-passing process if they rearranged the steps.

  • The Analogy: Instead of waiting for the whole truck to arrive before you start unloading, you start unloading the first box as soon as the truck pulls up. TokenWeave rearranges the steps so the math happens while the data is still moving, saving a massive amount of time.

The Results

The paper tested this new system on powerful computers (8x H100 GPUs) with real-world models like Llama and Qwen.

  • Speed: They found that TokenWeave made the factory 1.28 times faster (a 28% speedup) compared to the best existing systems.
  • Small Orders: Even for very short questions (only 1,000 words), it was 1.2 times faster. Previous systems actually got slower with small orders.
  • Throughput: The factory could handle 19% more customers per hour.
  • The "Magic" Claim: In some cases, TokenWeave was so efficient that it performed better than a theoretical version of the factory that had zero communication at all. This is because their new "super-tool" fixed the math step so well that it made up for the time spent talking.

Summary

TokenWeave is like a master conductor for an orchestra. Instead of letting the musicians stop to talk to each other (which slows the music down), it teaches them to play their parts while the conductor passes the sheet music simultaneously. By splitting the work into just two smart chunks and using a new "all-in-one" tool, they eliminated the waiting time, making AI inference significantly faster and more efficient.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →