[GH-ISSUE #99] How to avoid OOM in the early stage of training using DeepEP #90

Closed
opened 2026-10-26 09:54:04 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @ForFishes on GitHub (Mar 28, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/99

Using DeepEP can efficiently implement MOE model training without dropping tokens. However, in the early stages of training, or cold start training, the model has not reached a good convergence state. Using DeepEP will cause a GPU device to accept more tokens, causing subsequent calculations to be out of memory(OOM). I am curious about how this situation is avoided in the early stages of actual training.

Originally created by @ForFishes on GitHub (Mar 28, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/99 Using DeepEP can efficiently implement MOE model training without dropping tokens. However, in the early stages of training, or cold start training, the model has not reached a good convergence state. Using DeepEP will cause a GPU device to accept more tokens, causing subsequent calculations to be out of memory(OOM). I am curious about how this situation is avoided in the early stages of actual training.
Author
Owner

@LyricZhao commented on GitHub (Mar 31, 2025):

DeepEP is doing its best to allocate less memory. The OOM is mainly caused by expert selection / framework level staffs.

To solve OOM, you can try more TPs (adjust your parallel strategies at early phase of training), or implement CPU offloading (if receiving much tokens), or adjust gate (drop at topk_idx computation), or do more tensor recomputation (SwiGLU, RMSNorm).

<!-- gh-comment-id:2765010537 --> @LyricZhao commented on GitHub (Mar 31, 2025): DeepEP is doing its best to allocate less memory. The OOM is mainly caused by expert selection / framework level staffs. To solve OOM, you can try more TPs (adjust your parallel strategies at early phase of training), or implement CPU offloading (if receiving much tokens), or adjust gate (drop at `topk_idx` computation), or do more tensor recomputation (SwiGLU, RMSNorm).
Author
Owner

@isayoften commented on GitHub (Apr 10, 2025):

@LyricZhao Hi! Explain please, what do you mean by "adjust gate (drop at topk_idx computation)"?

<!-- gh-comment-id:2794562612 --> @isayoften commented on GitHub (Apr 10, 2025): @LyricZhao Hi! Explain please, what do you mean by "adjust gate (drop at topk_idx computation)"?
Author
Owner

@LyricZhao commented on GitHub (Apr 11, 2025):

what do you mean by "adjust gate (drop at topk_idx computation)"?

Drop some top-k selections if a rank has too many tokens to receive.

<!-- gh-comment-id:2795694403 --> @LyricZhao commented on GitHub (Apr 11, 2025): > what do you mean by "adjust gate (drop at topk_idx computation)"? Drop some top-k selections if a rank has too many tokens to receive.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepEP#90
No description provided.