deepspeedai / deepspeedai/DeepSpeed

[BUG] MoE using too much RAM

Open
#3,535 0 comments 0 reactions 1 assignee View on GitHub

@awan-10 is already working on this.

Since May 19, 2023.

bug training
Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

Describe the bug
I'm using a MoE instead of an MLP in a transformer block, I'm using expert parallelism such that I have one expert per gpu (with 2 gpus) and top-2 routing (so that I use both of them). Theoretically the model should use the exact same amount of ram as before given that the experts are distributed by gpu, but in practice I keep getting CUDA out of memory.

Expected behavior
The model should use exactly the same amount of ram as before instead of doubling.

Launcher context
I'm using the OpenMPI Launcher

Additional context
The model is a transformer with repeated (a lot actually) of blocks, and in each of them I wanted to replace the MLP with a MoE of 2 experts, one per gpu, to increase the model capacity without increasing the memory requirements

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.