From 91b869d04300bda906306a15f018520e745a75ff Mon Sep 17 00:00:00 2001 From: William Falcon Date: Fri, 12 Jul 2019 15:55:28 -0400 Subject: [PATCH] fixed nccl init --- pytorch_lightning/models/trainer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/models/trainer.py b/pytorch_lightning/models/trainer.py index 64fbf16b..fb08a337 100644 --- a/pytorch_lightning/models/trainer.py +++ b/pytorch_lightning/models/trainer.py @@ -375,7 +375,10 @@ class Trainer(TrainerIO): :param tries: :return: """ - sleep(self.proc_rank*2) + # hack to get nccl to stop throwing error... seems to be an nccl race condition + if self.proc_rank > 0: + sleep(10.0) + root_node = os.environ['SLURM_NODELIST'].split(' ')[0] os.environ['MASTER_ADDR'] = root_node os.environ['MASTER_PORT'] = f'{port}'