Mark multi-process utilities with subprocess module as deprecated in favor of using MultiProcessRunner.
PiperOrigin-RevId: 311001636 Change-Id: I33aabec4376a9702fec77016c957bd8f9edbec5e
This commit is contained in:
parent
708c42b0fd
commit
b247403af8
@ -50,6 +50,7 @@ from tensorflow.python.platform import test
|
|||||||
from tensorflow.python.platform import tf_logging as logging
|
from tensorflow.python.platform import tf_logging as logging
|
||||||
from tensorflow.python.training import coordinator
|
from tensorflow.python.training import coordinator
|
||||||
from tensorflow.python.training import server_lib
|
from tensorflow.python.training import server_lib
|
||||||
|
from tensorflow.python.util import deprecation
|
||||||
from tensorflow.python.util import nest
|
from tensorflow.python.util import nest
|
||||||
from tensorflow.python.util.compat import collections_abc
|
from tensorflow.python.util.compat import collections_abc
|
||||||
|
|
||||||
@ -559,6 +560,10 @@ class MultiWorkerMultiProcessTest(test.TestCase):
|
|||||||
return subprocess.Popen(
|
return subprocess.Popen(
|
||||||
cmd_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
|
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):
|
def run_multiple_tasks_in_processes(self, cmd_args, cluster_spec):
|
||||||
"""Run `cmd_args` in a process for each task in `cluster_spec`."""
|
"""Run `cmd_args` in a process for each task in `cluster_spec`."""
|
||||||
processes = {}
|
processes = {}
|
||||||
@ -570,6 +575,10 @@ class MultiWorkerMultiProcessTest(test.TestCase):
|
|||||||
processes[task_type].append(p)
|
processes[task_type].append(p)
|
||||||
return processes
|
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):
|
def join_independent_workers(self, worker_processes):
|
||||||
return_codes = []
|
return_codes = []
|
||||||
for p in nest.flatten(worker_processes):
|
for p in nest.flatten(worker_processes):
|
||||||
@ -585,6 +594,10 @@ class MultiWorkerMultiProcessTest(test.TestCase):
|
|||||||
for return_code in return_codes:
|
for return_code in return_codes:
|
||||||
self.assertEqual(return_code, 0)
|
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):
|
def stream_stderr(self, processes, print_only_first=False):
|
||||||
"""Consume stderr of all processes and print to stdout.
|
"""Consume stderr of all processes and print to stdout.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user