Allow Horovod `teardown()` to complete gracefully if exception thrown in callback setup (#11752)
This commit is contained in:
parent
819a747031
commit
9d8faecdb2
|
@ -472,6 +472,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
### Fixed
|
||||
|
||||
- Fixed an issue where `HorovodStrategy.teardown()` did not complete gracefully if an exception was thrown during callback setup [#11752](https://github.com/PyTorchLightning/pytorch-lightning/pull/11752)
|
||||
|
||||
- Fixed security vulnerabilities CVE-2020-1747 and CVE-2020-14343 caused by the `PyYAML` dependency ([#11099](https://github.com/PyTorchLightning/pytorch-lightning/pull/11099))
|
||||
|
||||
|
||||
|
|
|
@ -197,6 +197,8 @@ class HorovodStrategy(ParallelStrategy):
|
|||
|
||||
def teardown(self) -> None:
|
||||
super().teardown()
|
||||
# teardown may be called before `_exit_stack` is set
|
||||
if self._exit_stack:
|
||||
self._exit_stack.__exit__(None, None, None)
|
||||
self._exit_stack = None
|
||||
# Make sure all workers have finished training before returning to the user
|
||||
|
|
Loading…
Reference in New Issue