deepspeedai / deepspeedai/DeepSpeed

[BUG] load checkpoint

Open
#7,388 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

When training with DeepSpeed Zero-1, I use model_engine.save_checkpoint(save_dir, tag=tag) to save the model.
The save_dir like

bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt  bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt  bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt  bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt  final_scores.json
bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt  bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt  bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt  bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt  mp_rank_00_model_states.pt

During inference, I refer to thie tutorial,

ds_infer_config =  {
    "type": "ds_model",
    "version": 0.0,
    "checkpoints": "save_dir",
}


model_engine = deepspeed.init_inference(
    model,
    checkpoint=ds_infer_config,
)

model_engine.eval()

But the checkpoint is not loaded. Because for the same data, the output of all checkpoints I load is consistent. What's the problem here?

To Reproduce
deepspeed 0.14.4

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 DeepSpeed inference tutorial and the init_inference call using the ds_model checkpoint configuration, then compare it with the Zero-1 save_checkpoint output shown in the issue. Reproduce the load with DeepSpeed 0.14.4 and verify whether inference uses the saved checkpoint rather than producing identical outputs across checkpoints.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.