deepspeedai / deepspeedai/DeepSpeed

[REQUEST] Custom partition option for PipelineModule

Open
#2,974 0 comments 1 reaction 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.
The currently pipeline parallel module gives limited control on layer partition -- we pretty much only have an option of partitioning by "parameters" or "uniform" (number of layers). Both these methods are often suboptimal for typical language transformers as ideally we want to balance GPU memory and utilization uniformly. In typical language models, both the memory and compute is much larger on the "head" layer -- they have the highest number of activations proportional to vocab size). At the same time, the overhead of the first "embedding" layer is minimal even though it has the same number of parameters as the "head". Furthermore, the "uniform" partition code uses a "floor" function to round, which ends up prioritizing the embedding layer more, in turn leading to worse gpu utilization.

Describe the solution you'd like
Allow an option to provide custom partition list, say 'parts', which can be directly applied to self.parts here --- only minimal checks are needed on the list to make sure len(parts)=num_parts+1 and parts[-1] = num_items.

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 in deepspeed/runtime/pipe/module.py at the PipelineModule partition setup, then review the uniform partition logic in deepspeed/runtime/utils.py. Trace how self.parts is built and validate the requested parts length and final value. Done means a custom partition list can be supplied and is applied for pipeline partitioning.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.