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

Set the default work start method to spawn on MacOS #16089

Merged
merged 10 commits into from Dec 19, 2022
2 changes: 0 additions & 2 deletions src/lightning_app/components/serve/gradio.py
Expand Up @@ -34,8 +34,6 @@ class ServeGradio(LightningWork, abc.ABC):
title: Optional[str] = None
description: Optional[str] = None

_start_method = "spawn"

def __init__(self, *args, **kwargs):
requires("gradio")(super().__init__(*args, **kwargs))
assert self.inputs
Expand Down
3 changes: 0 additions & 3 deletions src/lightning_app/components/serve/python_server.py
Expand Up @@ -64,9 +64,6 @@ def _get_sample_data() -> Dict[Any, Any]:


class PythonServer(LightningWork, abc.ABC):

_start_method = "spawn"

@requires(["torch"])
def __init__( # type: ignore
self,
Expand Down
3 changes: 1 addition & 2 deletions src/lightning_app/core/work.py
Expand Up @@ -55,8 +55,7 @@ class LightningWork:
)

_run_executor_cls: Type[WorkRunExecutor] = WorkRunExecutor
# TODO: Move to spawn for all Operating System.
_start_method = "spawn" if sys.platform == "win32" else "fork"
_start_method = "spawn"

def __init__(
self,
Expand Down