From b247403af80fec171592c1698701b3f9dc04a7d1 Mon Sep 17 00:00:00 2001 From: Rick Chao Date: Mon, 11 May 2020 15:03:17 -0700 Subject: [PATCH] Mark multi-process utilities with subprocess module as deprecated in favor of using MultiProcessRunner. PiperOrigin-RevId: 311001636 Change-Id: I33aabec4376a9702fec77016c957bd8f9edbec5e --- .../python/distribute/multi_worker_test_base.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tensorflow/python/distribute/multi_worker_test_base.py b/tensorflow/python/distribute/multi_worker_test_base.py index a80ca831e4b..408cad2ca0a 100644 --- a/tensorflow/python/distribute/multi_worker_test_base.py +++ b/tensorflow/python/distribute/multi_worker_test_base.py @@ -50,6 +50,7 @@ from tensorflow.python.platform import test from tensorflow.python.platform import tf_logging as logging from tensorflow.python.training import coordinator from tensorflow.python.training import server_lib +from tensorflow.python.util import deprecation from tensorflow.python.util import nest from tensorflow.python.util.compat import collections_abc @@ -559,6 +560,10 @@ class MultiWorkerMultiProcessTest(test.TestCase): return subprocess.Popen( cmd_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) + @deprecation.deprecated( + None, '`run_multiple_tasks_in_processes` is deprecated; any new test ' + 'requiring multiple processes should use `multi_process_runner` for ' + 'better support of log printing, streaming, and more functionality.') def run_multiple_tasks_in_processes(self, cmd_args, cluster_spec): """Run `cmd_args` in a process for each task in `cluster_spec`.""" processes = {} @@ -570,6 +575,10 @@ class MultiWorkerMultiProcessTest(test.TestCase): processes[task_type].append(p) return processes + @deprecation.deprecated( + None, '`join_independent_workers` is deprecated; any new test ' + 'requiring multiple processes should use `multi_process_runner` for ' + 'better support of log printing, streaming, and more functionality.') def join_independent_workers(self, worker_processes): return_codes = [] for p in nest.flatten(worker_processes): @@ -585,6 +594,10 @@ class MultiWorkerMultiProcessTest(test.TestCase): for return_code in return_codes: self.assertEqual(return_code, 0) + @deprecation.deprecated( + None, '`stream_stderr` is deprecated; any new test ' + 'requiring multiple processes should use `multi_process_runner` for ' + 'better support of log printing, streaming, and more functionality.') def stream_stderr(self, processes, print_only_first=False): """Consume stderr of all processes and print to stdout.