From d6133b2fe6b863dd49fb21641bd04e24e19ac794 Mon Sep 17 00:00:00 2001 From: Pritam Damania Date: Sun, 22 Aug 2021 18:55:45 -0700 Subject: [PATCH] Remove `_fork_processes` from common_distributed.py (#63711) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63711 This removes `_fork_process` from common_distributed.py and fixes all other callpoints to use `spawn_process` instead. ghstack-source-id: 136395719 Test Plan: waitforbuildbot Reviewed By: xush6528 Differential Revision: D30463834 fbshipit-source-id: 0c09e8a996d0e5b912c8cdd45488a39951bac4db --- torch/testing/_internal/common_distributed.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/torch/testing/_internal/common_distributed.py b/torch/testing/_internal/common_distributed.py index fb505d1..01e167f 100644 --- a/torch/testing/_internal/common_distributed.py +++ b/torch/testing/_internal/common_distributed.py @@ -9,7 +9,6 @@ import time import traceback import types import unittest -import warnings from contextlib import contextmanager from datetime import timedelta from enum import Enum @@ -468,14 +467,6 @@ class MultiProcessTestCase(TestCase): self.pid_to_pipe[process.pid] = parent_conn self.processes.append(process) - def _fork_processes(self) -> None: - warnings.warn( - "Fork based multiprocessing is dangerous and should not" - " be used, for tests with ASAN consider using opt-asan", - DeprecationWarning) - proc = torch.multiprocessing.get_context("fork").Process - self._start_processes(proc) - def _spawn_processes(self) -> None: proc = torch.multiprocessing.get_context("spawn").Process self._start_processes(proc) -- 2.7.4