We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef2f78a commit 5467799Copy full SHA for 5467799
python/monarch/_src/actor/bootstrap_main.py
@@ -13,6 +13,7 @@
13
import logging
14
import os
15
import sys
16
+import multiprocessing
17
18
# Import torch to avoid import-time races if a spawned actor tries to import torch.
19
try:
@@ -63,4 +64,7 @@ def invoke_main():
63
64
65
66
if __name__ == "__main__":
67
+ # Ensure that processes started via `multiprocessing` are spawned, not forked.
68
+ # forking is a terrible default, see: https://github.com/python/cpython/issues/84559
69
+ multiprocessing.set_start_method("spawn", force=True)
70
invoke_main() # pragma: no cover
0 commit comments