# DeepEP: 효율적인 Mixture-of-Experts 병렬 통신 라이브러리 (feat. DeepSeek)

**URL:** <https://discuss.pytorch.kr/t/deepep-mixture-of-experts-feat-deepseek/6212>\
**Category:** 읽을거리&정보공유\
**Tags:** deepseek, mixture-of-experts, deepep, expert-parallelism\
**Created:** [2월 25, 2025, 9:30오전 UTC](https://discuss.pytorch.kr/t/deepep-mixture-of-experts-feat-deepseek/6212 "2025-02-25T09:30:11Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![9bow](https://discuss.pytorch.kr/user_avatar/discuss.pytorch.kr/9bow/32/16301_2.png) [@9bow](https://discuss.pytorch.kr/u/9bow)\
**Post date:** [2월 25, 2025, 9:30오전 UTC](https://discuss.pytorch.kr/t/deepep-mixture-of-experts-feat-deepseek/6212/1 "2025-02-25T09:30:11Z")

</div>

![DeepEP: 효율적인 Mixture-of-Experts 병렬 통신 라이브러리](https://discuss.pytorch.kr/uploads/default/original/2X/8/87d523e1797913275369c30a16ad28266646960a.png)

## 들어가며 :pytorch::kr:

DeepSeek에서 [이번 주, 하루에 하나씩, 인프라와 관련한 GitHub 저장소를 공개](https://github.com/deepseek-ai/open-infra-index)하기로 하였습니다. 오늘 살펴볼 [DeepEP](https://github.com/deepseek-ai/DeepEP)는 [FlashMLA](https://discuss.pytorch.kr/t/flashmla-hopper-gpu-mla-feat-deepseek/6199)에 이어 두번째로 공개한 저장소로, MoE(Mixture-of-Experts) 및 EP(Expert Parallelism)를 위한 라이브러리입니다, 함께 살펴보시죠 😃

## DeepEP 소개

DeepEP는 Mixture-of-Experts (MoE) 및 Expert Parallelism (EP)을 위한 고성능 GPU 통신 라이브러리입니다. 최근 대규모 언어 모델에서 MoE가 점점 더 중요한 구조로 자리 잡고 있으며, 이를 효과적으로 활용하려면 전문가 간의 데이터 교환이 필수적입니다. DeepEP는 NVLink 및 RDMA를 활용한 저지연 통신을 제공하며, 특히 FP8 연산을 지원하여 최신 GPU 아키텍처에서 높은 성능을 보장합니다.

DeepSeek AI가 발표한 [DeepSeek-V3](https://github.com/deepseek-ai/DeepSeek-V3) 논문에서 제안한 Group-limited Gating Algorithm을 기반으로 최적화된 커널을 제공하며, 학습과 추론 환경 모두에서 사용 가능합니다. 특히, 추론 시 디코딩 속도를 높이기 위한 저지연 커널을 포함하고 있어, 실시간 응용에서도 강력한 성능을 발휘합니다.

MoE 구조를 사용하는 경우 전문가(Expert) 간의 데이터 전송이 병목이 될 수 있습니다. DeepEP는 이러한 전송을 **최적화된 GPU 커널을 통해 해결** 하여 높은 처리량과 낮은 지연 시간을 보장합니다. 특히, DeepEP는 RDMA(Network-based Remote Direct Memory Access)를 지원 하여 GPU 간의 직접적인 데이터 전송 속도를 극대화하며, 이는 서버 간 MoE 연산을 더 효율적으로 수행 할 수 있도록 해줍니다.

다음은 DeepEP와 기존 MoE 프레임워크 간의 비교입니다:

| **특징** | **DeepEP** | **Megatron-LM** | **FasterTransformer** |
| --- | --- | --- | --- |
| 지원하는 MoE 방식 | Expert Parallelism | Tensor Parallelism, Pipeline Parallelism | MoE 지원 |
| 저지연 최적화 | ✅ | ❌ | ✅ |
| FP8 연산 지원 | ✅ | ❌ | ✅ |
| NVLink 최적화 | ✅ | ✅ | ❌ |
| RDMA 지원 | ✅ | ❌ | ❌ |

DeepEP의 사용을 위해서는 Hopper GPU, PyTorch 2.1 이상, CUDA 12.3 이상 환경이 필요합니다. 상세한 내용은 [DeepEP GitHub 저장소](https://github.com/deepseek-ai/DeepEP)를 참고해주세요.

## DeepEP의 주요 기능

DeepEP의 주요 기능은 다음과 같습니다:

- **고성능 MoE 데이터 전송** : NVLink 및 RDMA를 활용하여 전문가 간 데이터 교환을 최적화하며, FP8 지원을 통해 연산 성능 및 메모리 효율성을 향상합니다.

- **추론을 위한 저지연 커널** : 기존 NVLink 기반 커널보다 빠른 RDMA 전용 저지연 커널 제공하며, Adaptive Routing 기능을 통해 네트워크 혼잡을 방지합니다.

- **통신-연산 중첩(Hook 기반)**: SM 리소스를 점유하지 않고 통신과 연산을 동시에 수행하며, 최적화된 PTX 명령어(ld.global.nc.L1::no\_allocate.L2::256B)를 활용합니다.

## 라이선스

DeepEP는 [MIT License](https://github.com/deepseek-ai/DeepEP/blob/main/LICENSE)로 배포되며, ( `csrc/kernels/ibgda_device.cuh` 및 `third-party/nvshmem.patch`을 포함한) NVSHMEM 관련 코드는 [NVSHMEM SLA](https://docs.nvidia.com/nvshmem/api/sla.html)를 따릅니다.

## :github: DeepEP GitHub 저장소

[https://github.com/deepseek-ai/DeepEP](https://github.com/deepseek-ai/DeepEP)

## 더 읽어보기

- DeepSeek의 OpenInfra 소개 저장소: [GitHub - deepseek-ai/open-infra-index: Production-tested AI infrastructure tools for efficient AGI development and community-driven innovation](https://github.com/deepseek-ai/open-infra-index)

- Day 1. FlashMLA: [FlashMLA: Hopper GPU를 위한 고성능 MLA 디코딩 커널 (feat. DeepSeek)](https://discuss.pytorch.kr/t/flashmla-hopper-gpu-mla-feat-deepseek/6199)

- Day 2. DeepEP: [DeepEP: 효율적인 Mixture-of-Experts 병렬 통신 라이브러리 (feat. DeepSeek)](https://discuss.pytorch.kr/t/deepep-mixture-of-experts/6212)

- Day 3. DeepGEMM: [DeepGEMM: NVIDIA Hopper GPU에서 효율적인 FP8 연산을 위한 GEMM 커널 라이브러리 (feat. DeepSeek)](https://discuss.pytorch.kr/t/deepgemm-nvidia-hopper-gpu-fp8-gemm-feat-deepseek/6219)

- Day 4-1. EPLB: [EPLB: MoE 모델에서 GPU들 간의 부하를 분배(Load Balancing)하는 라이브러리 (feat. DeepSeek)](https://discuss.pytorch.kr/t/eplb-moe-gpu-load-balancing-feat-deepseek/6235)

- Day 4-2. DualPipe: [DualPipe: 양방향 파이프라인 병렬화 알고리즘 (feat. DeepSeek)](https://discuss.pytorch.kr/t/dualpipe-feat-deepseek/6236)

- Day 4-3. 프로파일링 데이터: [DeepSeek-V3/R1 모델 학습 및 추론 시 수집한 프로파일링 데이터 공개 (feat. DeepSeek)](https://discuss.pytorch.kr/t/deepseek-v3-r1-feat-deepseek/6237)

- Day 5. 3FS(Fire-Flyer File System): [3FS(Fire-Flyer File System), 고성능 분산 파일 시스템 (feat. DeepSeek)](https://discuss.pytorch.kr/t/3fs-fire-flyer-file-system-feat-deepseek/6245)

* * *

_이 글은 GPT 모델로 정리한 글을 바탕으로 한 것으로, 원문의 내용 또는 의도와 다르게 정리된 내용이 있을 수 있습니다. 관심있는 내용이시라면 원문도 함께 참고해주세요! 읽으시면서 어색하거나 잘못된 내용을 발견하시면 덧글로 알려주시기를 부탁드립니다._ 🤗

[:pytorch:파이토치 한국 사용자 모임🇰🇷](https://pytorch.kr/)이 정리한 이 글이 유용하셨나요? [회원으로 가입](https://discuss.pytorch.kr/signup)하시면 주요 글들을 이메일💌로 보내드립니다! (기본은 Weekly지만 [Daily로 변경도 가능](https://discuss.pytorch.kr/my/preferences/emails)합니다.)

🎁 아래↘쪽에 좋아요👍를 눌러주시면 새로운 소식들을 정리하고 공유하는데 힘이 됩니다~ 🤩

---

_[View the full topic](https://discuss.pytorch.kr/t/deepep-mixture-of-experts-feat-deepseek/6212)._
