deepspeedai / deepspeedai/DeepSpeed

3d parallel with megatorn-gpt2

Open
#635 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

hi, deepspeed.
i'm trying to reproduce 3d-parallel results with megatron-gpt2.
i use PipeModelDataParallelTopology. and the topology setting is:

Using topology: {ProcessCoord(pipe=0, data=0, model=0): 0, ProcessCoord(pipe=0, data=0, model=1): 1, ProcessCoord(pipe=0, data=1, model=0): 2, ProcessCoord(pipe=0, data=1, model=1): 3, ProcessCoord(pipe=1, data=0, model=0): 4, ProcessCoord(pipe=1, data=0, model=1): 5, ProcessCoord(pipe=1, data=1, model=0): 6, ProcessCoord(pipe=1, data=1, model=1): 7}

however, my program hangs. it seems that the pipeline parallel is waiting for recving gradient of attention mask, but it has been poped from this line.

Another issue is, should we use PartitionedTensor with megatron-styled parallelization? i assume the output tensor for each BertLayer should be replicated across devices and thus no need to do PartitionedTensor, am i corect?

Thanks for the help.

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 reading deepspeed/runtime/pipe/engine.py around line 828 and reviewing the reported PipeModelDataParallelTopology for the Megatron-GPT2 reproduction. Reproduce the hang with the described 3D-parallel setup, then determine why the attention-mask gradient is removed and whether PartitionedTensor is required; done means the behavior and expected tensor handling are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.