Skip to content

Commit

Permalink
Fix order of SyncBN for ddp_spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
BloodAxe authored Apr 5, 2021
1 parent a168079 commit 9b4a71d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pytorch_lightning/plugins/training_type/ddp_spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ def new_process(self, process_idx, trainer, mp_queue):
self.dist.rank = self.global_rank
self.dist.device = self.root_device

if self.sync_batchnorm:
self.model = self.configure_sync_batchnorm(self.model)

# move the model to the correct device
self.model_to_device()

if self.sync_batchnorm:
self.model = self.configure_sync_batchnorm(self.model)

self.configure_ddp()

self.barrier()
Expand Down

0 comments on commit 9b4a71d

Please sign in to comment.