diff --git a/torch/_inductor/config.py b/torch/_inductor/config.py index b8ff5ae5a6c..dbaa528cd3e 100644 --- a/torch/_inductor/config.py +++ b/torch/_inductor/config.py @@ -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",