deepspeedai / deepspeedai/DeepSpeed

[BUG] `load_checkpoint` fails after deepspeed engine started training

Open
#1,612 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

load_checkpoint works when a fresh deepspeed engine was created, but if you train with it and try again load_checkpoint fails.

This is exactly the same issue as reported in https://github.com/microsoft/DeepSpeed/issues/1394 which was closed with a workaround but not with a solution.

I used the same re-init workaround I proposed on that issue in Transformers: https://github.com/huggingface/transformers/pull/14652 when users want to reload the best model at the end of the training, but this would be hugely slow for any large model, because everything has to be reallocated.

Thank you!

Reproduction script: https://github.com/microsoft/DeepSpeed/pull/1750#issuecomment-1033340408

@tjruwase, @jeffra

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 reproduction script linked in the issue and compare the failure with the workaround described in issue #1394 and the Transformers pull request. Done means load_checkpoint succeeds after the DeepSpeed engine has trained, without requiring full re-initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
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.