deepspeedai / deepspeedai/DeepSpeed
[REQUEST] ZeRO3 doc - support for wrapping model sub-components seperately for training
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
Is your feature request related to a problem? Please describe.
it is very difficult to train MM models (e.g., multi-image chat/video chat) models in zero3 because the effective vision batch>>text batch. So even if the LLM is much larger then the image encoder, and it much slower to run forward loop for, you still need to limit the batch size based of the vision encoder as apposed to the LLM.
Describe the solution you'd like
would it be possible to wrap different parts of the model separately, such that if you are not training the vision encoder you don't need to include it in the computational graph, and therefore can encode the images/frames in sub-batches to allow efficient forward passes
Describe alternatives you've considered
this works in zero2. Would be nice if there was a guild on this (similar to FSDP, where sometimes you wrap transformers layers seperately to reduce max GPU utilization) on how to do this in deepseed.
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 reviewing current ZeRO-3 and ZeRO-2 behavior and the existing FSDP wrapping guidance. Determine whether separately wrapped model sub-components can exclude an untrained vision encoder from the computational graph and support image or frame sub-batches. Done means a documented, supported approach or a clearly scoped implementation decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- distributed-systems, documentation, machine-learning, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100