Home
last modified time | relevance | path

Searched refs:cluster_spec (Results 1 – 25 of 98) sorted by relevance

1234

/external/tensorflow/tensorflow/python/distribute/
Dmulti_worker_util.py22 def normalize_cluster_spec(cluster_spec): argument
36 if isinstance(cluster_spec, (dict, cluster_pb2.ClusterDef)):
37 return server_lib.ClusterSpec(cluster_spec)
38 elif not isinstance(cluster_spec, server_lib.ClusterSpec):
42 return cluster_spec
45 def task_count(cluster_spec, task_type): argument
47 return cluster_spec.num_tasks(task_type)
52 def _validate_cluster_spec(cluster_spec, argument
79 cluster_spec = normalize_cluster_spec(cluster_spec)
81 if any(job not in allowed_task_types for job in cluster_spec.jobs):
[all …]
Dmulti_worker_util_test.py31 cluster_spec = {
37 cluster_spec, multi_worker_util.normalize_cluster_spec(cluster_spec))
59 cluster_spec = server_lib.ClusterSpec({
65 cluster_spec, multi_worker_util.normalize_cluster_spec(cluster_spec))
68 cluster_spec = ["127.0.0.1:8964", "127.0.0.1:2333"]
74 multi_worker_util.normalize_cluster_spec(cluster_spec)
80 cluster_spec = {
85 self.assertTrue(multi_worker_util.is_chief(cluster_spec, "chief", 0))
86 self.assertFalse(multi_worker_util.is_chief(cluster_spec, "worker", 0))
89 cluster_spec = {"worker": ["127.0.0.1:8964", "127.0.0.1:2333"]}
[all …]
Ddistribute_coordinator.py91 def _get_num_workers(cluster_spec): argument
93 if not cluster_spec:
95 return len(cluster_spec.as_dict().get(_TaskType.WORKER, [])) + len(
96 cluster_spec.as_dict().get(_TaskType.CHIEF, []))
110 cluster_spec, argument
134 self._cluster_spec = cluster_spec
141 self._num_workers = _get_num_workers(cluster_spec)
277 def cluster_spec(self): member in _WorkerContext
324 cluster_spec, argument
341 strategy.configure(session_config, cluster_spec, task_type, task_id)
[all …]
Destimator_training.py36 def _count_ps(cluster_spec): argument
38 if not cluster_spec:
42 return len(cluster_spec.as_dict().get(PS, []))
45 def _count_worker(cluster_spec, chief_task_type): argument
47 if not cluster_spec:
51 return (len(cluster_spec.as_dict().get(WORKER, [])) + len(
52 cluster_spec.as_dict().get(chief_task_type, [])))
55 def _get_global_id(cluster_spec, task_type, task_id, chief_task_type): argument
64 if chief_task_type in cluster_spec.jobs:
67 t for t in sorted(cluster_spec.jobs) if t != chief_task_type and t != PS
[all …]
Ddistribute_coordinator_test.py99 cluster_spec=None, argument
119 if (cluster_spec and task_type and task_id is not None and
191 cluster_spec = {}
193 cluster_spec[CHIEF] = ["localhost:%s" % test_util.pick_unused_port()]
195 cluster_spec[WORKER] = [
200 cluster_spec[PS] = [
204 cluster_spec[EVALUATOR] = ["localhost:%s" % test_util.pick_unused_port()]
205 return cluster_spec
244 cluster_spec, **kwargs): argument
246 for task_type in cluster_spec.keys():
[all …]
Dmulti_worker_test_base.py194 self._cluster_spec = cluster_resolver.cluster_spec().as_dict()
203 cluster_spec = cluster_resolver.cluster_spec()
219 cluster_spec, task_type, task_id, rpc_layer, collective_leader)
223 'task_id = %r, rpc_layer = %r', cluster_spec, task_type, task_id,
227 cluster_spec,
337 cluster_spec = create_cluster_spec(
345 server_lib.ClusterSpec(cluster_spec), rpc_layer=rpc_layer),
399 cluster_spec = {}
401 cluster_spec['chief'] = ['localhost:%s' % pick_unused_port()]
403 cluster_spec['worker'] = [
[all …]
Dmulti_worker_test_base_test.py31 self._cluster.cluster_resolver.cluster_spec(), protocol="grpc")
70 cluster_spec = self._cluster.cluster_resolver.cluster_spec().as_dict()
72 self.assertEqual(len(cluster_spec["worker"]), 2)
73 self.assertEqual(len(cluster_spec["ps"]), 1)
74 self.assertEqual(len(cluster_spec["chief"]), 1)
Dmulti_process_runner.py125 cluster_spec, argument
196 assert cluster_spec is not None
197 if 'chief' in cluster_spec and len(cluster_spec['chief']) > 1:
200 .format(len(cluster_spec['chief'])))
206 self._cluster_spec = cluster_spec
271 cluster_spec=None, argument
281 cluster_spec = cluster_spec or self._cluster_spec
285 id_in_cluster = multi_worker_util.id_in_cluster(cluster_spec, task_type,
287 worker_count = multi_worker_util.worker_count(cluster_spec, task_type)
293 cluster_spec=cluster_spec,
[all …]
/external/tensorflow/tensorflow/python/keras/distribute/
Ddistribute_coordinator_utils.py56 def _get_num_workers(cluster_spec): argument
58 if not cluster_spec:
60 return len(cluster_spec.as_dict().get(_TaskType.WORKER, [])) + len(
61 cluster_spec.as_dict().get(_TaskType.CHIEF, []))
75 cluster_spec, argument
99 self._cluster_spec = cluster_spec
106 self._num_workers = _get_num_workers(cluster_spec)
242 def cluster_spec(self): member in _WorkerContext
289 cluster_spec, argument
306 strategy.configure(session_config, cluster_spec, task_type, task_id)
[all …]
/external/tensorflow/tensorflow/python/distribute/cluster_resolver/
Dcluster_resolver_test.py32 def cluster_spec(self): member in MockBaseClusterResolver
123 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
124 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
126 expected_proto, server_lib.ClusterSpec(cluster_spec).as_cluster_def())
129 server_lib.ClusterSpec(cluster_spec.as_cluster_def()).as_cluster_def())
132 server_lib.ClusterSpec(cluster_spec.as_dict()).as_cluster_def())
149 actual_cluster_spec = union_resolver.cluster_spec()
271 cluster_spec = union_cluster.cluster_spec()
280 self._verifyClusterSpecEquality(cluster_spec, expected_proto)
328 cluster_spec = union_cluster.cluster_spec()
[all …]
Dslurm_cluster_resolver_test.py48 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
49 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
52 server_lib.ClusterSpec(cluster_spec).as_cluster_def())
55 server_lib.ClusterSpec(cluster_spec.as_cluster_def()).as_cluster_def())
58 server_lib.ClusterSpec(cluster_spec.as_dict()).as_cluster_def())
71 actual_cluster_spec = slurm_cluster_resolver.cluster_spec()
102 actual_cluster_spec = slurm_cluster_resolver.cluster_spec()
156 actual_cluster_spec = slurm_cluster_resolver.cluster_spec()
183 actual_cluster_spec = slurm_cluster_resolver.cluster_spec()
214 actual_cluster_spec = slurm_cluster_resolver.cluster_spec()
Dkubernetes_cluster_resolver_test.py49 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
60 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
63 server_lib.ClusterSpec(cluster_spec).as_cluster_def())
66 cluster_spec.as_cluster_def()).as_cluster_def())
69 cluster_spec.as_dict()).as_cluster_def())
78 actual_cluster_spec = cluster_resolver.cluster_spec()
97 actual_cluster_spec = cluster_resolver.cluster_spec()
134 cluster_resolver.cluster_spec()
160 actual_cluster_spec = cluster_resolver.cluster_spec()
Dcluster_resolver.py95 def cluster_spec(self): member in ClusterResolver
320 def __init__(self, cluster_spec, master='', task_type=None, task_id=None, argument
333 if not isinstance(cluster_spec, ClusterSpec):
335 self._cluster_spec = cluster_spec
341 def cluster_spec(self): member in SimpleClusterResolver
362 master = self.cluster_spec().task_address(task_type, task_id)
495 def cluster_spec(self): member in UnionClusterResolver
524 cluster_spec = cluster_resolver.cluster_spec()
525 cluster_dict = cluster_spec.as_dict()
541 cluster_spec = cluster_resolver.cluster_spec()
[all …]
Dtfconfig_cluster_resolver.py149 def cluster_spec(self): member in TFConfigClusterResolver
187 cluster_spec = self.cluster_spec()
188 if (not cluster_spec.jobs or
189 (len(cluster_spec.jobs) == 1 and
190 len(cluster_spec.job_tasks(cluster_spec.jobs[0])) == 1)):
199 return format_master_url(cluster_spec.task_address(task_type, task_id),
Dsagemaker_cluster_resolver.py156 def cluster_spec(self): member in SageMakerClusterResolver
193 cluster_spec = self.cluster_spec()
194 if (not cluster_spec.jobs or
195 (len(cluster_spec.jobs) == 1 and
196 len(cluster_spec.job_tasks(cluster_spec.jobs[0])) == 1)):
206 cluster_spec.task_address(task_type, task_id), rpc_layer)
Dgce_cluster_resolver_test.py28 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
29 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
31 expected_proto, server_lib.ClusterSpec(cluster_spec).as_cluster_def())
34 server_lib.ClusterSpec(cluster_spec.as_cluster_def()).as_cluster_def())
37 server_lib.ClusterSpec(cluster_spec.as_dict()).as_cluster_def())
128 actual_cluster_spec = gce_cluster_resolver.cluster_spec()
218 actual_cluster_spec = gce_cluster_resolver.cluster_spec()
239 actual_cluster_spec = gce_cluster_resolver.cluster_spec()
296 actual_cluster_spec = union_cluster_resolver.cluster_spec()
Dsagemaker_cluster_resolver_test.py30 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
31 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
34 server_lib.ClusterSpec(cluster_spec).as_cluster_def())
37 server_lib.ClusterSpec(cluster_spec.as_cluster_def()).as_cluster_def())
40 server_lib.ClusterSpec(cluster_spec.as_dict()).as_cluster_def())
51 actual_cluster_spec = cluster_resolver.cluster_spec()
/external/tensorflow/tensorflow/python/training/
Dserver_lib_test.py406 cluster_spec = server_lib.ClusterSpec(cluster_def)
407 self.assertProtoEquals(cluster_def, cluster_spec.as_cluster_def())
425 cluster_spec = server_lib.ClusterSpec(cluster_def)
426 self.assertProtoEquals(cluster_def, cluster_spec.as_cluster_def())
448 cluster_spec = server_lib.ClusterSpec(cluster_def)
449 self.assertProtoEquals(cluster_def, cluster_spec.as_cluster_def())
473 cluster_spec = server_lib.ClusterSpec(cluster_def)
474 self.assertProtoEquals(cluster_def, cluster_spec.as_cluster_def())
480 cluster_spec = server_lib.ClusterSpec({
488 self.assertEqual(expected_str, str(cluster_spec))
[all …]
/external/tensorflow/tensorflow/python/distribute/failure_handling/
Dgce_failure_handler_test.py65 if not cluster_resolver.cluster_spec().as_dict() or (
67 cluster_spec=cluster_resolver.cluster_spec(),
106 cluster_spec, argument
256 cluster_spec = multi_worker_test_base.create_cluster_spec(
265 cluster_spec,
266 args=(checkpoint_dir, cluster_spec, input_arg, maintenance_event,
281 mpr.start_single_process('worker', worker_id, cluster_spec)
292 cluster_spec = server_lib.ClusterSpec({})
295 self.worker_fn(checkpoint_dir, cluster_spec, input_arg,
309 self.worker_fn(checkpoint_dir, cluster_spec, input_arg,
[all …]
Dfailure_handler_test.py64 if not cluster_resolver.cluster_spec().as_dict() or (
66 cluster_spec=cluster_resolver.cluster_spec(),
118 cluster_spec, argument
164 if cluster_spec and (
241 cluster_spec = multi_worker_test_base.create_cluster_spec(
250 cluster_spec,
251 args=(checkpoint_dir, cluster_spec, input_arg,
273 mpr.start_single_process('worker', worker_id, cluster_spec)
279 cluster_spec = server_lib.ClusterSpec({})
298 self.worker_fn(checkpoint_dir, cluster_spec, input_arg,
[all …]
/external/tensorflow/tensorflow/python/eager/
Dremote.py70 cluster_spec = server_lib.ClusterSpec(
73 connect_to_cluster(cluster_spec)
139 cluster_spec = cluster_spec_or_resolver
144 cluster_spec = cluster_spec_or_resolver.cluster_spec()
150 cluster_def = copy.deepcopy(cluster_spec.as_cluster_def())
163 if current_server_def and job_name not in cluster_spec.jobs:
173 if job_name not in cluster_spec.jobs:
206 for job_name in cluster_spec.jobs:
207 for task_id in cluster_spec.task_indices(job_name):
208 task_address = cluster_spec.task_address(job_name, task_id)
/external/tensorflow/tensorflow/python/distribute/cluster_resolver/tpu/
Dtpu_cluster_resolver.py256 cluster_spec = self.cluster_spec()
259 master = cluster_spec.task_address(task_type, task_id)
262 master = cluster_spec.task_address(self.task_type, self.task_id)
265 job_tasks = cluster_spec.job_tasks(self.task_type)
294 cluster_spec = self.cluster_spec()
295 cluster_def = cluster_spec.as_cluster_def() if cluster_spec else None
304 def cluster_spec(self): member in TPUClusterResolver
335 cluster_spec = {self.task_type: worker_list}
338 cluster_spec[self._coordinator_name] = [self._coordinator_address]
339 return server_lib.ClusterSpec(cluster_spec)
Dtpu_cluster_resolver_test.py101 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
112 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
115 server_lib.ClusterSpec(cluster_spec).as_cluster_def())
118 server_lib.ClusterSpec(cluster_spec.as_cluster_def()).as_cluster_def())
121 server_lib.ClusterSpec(cluster_spec.as_dict()).as_cluster_def())
170 actual_cluster_spec = cluster_resolver.cluster_spec()
204 actual_cluster_spec = cluster_resolver.cluster_spec()
231 cluster_resolver.cluster_spec()
252 actual_cluster_spec = cluster_resolver.cluster_spec()
279 cluster_resolver.cluster_spec()
[all …]
/external/tensorflow/tensorflow/python/distribute/integration_test/
Dmwms_peer_failure_test.py86 cluster_spec = multi_worker_test_base.create_cluster_spec(num_workers=2)
88 worker_fn, cluster_spec, rpc_layer=RPC_PROTOCOL)
120 cluster_spec = multi_worker_test_base.create_cluster_spec(num_workers=2)
122 worker_fn, cluster_spec, rpc_layer=RPC_PROTOCOL)
148 cluster_spec = multi_worker_test_base.create_cluster_spec(num_workers=2)
152 cluster_spec,
173 cluster_spec = multi_worker_test_base.create_cluster_spec(num_workers=2)
177 cluster_spec,
216 cluster_spec = multi_worker_test_base.create_cluster_spec(num_workers=2)
220 cluster_spec,
/external/tensorflow/tensorflow/python/tpu/
Dtpu_strategy_util.py126 cluster_spec = cluster_resolver.cluster_spec()
129 if cluster_spec:
130 session_config.cluster_def.CopyFrom(cluster_spec.as_cluster_def())
223 cluster_spec = cluster_resolver.cluster_spec()
226 if cluster_spec:
227 session_config.cluster_def.CopyFrom(cluster_spec.as_cluster_def())

1234