fixes ddp bugs (#1819)

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug
This commit is contained in:
William Falcon
2020-05-13 19:17:04 -04:00
committed by GitHub
parent 648d516668
commit 53d9316a56
6 changed files with 30 additions and 10 deletions
+2 -2
View File
@@ -111,8 +111,8 @@ class TrainerDataLoadingMixin(ABC):
if not is_dataloader or is_iterable_ds:
return dataloader
need_dist_sampler = (self.use_ddp or self.use_ddp2 or self.use_horovod or self.use_tpu)
if self.replace_sampler_ddp and need_dist_sampler:
if self.replace_sampler_ddp and need_dist_sampler:
skip_keys = ['sampler', 'batch_sampler', 'dataset_kind']
dl_args = {
@@ -137,7 +137,7 @@ class TrainerDataLoadingMixin(ABC):
}
sampler = DistributedSampler(
dataloader.dataset,
num_replicas=world_size.get(self.distributed_backend, 0),
num_replicas=world_size[self.distributed_backend],
rank=self.proc_rank,
)