Skip to content

Commit 3cd2ae3

Browse files
masnesralpytorchmergebot
authored andcommitted
Use inductor TestCase for distributed tests (pytorch#129494)
Summary: At least some of the tests deriving from MultiProcessTestCase exercise inductor. Using the inductor TestCase class makes sure we always get a clean cache dir. Pull Request resolved: pytorch#129494 Approved by: https://github.com/eellison
1 parent 39eeaac commit 3cd2ae3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

test/distributed/test_c10d_nccl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2111,12 +2111,12 @@ def setUp(self):
21112111
self._spawn_processes()
21122112

21132113
def tearDown(self):
2114-
super().tearDown()
21152114
del os.environ["TORCH_NCCL_ENABLE_TIMING"]
21162115
try:
21172116
os.remove(self.file_name)
21182117
except OSError:
21192118
pass
2119+
super().tearDown()
21202120

21212121
def _get_store(self):
21222122
return dist.FileStore(self.file_name, self.world_size)

torch/testing/_internal/common_distributed.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import torch.cuda.nccl
3030
import torch.distributed as c10d
3131
import torch.nn as nn
32+
from torch._inductor.test_case import TestCase, run_tests
3233
from torch.testing._internal.common_utils import (
3334
FILE_SCHEMA,
3435
find_free_port,
@@ -38,8 +39,6 @@
3839
skip_but_pass_in_sandcastle_if,
3940
TEST_WITH_ROCM,
4041
TEST_WITH_TSAN,
41-
TestCase,
42-
run_tests,
4342
)
4443
from torch.testing._internal.distributed.multi_threaded_pg import (
4544
_install_threaded_pg,

0 commit comments

Comments
 (0)