deepspeedai / deepspeedai/DeepSpeed

ZERO Stage 3 with NVME Offload CPU OOM

Open
#1,131 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When using ZERO Stage 3 with NVME Offload to train a 40B parameter model, I see CPU OOM errors during the partitioning of optimizer states, which causes a crash before training can begin.

Reproduction is here: https://gist.github.com/stephenrawls/ed4d2e57d4d365ff4e5ec41fbedbb6ed

Details:
The CPU OOM error appears to happen while inside of _swap_out_unpinned_tensors(), which is called from swap_out_optimizer_state() function here: https://github.com/microsoft/DeepSpeed/blob/0d4a54a04d658db40a120bc10c6f1f1a4478f6f1/deepspeed/runtime/swap_tensor/partitioned_optimizer_swapper.py#L120-L164

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.

Research direction

Start with the linked reproduction gist and inspect deepspeed/runtime/swap_tensor/partitioned_optimizer_swapper.py, especially _swap_out_unpinned_tensors() as called by swap_out_optimizer_state(). Reproduce the ZERO Stage 3 NVME Offload run and investigate the CPU OOM during optimizer-state partitioning; done means the run no longer crashes before training begins.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.