deepspeedai / deepspeedai/DeepSpeed
[REQUEST] Confusion about communication time reduction when sequence length increases
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
Hi, I had some tests on Sequence Parallel of Megatron-DeepSpeed. When I fix all other hyperparameters (gpt350m, sp=8, dp=pp=tp=1, flash_attn=True, activation_ckpt=True) and only increase the sequence length, the results confuse me a lot.
-
When use flash_attn, why are the all2all communication portion and its wall-clock time decrease when seq length increases? Does Flash Attention also help to reduce communication?
-
When seq length=16k/32k, why turning on flash_attn even increases the communication time?
Testbed: Server with 8 A100 GPUs (80GB) with NVLink and 200Gbps InfiniBand. Some test results are below:
| seq length | flash_attn | activation_ckpt | ncclKernel_SendRecv Portion | ncclKernel_SendRecv Time |
|---|---|---|---|---|
| 16k | True | True | 61.2% | 111.4ms |
| 16k | False | True | 8.3% | 52.1ms |
| 32k | True | True | 44.6% | 106.8ms |
| 32k | False | True | 1.1% | 67.4ms |
| 40k | True | True | 23.4% | 58ms |
I used the PyTorch Profiler with Tensorboard to get the above results.
Thanks for your time!
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
No files, tests, or entry points are named. Start by reproducing the reported sequence-parallel measurements with the listed Megatron-DeepSpeed settings and PyTorch Profiler/Tensorboard, then investigate the communication timing across sequence lengths and Flash Attention modes. Done means providing a supported explanation of the observed results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- distributed-systems, machine-learning, performance
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100