deepspeedai / deepspeedai/DeepSpeed

[REQUEST] ZeRO3 doc - support for wrapping model sub-components seperately for training

Open
#6,505 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.