deepspeedai / deepspeedai/DeepSpeed

Test hangs when world_size=4 and reuse_dist_env=True on PyTorch >= 2.7.0

Open
#7,334 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When the

  • PyTorch version is greater than 2.7.0,
  • world_size=4
  • reuse_dist_env=True,

The test will get stuck at tests/unit/common.py ->_dist_destroy(self) ->dist.destroy_process_group()

reproduce file:

from unit.common import DistributedTest
import pytest
@pytest.mark.parametrize("tp_size", [2, 4])
class TestEmpty(DistributedTest):
    world_size = 4
    reuse_dist_env = True **# wsz=4 and reuse_dist_env=True will hang.**

    def test(self, tp_size: int):
        print("finished test")
        return 

We can temporarily avoid this issue by setting reuse_dist_env=False

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 reproduction using PyTorch greater than 2.7.0, world_size=4, and reuse_dist_env=True. Read tests/unit/common.py, especially DistributedTest._dist_destroy and its call to dist.destroy_process_group(). Compare the behavior with reuse_dist_env=False and define done as the parametrized test completing without hanging.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.