SwiftEP: Accelerating MoE Inference with Buffer Fusion and TMA Offloading

Xingyi Li (unaffiliated), Yadong Liu (Tencent), Xiaojie Huang (Tencent), Yiran Zhang (unaffiliated), Shuai Wang (unaffiliated), Shangguang Wang (unaffiliated), Zhehao Lin (Tencent), Yinben Xia (Tencent), Chang Yu (Nanjing University), Qihang Liu (Tencent), Xuan Zhang (Tencent), Hao Lu (Tencent), Xiang Li (Tencent), Zekun He (Tencent), Yachen Wang (Tencent), Xianneng Zou (Tencent)

23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26) · Day 2 · Smart Pipes, Smarter Learning

Overview

Mixture of Experts (MoE) architectures have become a dominant paradigm for scaling large language models, replacing traditional dense feed-forward networks with numerous specialized expert subnetworks. During model serving, inference is bifurcated into two distinct phases: the prefill phase, which processes entire prompts in parallel, and the decoding phase, which generates tokens sequentially. While decoding is memory-bandwidth bound, the prefill phase is both compute- and communication-intensive. When experts are sharded across multiple GPUs using Expert Parallelism (EP), every MoE layer introduces two massive communication bottlenecks: a dispatch phase that routes tokens to the respective GPUs hosting selected experts, and a combine phase that gathers expert outputs.

Watch on YouTube · Slides

Visual summary for SwiftEP: Accelerating MoE Inference with Buffer Fusion and TMA Offloading by Xingyi Li, Yadong Liu, Xiaojie Huang, Yiran Zhang, Shuai Wang, Shangguang Wang, Zhehao Lin, Yinben Xia, Chang Yu, Qihang Liu, Xuan Zhang, Hao Lu, Xiang Li, Zekun He, Yachen Wang, Xianneng Zou
Visual summary for SwiftEP: Accelerating MoE Inference with Buffer Fusion and TMA Offloading by Xingyi Li, Yadong Liu, Xiaojie Huang, Yiran Zhang, Shuai Wang, Shangguang Wang, Zhehao Lin, Yinben Xia, Chang Yu, Qihang Liu, Xuan Zhang, Hao Lu, Xiang Li, Zekun He, Yachen Wang, Xianneng Zou

Key moments

  1. 0:00 Introduction and background on MoE inference
  2. 1:32 Basic inference schedule and limitations of TBO
  3. 4:00 Bandwidth analysis and design insights for SwiftEP
  4. 6:00 RDMA buffer fusion and WQE post coalescing
  5. 8:26 NVLink buffer fusion and token distribution refactoring
  6. 10:20 TMA offloading for dispatch and combine operations
  7. 11:41 Implementation setup and evaluation results
  8. 13:16 Conclusion and summary of performance gains

SwiftEP: Accelerating MoE Inference with Buffer Fusion and TMA Offloading

Speakers: Xingyi Li (unaffiliated); Yadong Liu (Tencent); Xiaojie Huang (Tencent); Yiran Zhang (unaffiliated); Shuai Wang (unaffiliated); Shangguang Wang (unaffiliated); Zhehao Lin (Tencent); Yinben Xia (Tencent); Chang Yu (Nanjing University); Qihang Liu (Tencent); Xuan Zhang (Tencent); Hao Lu (Tencent); Xiang Li (Tencent); Zekun He (Tencent); Yachen Wang (Tencent); Xianneng Zou (Tencent)

Conference: USENIX NSDI

YouTube: https://www.youtube.com/watch?v=9iDwzmiB5mU

Overview

Mixture of Experts (MoE) architectures have become a dominant paradigm for scaling large language models, replacing traditional dense feed-forward networks with numerous specialized expert subnetworks. During model serving, inference is bifurcated into two distinct phases: the prefill phase, which processes entire prompts in parallel, and the decoding phase, which generates tokens sequentially. While decoding is memory-bandwidth bound, the prefill phase is both compute- and communication-intensive. When experts are sharded across multiple GPUs using Expert Parallelism (EP), every MoE layer introduces two massive communication bottlenecks: a dispatch phase that routes tokens to the respective GPUs hosting selected experts, and a combine phase that gathers expert outputs.

This paper introduces SwiftEP, a systems-level co-design tailored for modern GPU architectures that accelerates MoE inference prefill through buffer fusion and Tensor Memory Accelerator (TMA) offloading. Presented at USENIX NSDI by a joint team from Tencent and academic institutions, SwiftEP addresses a critical hardware-software co-design challenge: communication kernels in prior engines consume an excessive fraction of Streaming Multiprocessor (SM) execution resources, starving the tensor cores of compute capacity. By fusing communication buffers directly with tensor compute buffers and leveraging hardware-level asynchronous data movement, SwiftEP achieves near-theoretical network bandwidth utilization, slashes communication-related SM occupancy by up to 66.7%, and boosts serving capacity for frontier models like DeepSeek-R1.

Background

▶ Watch: Introduction and background on MoE inference (0:00)

