deepspeedai / deepspeedai/DeepSpeed

`ZeRO-3 + MP8` Universal Checkpoint

Open
#6,724 1 comment 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

Is it possible to convert a model trained using ZeRO-3 and MP=8 to a universal checkpoint?

Tracing through the universal checkpointing conversion tool (ds_to_universal), the model states remained unmerged, with 8 model parallel shards per each data parallel rank. E.g., with world_size = 2048, there are 2048 model state files,zero_pp_rank_{0-255}_{0-7} before and after the conversion.

When converting a model with ZeRO <= 2, MP > 1, the model state files are merged into a single file through merge_tp_slices.

If this is not possible, how would one extract and merge only the Z3 / MP checkpointed model states (along both z3 and model parallel partitions) to a single file?

The zero_to_fp32 script does not work since it only handles ZeRO-{2,3} without model parallelism.

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 universal checkpointing conversion tool, ds_to_universal, and trace how merge_tp_slices handles ZeRO and model-parallel partitions. Compare this with zero_to_fp32, reproducing the ZeRO-3 and MP=8 case described in the issue. Done means the model states can be merged into a single universal checkpoint, or the supported extraction limitation and path are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.