mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
fixed c10d test (#10557)
Summary: fixed NCCL test, which is not run in CI. We should enable it soon. ``` ~/new_pytorch/pytorch/test$ python test_c10d.py ............... ---------------------------------------------------------------------- Ran 15 tests in 13.099s OK ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/10557 Reviewed By: ailzhang Differential Revision: D9353286 Pulled By: teng-li fbshipit-source-id: 5a722975beaa601203f51c723522cc881f2d2090
This commit is contained in:
parent
0a809fc8b1
commit
05dcf00644
1 changed files with 3 additions and 3 deletions
|
|
@ -432,7 +432,7 @@ class ProcessGroupNCCLTest(TestCase):
|
|||
|
||||
def test_reduce_ops(self):
|
||||
store = c10d.FileStore(self.file.name)
|
||||
pg = c10d.ProcessGroupNCCL(store, self.rank, self.size)
|
||||
pg = c10d.ProcessGroupNCCL(store, self.rank, self.world_size)
|
||||
|
||||
def reduce(xs, rootRank, rootTensor):
|
||||
opts = c10d.ReduceOptions()
|
||||
|
|
@ -455,7 +455,7 @@ class ProcessGroupNCCLTest(TestCase):
|
|||
|
||||
def test_allgather_ops(self):
|
||||
store = c10d.FileStore(self.file.name)
|
||||
pg = c10d.ProcessGroupNCCL(store, self.rank, self.size)
|
||||
pg = c10d.ProcessGroupNCCL(store, self.rank, self.world_size)
|
||||
|
||||
def allgather(output_ts, input_ts):
|
||||
work = pg.allgather(output_ts, input_ts)
|
||||
|
|
@ -465,7 +465,7 @@ class ProcessGroupNCCLTest(TestCase):
|
|||
output_ts = [[] for _ in range(self.num_gpus)]
|
||||
|
||||
for idx, ls in enumerate(output_ts):
|
||||
for _ in range(self.size):
|
||||
for _ in range(self.world_size):
|
||||
ls.append(torch.Tensor([0]).cuda(idx))
|
||||
|
||||
for i in range(self.num_gpus):
|
||||
|
|
|
|||
Loading…
Reference in a new issue