To understand the motivation behind SwiftEP, one must examine the state-of-the-art communication primitives used in distributed MoE serving, specifically DeepEP. In a standard distributed MoE layer, execution flows sequentially: attention calculations are followed by token dispatch, expert MLP computations, and finally token combining. Because this sequential schedule leaves hardware underutilized, systems engineers developed Two-Microbatch Overlapping (TBO) to overlap communication from one microbatch with computation from another.

While TBO improves overall pipeline throughput, it introduces a severe resource contention problem. On an NVIDIA H20 GPU equipped with 78 SMs, DeepEP’s communication kernels can occupy up to 24 SMs during prefill communication. This leaves only 54 SMs—roughly 69% of the GPU's total compute capacity—available for actual tensor computations. A granular profiling of the communication path reveals that this resource drain is driven not only by network transfers, but also by redundant data movement. Tensor outputs produced by attention blocks must be copied into an RDMA send buffer, and subsequently copied again through an NVLink buffer into the final tensor buffer. These intermediate staging steps consume valuable warp execution cycles.

Furthermore, inter-server and intra-server forwarding relies heavily on traditional CPU-like load and store execution mechanics. Data is loaded from High Bandwidth Memory (HBM) into register files and explicitly stored across NVLink into remote GPU memory. Because register files are strictly limited in size, massive parallel load-and-store operations trigger register pressure and register spilling. Consequently, measured algorithm bandwidth falls drastically short of the theoretical upper bounds of NVLink and RoCE v2 (RDMA over Converged Ethernet) networks, highlighting the need for architectural innovation that bypasses general SM thread execution for data movement.

Key Findings

▶ Watch: Bandwidth analysis and design insights for SwiftEP (4:00)

SwiftEP demonstrates that eliminating redundant data staging and offloading data movement to specialized hardware engines transforms MoE prefill performance. Evaluated on multi-node clusters featuring NVIDIA H20 GPUs connected via NVLink, NVSwitch, and RoCe v2 networks across EP=16 and EP=32 configurations, SwiftEP delivers several headline performance improvements:

  • Reduced SM Occupancy: SwiftEP cuts communication-related SM usage by 50% at EP=16 and by 66.7% at EP=32, freeing up warp schedulers and execution resources for core attention and MLP computations.
  • Maximized Algorithm Bandwidth: Measured dispatch bandwidth increases by up to 177.5%, and combine bandwidth jumps by 190.7%, closing the gap toward the theoretical hardware limits of the underlying interconnects.
  • End-to-End Serving Capacity: In end-to-end evaluations running the prefill phase of DeepSeek-R1, SwiftEP improves total serving capacity by 21.2% compared to baseline DeepEP architectures.
  • Zero-Copy Pipeline: By combining software-level buffer fusion with TMA offloading, SwiftEP achieves true zero-copy data routing across both intra-node (NVLink) and inter-node (RDMA) boundaries.

Technical Deep Dive

▶ Watch: NVLink buffer fusion and token distribution refactoring (8:26)

The architectural engine of SwiftEP rests on two core design insights: fusing communication buffers directly with tensor compute buffers, and offloading NVLink and RDMA operations from general SM threads to hardware-managed accelerators.

RDMA Buffer Fusion and Inter-Node Optimization

On the sender side, SwiftEP fuses the RDMA send buffer directly with the tensor compute buffer. Attention outputs are written natively into memory regions pre-configured for RDMA transmission, instantly eliminating intermediate memory copy steps. However, buffer fusion introduces a fragmentation challenge: MoE communication data consists of scattered hidden states, routing weights, and expert indices. Transmitting these irregular fragments individually causes transmission overhead and spikes RNIC (RDMA Network Interface Card) request volume.

To counter this, SwiftEP implements WQE (Work Queue Element) Post Coalescing. Rather than issuing a separate WQE for each tiny token segment, SwiftEP packs multiple scattered segments into a single WQE utilizing multi-SGE (Scatter-Gather Element) transmissions. This preserves zero-copy benefits without degrading network packet efficiency. Additionally, to prevent RNIC serialization bottlenecks, SwiftEP introduces QP (Queue Pair) Transmission Parallelism, binding each communication channel to a dedicated QP rather than sharing a single global QP across channels. This allows multiple DMA transmissions to proceed in parallel, effectively hiding the address translation latency of enlarged fused buffers.

NVLink Buffer Fusion and Intra-Node Optimization

For intra-node communication, SwiftEP fuses the NVLink receive buffer with the tensor compute buffer on the receiver side. Crucially, this same fused buffer is later reused during the combine phase, eliminating redundant memory allocation overheads. Because dispatch and combine share reverse data flows but compatible memory layouts, buffer recycling requires no extra staging.

Because senders can no longer rely on temporary receive buffers to reshuffle data asynchronously, SwiftEP refactors the notification protocol. Instead of transmitting local token counts solely to specific target ranks, SwiftEP broadcasts complete token distribution maps to all GPUs within the server during dispatch, ensuring every participant possesses a deterministic view of the final memory layout. For the combine phase, SwiftEP adopts a pull-based design where receivers pull data from remote GPUs and execute store-with-accumulate reductions natively.

