COMET: Fine-grained Computation-communication Overlapping for Mixture-of-Experts

Shulai Zhang, Ningxin Zheng, Haibin Lin, Ziheng Jiang, Wenlei Bao, Chengquan Jiang, Qi Hou, Weihao Cui, Size Zheng, Li-Wen Chang, Quan Chen, Xin Liu

Abstract

Mixture-of-Experts (MoE) architectures have become a cornerstone for scaling Large Language Models (LLMs) to trillions of parameters. However, the distributed nature of these models introduces significant communication overhead during token dispatch and combination phases. This paper introduces Comet, an optimized system designed to minimize this overhead through fine-grained computation-communication overlapping. By utilizing fused GPU kernels and adaptive workload assignment, Comet achieves up to a 1.96× speedup for MoE layers and has demonstrated substantial efficiency gains in large-scale production environments.

Introduction

Scaling Large Language Models (LLMs) efficiently often requires the Mixture-of-Experts (MoE) architecture, which enables high parameter counts without a linear increase in computational cost per token. In a distributed MoE setup, experts are partitioned across multiple GPUs. This necessitates "All-to-All" communication patterns where tokens are dispatched to their respective expert devices and later combined.

Despite the theoretical efficiency of MoE, the practical execution is often bottlenecked by inter-device communication. Research indicates that these data transfers can account for up to 47% of total execution time. While existing frameworks attempt to mitigate this through coarse-grained overlapping—splitting data into large chunks to pipeline transfers and math—these methods often leave hardware resources underutilized and struggle with the dynamic workloads inherent in MoE models.

The Comet Approach

Comet moves beyond traditional coarse-grained pipelining by implementing two primary innovations: Shared Tensor-Based Dependency Resolving and Adaptive Workload Assignment.

1. Shared Tensor-Based Dependency Resolving

Traditional systems treat data as monolithic blocks, waiting for significant portions of a transfer to complete before beginning computation. Comet breaks this "chunk" mentality by analyzing the shared tensors (the buffers between communication and computation). By decomposing these tensors along specific dimensions—such as the token dimension during dispatch or the embedding dimension during the combine phase—Comet identifies exactly which mathematical operations can begin as soon as the first "tiles" of data arrive. This allows the system to prioritize local data processing while remote data is still in transit, effectively hiding the latency of the network.

2. Adaptive Workload Assignment via Fused Kernels

To avoid the overhead and non-determinism of managing multiple GPU streams from the host CPU, Comet introduces fused GPU kernels. Within a single kernel, Comet employs "thread block specialization":

  • Communication Blocks: Dedicated to managing networking tasks using NVSHMEM.
  • Computation Blocks: Dedicated to performing General Matrix Multiply (GEMM) operations.

Crucially, the ratio of these blocks is not static. Comet dynamically adjusts the allocation of hardware resources based on the specific model configuration (e.g., number of experts, hidden dimension size) and the current input shape. This adaptive profiling ensures the system consistently operates at the performance "sweet spot," regardless of varying sequence lengths or architectural differences.

Experimental Evaluation

The authors evaluated Comet across several state-of-the-art MoE models, including Mixtral-8x7B, Qwen2-MoE-2.7B, and Phi-3.5-MoE. Testing was conducted on two distinct hardware profiles: Nvidia H800 clusters (high bandwidth) and L20 clusters (bandwidth-limited), to test the system's robustness across different interconnect speeds.

Key Performance Metrics

  • Layer-Level Speedup: Comet achieved up to a 1.96× speedup for individual MoE layers.
  • End-to-End Performance: Compared to standard Megatron-LM implementations, Comet delivered an average 1.71× speedup for full model execution.
  • Latency Concealment: Comet successfully hid 86.5% of communication latency. This significantly outperforms existing solutions like FasterMoE (29.2%) and Tutel (68.6%).

Discussion and Impact

Comet represents a significant shift in how distributed MoE training and inference are handled. By moving scheduling logic into the GPU kernel and treating data as a fine-grained stream rather than discrete chunks, the system provides much tighter control over hardware resources.

The real-world impact of this system is already evident. Comet is currently deployed in production environments at ByteDance, managing tens of thousands of GPUs. This deployment has resulted in the saving of millions of GPU hours, demonstrating that fine-grained overlapping is essential for the next generation of trillion-parameter models.

Limitations and Future Work

While highly effective, Comet currently relies on NVSHMEM, making it specific to NVIDIA hardware. Future iterations could involve porting these fine-grained pipelining techniques to other accelerators or integrating them into high-level compilers like Triton or TVM. Such integration would lower the barrier to entry for researchers to apply these optimizations to a wider variety of model architectures.

Summary updated

Abstract

Mixture-of-experts (MoE) has been extensively employed to scale large language models to trillion-plus parameters while maintaining a fixed computational cost. The development of large MoE models in the distributed scenario encounters the problem of large communication overhead. The inter-device communication of a MoE layer can occupy 47% time of the entire model execution with popular models and frameworks. Therefore, existing methods suggest the communication in a MoE layer to be pipelined with the computation for overlapping. However, these coarse grained overlapping schemes introduce a notable impairment of computational efficiency and the latency concealing is sub-optimal. To this end, we present COMET, an optimized MoE system with fine-grained communication-computation overlapping. Leveraging data dependency analysis and task rescheduling, COMET achieves precise fine-grained overlapping of communication and computation. Through adaptive workload assignment, COMET effectively eliminates fine-grained communication bottlenecks and enhances its adaptability across various scenarios. Our evaluation shows that COMET accelerates the execution of a single MoE layer by $1.96\times$ and for end-to-end execution, COMET delivers a $1.71\times$ speedup on average. COMET has been adopted in the production environment of clusters with ten-thousand-scale of GPUs, achieving savings of millions of GPU hours.
BibTeX
@inproceedings{zhang2025comet,
  author = {Shulai Zhang and Ningxin Zheng and Haibin Lin and Ziheng Jiang and Wenlei Bao and Chengquan Jiang and Qi Hou and Weihao Cui and Size Zheng and Li-Wen Chang and Quan Chen and Xin Liu},
  title = {{COMET: Fine-grained Computation-communication Overlapping for Mixture-of-Experts}},
  booktitle = {MLSys},
  year = {2025},
  url = {https://openreview.net/forum?id=fGgQS5VW09},
}
Figure