Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/4319 ddp checkpoint #4323

Merged
merged 10 commits into from
Oct 24, 2020
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Fixed

- Fixed synchronization of best model path in `ddp_accelerator` ([#4323](https://github.com/PyTorchLightning/pytorch-lightning/pull/4323))

## [1.0.3] - 2020-10-20

Expand Down
3 changes: 2 additions & 1 deletion pytorch_lightning/accelerators/accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def setup(self, model):
pass

def teardown(self):
pass
# Ensure if necessary all processes are finished
self.barrier()

def barrier(self, name: Optional[str] = None):
pass
Expand Down
1 change: 1 addition & 0 deletions pytorch_lightning/accelerators/dp_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def train(self):
def teardown(self):
# replace the original fwd function
self.trainer.model.forward = self.model_autocast_original_forward
self.barrier()

def training_step(self, args):
if self.trainer.amp_backend == AMPType.NATIVE:
Expand Down
3 changes: 0 additions & 3 deletions pytorch_lightning/accelerators/horovod_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ def train(self):
hvd.join()
return results

def teardown(self):
pass

def training_step(self, args):
if self.trainer.on_gpu:
batch = args[0]
Expand Down