def setUpClass(cls): super(ParameterServerStrategyV2Test, cls).setUpClass() cluster_def = multi_worker_test_base.create_in_process_cluster( num_workers=2, num_ps=3) cls.cluster_resolver = SimpleClusterResolver(ClusterSpec(cluster_def))
def setUpClass(cls): super(VariablePartitioningTest, cls).setUpClass() cluster_def = multi_worker_test_base.create_in_process_cluster( num_workers=2, num_ps=2) cls.cluster_resolver = SimpleClusterResolver(ClusterSpec(cluster_def))
def _get_parameter_server_strategy(self): cluster_def = multi_worker_testing_utils.create_in_process_cluster( num_workers=2, num_ps=1, rpc_layer="grpc") return tf.distribute.experimental.ParameterServerStrategy( SimpleClusterResolver(ClusterSpec(cluster_def), rpc_layer="grpc"))
def make_parameter_server_cluster(num_workers, num_ps): cluster_def = create_in_process_cluster(num_workers=num_workers, num_ps=num_ps, rpc_layer="grpc") return SimpleClusterResolver(ClusterSpec(cluster_def), rpc_layer="grpc")
def testConnectToClusterWithLocalMaster(self): local_resolver = SimpleClusterResolver(ClusterSpec({}), master='local') remote.connect_to_cluster(local_resolver)
def setUp(self): super().setUp() cluster_def = get_cluster_def(test_cluster_params, num_workers=2, num_ps=3) self.cluster_resolver = SimpleClusterResolver(ClusterSpec(cluster_def))