TMA Offloading on NVIDIA Hopper

The Tensor Memory Accelerator (TMA), introduced in the NVIDIA Hopper architecture, is engineered for asynchronous data movement between global memory (HBM) and shared memory (SMem), dramatically reducing register pressure. SwiftEP extends TMA capabilities—originally constrained to single-GPU boundaries—to handle inter-GPU transfers across the server.

Using CUDA Inter-Process Communication (CUDA IPC), SwiftEP establishes mutual memory accessibility across all GPUs within a node. This enables self-initiated TMA read and write operations to traverse NVLink directly. For dispatch, senders use TMA to asynchronously store data directly into remote receiver memory, minimizing thread involvement. For combine, receivers pull data via TMA and perform hardware-accelerated reduction workflows, shifting compute tasks away from SM arithmetic units.

Experimental Setup & Results

▶ Watch: TMA offloading for dispatch and combine operations (10:20)

SwiftEP is implemented in approximately 2,500 lines of custom CUDA and C++ code built on top of the DeepEP framework. The evaluation utilizes hardware testbeds configured as follows:

  • Cluster Topologies: Two-node and four-node clusters corresponding to Expert Parallelism scales of EP=16 and EP=32.
  • Hardware Specifications: Each server node contains 8 NVIDIA H20 GPUs interconnected via high-speed NVLink and NVSwitch fabrics internally, bridged across nodes using RoCE v2 networking.
  • Baselines: Direct comparisons are measured against DeepEP serving engines.
  • Workloads: Macro benchmarks assessing raw communication bandwidth and SM occupancy alongside end-to-end LLM serving benchmarks executing the prefill phase of DeepSeek-R1.

Experimental results validate the efficacy of the co-design. SM occupancy dedicated to communication drops precipitously from baseline levels down to a 50% reduction at EP=16 and a 66.7% reduction at EP=32. Algorithm bandwidth scales near hardware maximums, registering gains of 177.5% in dispatch and 190.7% in combine phases. When evaluated in production-like serving scenarios on DeepSeek-R1, these bandwidth and occupancy optimizations translate directly into a 21.2% expansion in supported serving capacity.

Practical Implications

▶ Watch: Conclusion and summary of performance gains (13:16)

For infrastructure teams, model builders, and systems engineers deploying large-scale MoE models, SwiftEP offers a blueprint for hardware-software co-design. As model sizes scale into hundreds of billions of parameters, communication overhead during the prefill phase threatens to bottleneck time-to-first-token (TTFT) metrics. SwiftEP demonstrates that treating communication buffers and tensor compute buffers as isolated software abstractions leads to severe resource waste.

Deployers transitioning to Hopper-class hardware (and subsequent architectures featuring advanced DMA engines) can adopt buffer fusion and TMA offloading strategies to reclaim stranded SM compute capacity. However, practitioners must account for implementation complexities: managing scatter-gather WQE coalescing and establishing CUDA IPC memory contexts across multi-GPU nodes requires rigorous engineering. Furthermore, the enlargement of fused memory regions places heavier demands on translation table caches, necessitating the explicit QP parallelization techniques validated in this work.

Key Takeaways

  • Eliminating Staging Overheads: Fusing RDMA and NVLink communication buffers directly with tensor compute buffers achieves true zero-copy data transfer, removing intermediate memory copy warps.
  • Reclaiming Compute Resources: TMA offloading and buffer fusion reduce communication-related SM occupancy by up to 66.7% on NVIDIA H20 GPUs, returning compute cycles to attention and MLP layers.
  • Mitigating Fragmentation: WQE post-coalescing with multi-SGE packing successfully preserves network packet efficiency despite the inherently irregular, scattered data layouts of MoE routing.
  • Parallelizing Network Channels: Binding individual communication channels to dedicated Queue Pairs (QPs) eliminates RNIC serialization bottlenecks and hides address translation overheads.
  • Bandwidth and Capacity Gains: SwiftEP improves dispatch bandwidth by 177.5%, combine bandwidth by 190.7%, and drives a 21.2% increase in end-to-end prefill serving capacity for DeepSeek-R1.

About the Speaker(s)

The paper was presented at USENIX NSDI by Yihuan on behalf of primary author Xingyi Li and an extensive collaborative engineering team spanning Tencent (including Yadong Liu, Xiaojie Huang, Zhehao Lin, Yinben Xia, Qihang Liu, Xuan Zhang, Hao Lu, Xiang Li, Zekun He, Yachen Wang, and Xianneng Zou), Nanjing University (Chang Yu), and affiliated researchers including Yiran Zhang, Shuai Wang, and Shangguang Wang. The authors specialize in large-scale machine learning systems, high-performance GPU programming, and distributed cluster optimization for modern generative AI workloads.

Reviews

→ Top-rated talks at 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)

All talks from 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)