diff --git a/src/lightning_app/CHANGELOG.md b/src/lightning_app/CHANGELOG.md index 4c5da2c96e2e4..54219e0f31eed 100644 --- a/src/lightning_app/CHANGELOG.md +++ b/src/lightning_app/CHANGELOG.md @@ -43,6 +43,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed the PyTorch Inference locally on GPU ([#15813](https://github.com/Lightning-AI/lightning/pull/15813)) +- Fixed the `enable_spawn` method of the `WorkRunExecutor` ([#15812](https://github.com/Lightning-AI/lightning/pull/15812)) + + ## [1.8.2] - 2022-11-17 ### Added diff --git a/src/lightning_app/utilities/proxies.py b/src/lightning_app/utilities/proxies.py index 07b03da7d9201..2e7dc6ce7efec 100644 --- a/src/lightning_app/utilities/proxies.py +++ b/src/lightning_app/utilities/proxies.py @@ -17,6 +17,7 @@ from deepdiff import DeepDiff, Delta from lightning_utilities.core.apply_func import apply_to_collection +from lightning_app.core.queues import MultiProcessQueue from lightning_app.storage import Path from lightning_app.storage.copier import _Copier, _copy_files from lightning_app.storage.drive import _maybe_create_drive, Drive @@ -357,7 +358,7 @@ def enable_spawn(self) -> Generator: yield def _clean_queues(self): - if "LIGHTNING_APP_STATE_URL" in os.environ: + if not isinstance(self.work._request_queue, MultiProcessQueue): self.work._request_queue = self.work._request_queue.to_dict() self.work._response_queue = self.work._response_queue.to_dict()