SuperAPI AI Directory

DeepEP - DeepSeek's open-source expert parallel communication library, designed for MoE training and inference

Author: AI小集 · Original source: AI工具集

What is DeepEP

DeepEP is the first open-source EP (expert parallel) communication library released by DeepSeek, designed specifically for Mixture-of-Experts (MoE) training and inference. It provides high-throughput and low-latency all-to-all GPU kernels, supporting both intra-node and inter-node NVLink and RDMA communication. DeepEP is specifically optimized for the DeepSeek-V3 group-limited gating algorithm from the paper, supports FP8 data format dispatch, and introduces a Hook-based communication-computation overlap method that does not occupy GPU compute resources. The low-latency kernels perform excellently in the inference decoding stage, with latency as low as 163 microseconds. DeepEP is suitable for the Hopper GPU architecture and requires Python 3.8, CUDA 12.3, and PyTorch 2.1 or above.

DeepEP

Main Features of DeepEP

  • Efficient communication kernels: DeepEP provides high-throughput and low-latency all-to-all GPU kernels, suitable for MoE dispatch and combine operations.
  • Low-precision computation support: Supports low-precision data formats such as FP8 and BF16, significantly improving computational efficiency and reducing memory requirements.
  • Optimized communication mechanisms: For the group-limited gating algorithm proposed in the DeepSeek-V3 paper, DeepEP provides optimized kernels, supporting asymmetric bandwidth forwarding from NVLink to RDMA, suitable for training and inference prefill tasks.
  • Low-latency inference decoding: Provides pure RDMA low-latency kernels, particularly suitable for latency-sensitive inference decoding scenarios, with latency as low as 163 microseconds.
  • Communication-computation overlap: Introduces a Hook-based communication-computation overlap method that does not occupy the GPU's streaming multiprocessor (SM) resources, maximizing computational efficiency.
  • Flexible resource management: Supports flexible GPU resource management, allowing users to control the number of SMs used, adapting to different workloads.
  • Network configuration optimization: DeepEP has been comprehensively tested on InfiniBand networks and supports traffic isolation through virtual lanes (VL) to prevent interference between different types of traffic.

DeepEP Project Address

DeepEP Performance

  • High-throughput kernels: DeepEP has been tested on H800 GPUs and CX7 InfiniBand 400 Gb/s RDMA network cards, demonstrating excellent throughput performance:
    • Intra-node communication: In intra-node communication using NVLink, the bottleneck bandwidths for dispatch and combine operations reach 153 GB/s and 158 GB/s。
    • Inter-node communication: In inter-node communication using RDMA, the bottleneck bandwidths for dispatch and combine operations reach 43-47 GB/s。
  • Low-latency kernels: DeepEP's low-latency kernels are designed specifically for inference decoding, using pure RDMA technology, significantly reducing latency:
    • When processing 8 experts , the latency of the dispatch operation is 163 microseconds, the latency of the combine operation is 318 microseconds, and the RDMA bandwidth is 46 GB/s。
    • As the number of experts increases, the latency rises slightly, but at 256 experts , the latencies of the dispatch and combine operations are respectively 194 microseconds and 360 microseconds。
  • System compatibility: DeepEP is primarily compatible with InfiniBand networks, and also supports running on Converged Ethernet (RoCE). It requires Hopper architecture GPUs, Python 3.8 or later, CUDA 12.3 or later, and PyTorch 2.1 or later.

DeepEP system requirements

  • Hardware requirements:
    • Supports Hopper architecture GPUs (such as H100, H800); more architectures may be supported in the future.
    • Requires devices that support GPUDirect RDMA; for specific requirements, refer to NVSHMEM's hardware specifications.
    • Intra-node communication requires NVLink, and inter-node communication requires an RDMA network.
  • Software requirements:
    • Python 3.8 or later.
    • CUDA 12.3 or later.
    • PyTorch 2.1 or later.
    • A modified version of NVSHMEM needs to be installed; for specific installation guidance, refer to the relevant documentation.
    • Installing GDRCopy (v2.4 or later) is recommended for low-latency GPU memory copies.
  • Network requirements:
    • The primary test environment is an InfiniBand network, compatible with RDMA over Converged Ethernet (RoCE).
    • Supports traffic isolation through virtual lanes (VL) to prevent interference between different workloads.
  • Other requirements:
    • In a containerized environment, it is necessary to ensure that the host has loaded the required kernel modules (such as gdrdrv), and that the relevant DEB package is correctly installed.
    • After installation is complete, environment variables need to be set (such as NVSHMEM_DIR) for DeepEP to use.

DeepEP application scenarios

  • Large-scale model training: DeepEP provides efficient parallel communication support, suitable for training Mixture-of-Experts (MoE) models, significantly improving training efficiency.
  • Inference tasks: Suitable for latency-sensitive inference decoding scenarios, it can significantly reduce latency and improve inference throughput.
  • High-performance computing: Supports multiple hardware platforms, including the Hopper GPU architecture, and optimizes the communication performance of NVLink and RDMA networks.
  • Intelligent customer service: By optimizing the inference process, DeepSeek's intelligent customer service system can quickly respond to user questions and improve service efficiency.
  • Financial sector: Used for risk assessment, automated report generation, etc., predicting default probability by analyzing corporate financial reports and public opinion data.