[inductor] Enable subprocess-based parallel compile as the default (#126817)

Differential Revision: [D58239826](https://our.internmc.facebook.com/intern/diff/D58239826)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/126817
Approved by: https://github.com/eellison
ghstack dependencies: #128037, #128086
This commit is contained in:
Sam Larsen 2024-06-05 17:04:21 -07:00 committed by PyTorch MergeBot
parent ac51f782fe
commit 852b7b4c99

View file

@ -387,7 +387,9 @@ developer_warnings = is_fbcode() or is_nightly_or_source
# The multiprocessing start method to use for inductor workers in the codecache.
# "subprocess", "fork", or "spawn"
def decide_worker_start_method():
start_method = os.environ.get("TORCHINDUCTOR_WORKER_START", "fork")
start_method = os.environ.get(
"TORCHINDUCTOR_WORKER_START", "fork" if is_fbcode() else "subprocess"
)
assert start_method in [
"subprocess",
"fork",