deepspeedai / deepspeedai/DeepSpeed
[REQUEST] Custom partition option for PipelineModule
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.
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
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 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