deepspeedai / deepspeedai/DeepSpeed

Performance degradation after using DeepSpeed (UniLM/layoutlmv2)

Open
#1,436 15 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,

We are trying DeepSpeed with UniLM using FUNSD example that is provided here - https://github.com/microsoft/unilm/tree/master/layoutlmv2

It takes 18-ish minutes to finish training without using DeepSpeed in a 16GB Single GPU machine.
When I use DeepSpeed with the below mentioned configuration, it took 30+ minutes in the same machine. I tried to add optimizer, scheduler with different learning rates etc. I tried different bucket sizes as well. But that did not make any difference.

Can anyone help with this?

Config:
{
"zero_optimization": {
"stage": 2,
"offload_optimizer": {
"device": "cpu",
"pin_memory": true
},
"allgather_partitions": true,
"allgather_bucket_size": 2e8,
"reduce_scatter": true,
"reduce_bucket_size": 2e8,
"overlap_comm": true,
"contiguous_gradients": true
}
}

Versions:
Pytorch: 1.8.0+cu111
DeepSpeed - 5.3
Transformers - 4.5.3 (version that UniLM was bundled with)

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 with the UniLM/layoutlmv2 FUNSD example linked in the report and reproduce training with and without the supplied ZeRO Stage 2 configuration. Compare the two runs and investigate the listed optimizer offload, bucket, and communication settings; done means the cause of the slower DeepSpeed run is identified and a verified configuration or limitation is documented.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.