| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a402964 commit 6d83874
13 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -873,7 +873,6 @@ py_library( | |||
| 873 | 873 | deps = [ | |
| 874 | 874 | ":framework", | |
| 875 | 875 | ":ops", | |
| 876 | - ":server_lib", | ||
| 877 | 876 | ":session", | |
| 878 | 877 | ":training_ops", | |
| 879 | 878 | ], | |
@@ -984,7 +983,6 @@ tf_py_wrap_cc( | |||
| 984 | 983 | swig_includes = [ | |
| 985 | 984 | "client/device_lib.i", | |
| 986 | 985 | "client/events_writer.i", | |
| 987 | - "client/server_lib.i", | ||
| 988 | 986 | "client/tf_session.i", | |
| 989 | 987 | "framework/python_op_gen.i", | |
| 990 | 988 | "lib/core/py_func.i", | |
@@ -995,6 +993,7 @@ tf_py_wrap_cc( | |||
| 995 | 993 | "lib/io/py_record_writer.i", | |
| 996 | 994 | "platform/base.i", | |
| 997 | 995 | "platform/numpy.i", | |
| 996 | + "training/server_lib.i", | ||
| 998 | 997 | "util/port.i", | |
| 999 | 998 | "util/py_checkpoint_reader.i", | |
| 1000 | 999 | ], | |
@@ -1032,25 +1031,15 @@ py_library( | |||
| 1032 | 1031 | ], | |
| 1033 | 1032 | ) | |
| 1034 | 1033 | ||
| 1035 | - py_library( | ||
| 1036 | - name = "server_lib", | ||
| 1037 | - srcs = ["client/server_lib.py"], | ||
| 1038 | - srcs_version = "PY2AND3", | ||
| 1039 | - deps = [ | ||
| 1040 | - ":pywrap_tensorflow", | ||
| 1041 | - ], | ||
| 1042 | - ) | ||
| 1043 | - | ||
| 1044 | 1034 | py_test( | |
| 1045 | 1035 | name = "server_lib_test", | |
| 1046 | 1036 | size = "small", | |
| 1047 | - srcs = ["client/server_lib_test.py"], | ||
| 1037 | + srcs = ["training/server_lib_test.py"], | ||
| 1048 | 1038 | srcs_version = "PY2AND3", | |
| 1049 | 1039 | deps = [ | |
| 1050 | 1040 | ":extra_py_tests_deps", | |
| 1051 | 1041 | ":framework", | |
| 1052 | 1042 | ":framework_test_lib", | |
| 1053 | - ":server_lib", | ||
| 1054 | 1043 | ":session", | |
| 1055 | 1044 | ], | |
| 1056 | 1045 | ) | |
@@ -1261,6 +1250,7 @@ cuda_py_tests( | |||
| 1261 | 1250 | ["training/*_test.py"], | |
| 1262 | 1251 | exclude = [ | |
| 1263 | 1252 | "training/input_test.py", | |
| 1253 | + "training/server_lib_test.py", | ||
| 1264 | 1254 | "training/session_manager_test.py", | |
| 1265 | 1255 | "training/supervisor_test.py", | |
| 1266 | 1256 | ], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -127,8 +127,6 @@ | |||
| 127 | 127 | # documentation, or remove. | |
| 128 | 128 | __all__.extend([ | |
| 129 | 129 | 'AttrValue', | |
| 130 | - 'ClusterDef', | ||
| 131 | - 'ClusterSpec', | ||
| 132 | 130 | 'ConfigProto', | |
| 133 | 131 | 'Event', | |
| 134 | 132 | 'GPUOptions', | |
@@ -137,17 +135,14 @@ | |||
| 137 | 135 | 'GRAPH_DEF_VERSION_MIN_PRODUCER', | |
| 138 | 136 | 'GraphDef', | |
| 139 | 137 | 'GraphOptions', | |
| 140 | - 'GrpcServer', | ||
| 141 | 138 | 'HistogramProto', | |
| 142 | - 'JobDef', | ||
| 143 | 139 | 'LogMessage', | |
| 144 | 140 | 'NameAttrList', | |
| 145 | 141 | 'NodeDef', | |
| 146 | 142 | 'OptimizerOptions', | |
| 147 | 143 | 'PaddingFIFOQueue', | |
| 148 | 144 | 'RunOptions', | |
| 149 | 145 | 'RunMetadata', | |
| 150 | - 'ServerDef', | ||
| 151 | 146 | 'SessionLog', | |
| 152 | 147 | 'Summary', | |
| 153 | 148 | 'arg_max', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,13 +51,6 @@ | |||
| 51 | 51 | from __future__ import division | |
| 52 | 52 | from __future__ import print_function | |
| 53 | 53 | ||
| 54 | - # NOTE(mrry): Support for `tf.GrpcServer` is currently experimental. | ||
| 55 | - from tensorflow.core.protobuf.tensorflow_server_pb2 import ClusterDef | ||
| 56 | - from tensorflow.core.protobuf.tensorflow_server_pb2 import JobDef | ||
| 57 | - from tensorflow.core.protobuf.tensorflow_server_pb2 import ServerDef | ||
| 58 | - from tensorflow.python.client.server_lib import ClusterSpec | ||
| 59 | - from tensorflow.python.client.server_lib import GrpcServer | ||
| 60 | - | ||
| 61 | 54 | from tensorflow.python.client.session import InteractiveSession | |
| 62 | 55 | from tensorflow.python.client.session import Session | |
| 63 | 56 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,8 @@ limitations under the License. | |||
| 29 | 29 | %include "tensorflow/python/client/events_writer.i" | |
| 30 | 30 | ||
| 31 | 31 | %include "tensorflow/python/client/tf_session.i" | |
| 32 | - %include "tensorflow/python/client/server_lib.i" | ||
| 33 | 32 | %include "tensorflow/python/client/device_lib.i" | |
| 34 | 33 | ||
| 34 | + %include "tensorflow/python/training/server_lib.i" | ||
| 35 | + | ||
| 35 | 36 | %include "tensorflow/python/framework/python_op_gen.i" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,9 +18,9 @@ | |||
| 18 | 18 | from __future__ import print_function | |
| 19 | 19 | ||
| 20 | 20 | from tensorflow.core.framework import graph_pb2 | |
| 21 | - from tensorflow.python.client import server_lib | ||
| 22 | 21 | from tensorflow.python.framework import device as pydev | |
| 23 | 22 | from tensorflow.python.platform import logging | |
| 23 | + from tensorflow.python.training import server_lib | ||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | class _ReplicaDeviceChooser(object): | |
@@ -146,9 +146,9 @@ def replica_device_setter(ps_tasks=0, ps_device="/job:ps", | |||
| 146 | 146 | """ | |
| 147 | 147 | if cluster is not None: | |
| 148 | 148 | if isinstance(cluster, server_lib.ClusterSpec): | |
| 149 | - cluster_spec = cluster.as_cluster_spec() | ||
| 149 | + cluster_spec = cluster.as_dict() | ||
| 150 | 150 | else: | |
| 151 | - cluster_spec = server_lib.ClusterSpec(cluster).as_cluster_spec() | ||
| 151 | + cluster_spec = server_lib.ClusterSpec(cluster).as_dict() | ||
| 152 | 152 | # Get ps_job_name from ps_device by striping "/job:". | |
| 153 | 153 | ps_job_name = ps_device.lstrip("/job:") | |
| 154 | 154 | if ps_job_name not in cluster_spec or cluster_spec[ps_job_name] is None: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | 23 | class DeviceSetterTest(tf.test.TestCase): | |
| 24 | 24 | ||
| 25 | - _cluster_spec = tf.ClusterSpec({ | ||
| 25 | + _cluster_spec = tf.train.ClusterSpec({ | ||
| 26 | 26 | "ps": ["ps0:2222", "ps1:2222"], | |
| 27 | 27 | "worker": ["worker0:2222", "worker1:2222", "worker2:2222"]}) | |
| 28 | 28 | ||
@@ -39,7 +39,7 @@ def testPS2TasksWithCluserSpecClass(self): | |||
| 39 | 39 | ||
| 40 | 40 | def testPS2TasksWithClusterSpecDict(self): | |
| 41 | 41 | with tf.device(tf.train.replica_device_setter( | |
| 42 | - cluster=self._cluster_spec.as_cluster_spec())): | ||
| 42 | + cluster=self._cluster_spec.as_dict())): | ||
| 43 | 43 | v = tf.Variable([1, 2]) | |
| 44 | 44 | w = tf.Variable([2, 1]) | |
| 45 | 45 | a = v + w | |
@@ -62,7 +62,7 @@ def testPS2TasksWithClusterDef(self): | |||
| 62 | 62 | self.assertDeviceEqual("/job:worker", a.device) | |
| 63 | 63 | ||
| 64 | 64 | def testPS2TasksWithDevice(self): | |
| 65 | - cluster_spec = tf.ClusterSpec({ | ||
| 65 | + cluster_spec = tf.train.ClusterSpec({ | ||
| 66 | 66 | "sun": ["sun0:2222", "sun1:2222", "sun2:2222"], | |
| 67 | 67 | "moon": ["moon0:2222", "moon1:2222"]}) | |
| 68 | 68 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments