Home
last modified time | relevance | path

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

1234

/external/tensorflow/tensorflow/python/distribute/
Dmulti_worker_util.py25 def normalize_cluster_spec(cluster_spec): argument
39 if isinstance(cluster_spec, (dict, cluster_pb2.ClusterDef)):
40 return server_lib.ClusterSpec(cluster_spec)
41 elif not isinstance(cluster_spec, server_lib.ClusterSpec):
45 return cluster_spec
49 def _validate_cluster_spec(cluster_spec, task_type, task_id): argument
65 cluster_spec = normalize_cluster_spec(cluster_spec).as_dict()
66 if task_type and task_type not in cluster_spec:
68 if len(cluster_spec.get("chief", [])) > 1:
70 if task_id >= len(cluster_spec[task_type]):
[all …]
Dmulti_worker_util_test.py35 cluster_spec = {
41 cluster_spec, multi_worker_util.normalize_cluster_spec(cluster_spec))
63 cluster_spec = server_lib.ClusterSpec({
69 cluster_spec, multi_worker_util.normalize_cluster_spec(cluster_spec))
72 cluster_spec = ["127.0.0.1:8964", "127.0.0.1:2333"]
78 multi_worker_util.normalize_cluster_spec(cluster_spec)
84 cluster_spec = {
89 self.assertTrue(multi_worker_util.is_chief(cluster_spec, "chief", 0))
90 self.assertFalse(multi_worker_util.is_chief(cluster_spec, "worker", 0))
93 cluster_spec = {"worker": ["127.0.0.1:8964", "127.0.0.1:2333"]}
[all …]
Ddistribute_coordinator.py95 def _get_num_workers(cluster_spec): argument
97 if not cluster_spec:
99 return len(cluster_spec.as_dict().get(_TaskType.WORKER, [])) + len(
100 cluster_spec.as_dict().get(_TaskType.CHIEF, []))
114 cluster_spec, argument
138 self._cluster_spec = cluster_spec
145 self._num_workers = _get_num_workers(cluster_spec)
281 def cluster_spec(self): member in _WorkerContext
328 cluster_spec, argument
345 strategy.configure(session_config, cluster_spec, task_type, task_id)
[all …]
Destimator_training.py40 def _count_ps(cluster_spec): argument
42 if not cluster_spec:
46 return len(cluster_spec.as_dict().get(PS, []))
49 def _count_worker(cluster_spec, chief_task_type): argument
51 if not cluster_spec:
55 return (len(cluster_spec.as_dict().get(WORKER, [])) + len(
56 cluster_spec.as_dict().get(chief_task_type, [])))
59 def _get_global_id(cluster_spec, task_type, task_id, chief_task_type): argument
68 if chief_task_type in cluster_spec.jobs:
71 t for t in sorted(cluster_spec.jobs) if t != chief_task_type and t != PS
[all …]
Ddistribute_coordinator_test.py107 cluster_spec=None, argument
127 if (cluster_spec and task_type and task_id is not None and
201 cluster_spec = {}
203 cluster_spec[CHIEF] = ["localhost:%s" % portpicker.pick_unused_port()]
205 cluster_spec[WORKER] = [
210 cluster_spec[PS] = [
214 cluster_spec[EVALUATOR] = ["localhost:%s" % portpicker.pick_unused_port()]
215 return cluster_spec
248 cluster_spec, **kwargs): argument
250 for task_type in cluster_spec.keys():
[all …]
Dparameter_server_strategy.py110 if cluster_resolver.cluster_spec().as_dict():
140 cluster_spec = cluster_resolver.cluster_spec()
146 cluster_spec = multi_worker_util.normalize_cluster_spec(cluster_spec)
147 assert cluster_spec.as_dict()
173 num_ps_replicas = len(cluster_spec.as_dict().get("ps", []))
180 cluster=cluster_spec)
192 self._is_chief = multi_worker_util.is_chief(cluster_spec, task_type,
194 self._cluster_spec = cluster_spec
202 "variable_device = %r", cluster_spec.as_dict(), task_type, task_id,
461 cluster_spec=None, argument
[all …]
Dcollective_all_reduce_strategy.py101 if cluster_resolver.cluster_spec().as_dict():
162 cluster_spec = multi_worker_util.normalize_cluster_spec(
163 cluster_resolver.cluster_spec())
174 self._num_workers = multi_worker_util.worker_count(cluster_spec, task_type)
179 self._is_chief = multi_worker_util.is_chief(cluster_spec, task_type,
203 self._cluster_spec = cluster_spec
214 "communication = %s", cluster_spec.as_dict(), task_type,
226 cluster=cluster_spec.as_cluster_def(),
355 cluster_spec=None, argument
370 if cluster_spec:
[all …]
/external/tensorflow/tensorflow/python/distribute/cluster_resolver/
Dcluster_resolver_test.py35 def cluster_spec(self): member in MockBaseClusterResolver
126 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
127 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
129 expected_proto, server_lib.ClusterSpec(cluster_spec).as_cluster_def())
132 server_lib.ClusterSpec(cluster_spec.as_cluster_def()).as_cluster_def())
135 server_lib.ClusterSpec(cluster_spec.as_dict()).as_cluster_def())
152 actual_cluster_spec = union_resolver.cluster_spec()
274 cluster_spec = union_cluster.cluster_spec()
283 self._verifyClusterSpecEquality(cluster_spec, expected_proto)
331 cluster_spec = union_cluster.cluster_spec()
[all …]
Dcluster_resolver.py92 def cluster_spec(self): member in ClusterResolver
185 def __init__(self, cluster_spec, master='', task_type=None, task_id=None, argument
198 if not isinstance(cluster_spec, ClusterSpec):
200 self._cluster_spec = cluster_spec
206 def cluster_spec(self): member in SimpleClusterResolver
225 master = self.cluster_spec().task_address(task_type, task_id)
329 def cluster_spec(self): member in UnionClusterResolver
358 cluster_spec = cluster_resolver.cluster_spec()
359 cluster_dict = cluster_spec.as_dict()
375 cluster_spec = cluster_resolver.cluster_spec()
[all …]
Dkubernetes_cluster_resolver_test.py53 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
64 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
67 server_lib.ClusterSpec(cluster_spec).as_cluster_def())
70 cluster_spec.as_cluster_def()).as_cluster_def())
73 cluster_spec.as_dict()).as_cluster_def())
82 actual_cluster_spec = cluster_resolver.cluster_spec()
101 actual_cluster_spec = cluster_resolver.cluster_spec()
138 cluster_resolver.cluster_spec()
164 actual_cluster_spec = cluster_resolver.cluster_spec()
Dslurm_cluster_resolver_test.py35 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
36 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
39 server_lib.ClusterSpec(cluster_spec).as_cluster_def())
42 server_lib.ClusterSpec(cluster_spec.as_cluster_def()).as_cluster_def())
45 server_lib.ClusterSpec(cluster_spec.as_dict()).as_cluster_def())
62 actual_cluster_spec = slurm_cluster_resolver.cluster_spec()
113 actual_cluster_spec = slurm_cluster_resolver.cluster_spec()
141 actual_cluster_spec = slurm_cluster_resolver.cluster_spec()
173 actual_cluster_spec = slurm_cluster_resolver.cluster_spec()
Dtfconfig_cluster_resolver.py124 def cluster_spec(self): member in TFConfigClusterResolver
160 cluster_spec = self.cluster_spec()
161 if (not cluster_spec.jobs or
162 (len(cluster_spec.jobs) == 1 and
163 len(cluster_spec.job_tasks(cluster_spec.jobs[0])) == 1)):
171 return format_master_url(cluster_spec.task_address(task_type, task_id),
Dtpu_cluster_resolver_test.py96 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
107 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
110 server_lib.ClusterSpec(cluster_spec).as_cluster_def())
113 cluster_spec.as_cluster_def()).as_cluster_def())
116 cluster_spec.as_dict()).as_cluster_def())
173 actual_cluster_spec = resolver.cluster_spec()
207 actual_cluster_spec = resolver.cluster_spec()
235 resolver.cluster_spec()
255 actual_cluster_spec = resolver.cluster_spec()
283 actual_cluster_spec = resolver.cluster_spec()
[all …]
Dgce_cluster_resolver_test.py32 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
33 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
35 expected_proto, server_lib.ClusterSpec(cluster_spec).as_cluster_def())
38 server_lib.ClusterSpec(cluster_spec.as_cluster_def()).as_cluster_def())
41 server_lib.ClusterSpec(cluster_spec.as_dict()).as_cluster_def())
132 actual_cluster_spec = gce_cluster_resolver.cluster_spec()
222 actual_cluster_spec = gce_cluster_resolver.cluster_spec()
243 actual_cluster_spec = gce_cluster_resolver.cluster_spec()
300 actual_cluster_spec = union_cluster_resolver.cluster_spec()
Dtfconfig_cluster_resolver_test.py36 def _verifyClusterSpecEquality(self, cluster_spec, expected_proto): argument
37 self.assertProtoEquals(expected_proto, cluster_spec.as_cluster_def())
39 expected_proto, server_lib.ClusterSpec(cluster_spec).as_cluster_def())
42 server_lib.ClusterSpec(cluster_spec.as_cluster_def()).as_cluster_def())
45 server_lib.ClusterSpec(cluster_spec.as_dict()).as_cluster_def())
69 actual_cluster_spec = cluster_resolver.cluster_spec()
Dtpu_cluster_resolver.py358 cluster_spec = self.cluster_spec()
361 master = cluster_spec.task_address(task_type, task_id)
364 master = cluster_spec.task_address(self.task_type, self.task_id)
367 job_tasks = cluster_spec.job_tasks(self.task_type)
386 def cluster_spec(self): member in TPUClusterResolver
432 cluster_spec = {self.task_type: worker_list}
448 cluster_spec = {self.task_type: tpus}
452 cluster_spec[self._coordinator_name] = [self._coordinator_address]
454 return server_lib.ClusterSpec(cluster_spec)
/external/tensorflow/tensorflow/python/training/
Dserver_lib_test.py358 cluster_spec = server_lib.ClusterSpec(cluster_def)
359 self.assertProtoEquals(cluster_def, cluster_spec.as_cluster_def())
377 cluster_spec = server_lib.ClusterSpec(cluster_def)
378 self.assertProtoEquals(cluster_def, cluster_spec.as_cluster_def())
400 cluster_spec = server_lib.ClusterSpec(cluster_def)
401 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())
432 cluster_spec = server_lib.ClusterSpec({
440 self.assertEqual(expected_str, str(cluster_spec))
[all …]
Ddevice_setter.py196 cluster_spec = cluster.as_dict()
198 cluster_spec = server_lib.ClusterSpec(cluster).as_dict()
201 if ps_job_name not in cluster_spec or cluster_spec[ps_job_name] is None:
203 ps_tasks = len(cluster_spec[ps_job_name])
/external/tensorflow/tensorflow/contrib/learn/python/learn/estimators/
Drun_config.py169 def cluster_spec(self): member in ClusterConfig
411 def _count_ps(cluster_spec): argument
413 return len(cluster_spec.as_dict().get('ps', [])) if cluster_spec else 0
416 def _count_worker(cluster_spec): argument
430 return (len(cluster_spec.as_dict().get('worker', [])) +
431 len(cluster_spec.as_dict().get('master', []))) if cluster_spec else 0
434 def _get_master(cluster_spec, task_type, task_id): argument
436 if not cluster_spec:
440 jobs = cluster_spec.jobs
441 if len(jobs) == 1 and len(cluster_spec.job_tasks(jobs[0])) == 1:
[all …]
Drun_config_test.py55 self.assertEqual(config.cluster_spec, {})
78 self.assertEqual(config.cluster_spec.as_dict(), tf_config["cluster"])
84 cluster_spec = {
89 "cluster": cluster_spec,
103 self.assertEqual(config.cluster_spec, server_lib.ClusterSpec(cluster_spec))
340 self.assertEqual(tf_config["cluster"], config.cluster_spec.as_dict())
343 self.assertEqual(tf_config["cluster"], new_config.cluster_spec.as_dict())
/external/tensorflow/tensorflow/contrib/distribute/python/
Dmulti_worker_test_base.py183 cluster_spec = {}
185 cluster_spec['chief'] = ['localhost:%s' % pick_unused_port()]
187 cluster_spec['worker'] = [
191 cluster_spec['ps'] = [
195 cluster_spec['evaluator'] = ['localhost:%s' % pick_unused_port()]
196 return cluster_spec
289 def _run_between_graph_clients(self, client_fn, cluster_spec, num_gpus, *args, argument
303 for task_id in range(len(cluster_spec.get(task_type, []))):
397 def _run_task_in_thread(self, task_fn, cluster_spec, task_type, task_id, argument
401 'cluster': cluster_spec,
[all …]
Destimator_training_test.py283 cluster_spec = copy.deepcopy(self._cluster_spec)
286 cluster_spec.pop("ps", None)
288 cluster_spec)
313 cluster_spec = copy.deepcopy(self._cluster_spec)
314 cluster_spec.pop("ps", None)
316 cluster_spec)
394 cluster_spec = multi_worker_test_base.create_cluster_spec(
399 cluster_spec = multi_worker_test_base.create_cluster_spec(
405 cluster_spec, train_distribute,
440 cluster_spec = multi_worker_test_base.create_cluster_spec(
[all …]
/external/tensorflow/tensorflow/core/distributed_runtime/rpc/
Dgrpc_tensorflow_server.cc41 Status FillServerDef(const string& cluster_spec, const string& job_name, in FillServerDef() argument
51 for (const string& job_str : str_util::Split(cluster_spec, ',')) { in FillServerDef()
99 tensorflow::string cluster_spec; in main() local
103 tensorflow::Flag("cluster_spec", &cluster_spec, "cluster spec"), in main()
116 tensorflow::Status s = tensorflow::FillServerDef(cluster_spec, job_name, in main()
/external/tensorflow/tensorflow/python/debug/lib/
Dgrpc_tensorflow_server.py45 def parse_cluster_spec(cluster_spec, cluster, verbose=False): argument
58 job_strings = cluster_spec.split(",")
60 if not cluster_spec:
96 parse_cluster_spec(FLAGS.cluster_spec, server_def.cluster, FLAGS.verbose)
/external/tensorflow/tensorflow/contrib/tpu/profiler/pip_package/cloud_tpu_profiler/
Dmain.py76 cluster_spec = cluster_resolver.cluster_spec()
77 task_indices = cluster_spec.task_indices(JOB_NAME)
79 cluster_spec.task_address(JOB_NAME, i).split(':')[0] for i in task_indices

1234