deepspeedai / deepspeedai/DeepSpeed
[REQUEST] How to use deepspeed.checkpointing.non_reentrant_checkpoint() properly with Stage3?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
See https://github.com/microsoft/DeepSpeed/issues/4332.
After diffusers 0.17.0, non-reentrant variant of torch.utils.checkpoint.checkpoint becomes default but is incompatible with Deepspeed Stage3.
I found https://github.com/microsoft/DeepSpeed/pull/4118, then replaced torch.utils.checkpoint.checkpoint with deepspeed.checkpointing.non_reentrant_checkpoint before import diffusers but still met an error said "RuntimeError: The size of tensor a (0) must match the size of tensor b (1280) at non-singleton dimension 1".
Maybe I use non_reentrant_checkpoint improperly. Any suggestions for me to make non-reentrant checkpoint compatible with stage3?
cc @hughpu
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issues 4332 and 4595, then compare DeepSpeed PR 4118 with the diffusers 0.17.0 checkpoint behavior. Reproduce the reported tensor-size error with Stage3 and trace the use of deepspeed.checkpointing.non_reentrant_checkpoint; done means documenting or implementing a confirmed compatible usage path.
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