Skip to content

Commit

Permalink
do not modify proto from tensorflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoqing committed Jan 10, 2025
1 parent 281347e commit f401404
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
84 changes: 84 additions & 0 deletions src/TensorflowCpy/proto/tensorflow/core/protobuf/cluster.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

syntax = "proto3";

package tensorflow;

option cc_enable_arenas = true;
option java_outer_classname = "ClusterProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.distruntime";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// This file contains protos to be used when defining a TensorFlow
// cluster.
//
// EXAMPLES
// --------
//
// 1. A single-process cluster, containing "/job:local/task:0".
//
// Cluster:
// job { name: 'local' tasks { key: 0 value: 'localhost:2222' } }
//
// Server:
// cluster { $CLUSTER } job_name: 'local' task_index: 0
//
// 2. A two-process cluster, containing "/job:local/task:{0,1}".
//
// Cluster:
// job { name: 'local' tasks { key: 0 value: 'localhost:2222' }
// tasks { key: 1 value: 'localhost:2223' } }
//
// Servers:
// cluster { $CLUSTER } job_name: 'local' task_index: 0
// cluster { $CLUSTER } job_name: 'local' task_index: 1
//
// 3. A two-job cluster, containing "/job:worker/task:{0,1,2}" and
// "/job:ps/task:{0,1}".
//
// Cluster:
// job { name: 'worker' tasks { key: 0 value: 'worker1:2222' }
// tasks { key: 1 value: 'worker2:2222' }
// tasks { key: 2 value: 'worker3:2222' } }
// job { name: 'ps' tasks { key: 0 value: 'ps0:2222' }
// tasks { key: 1 value: 'ps1:2222' } }
//
// Servers:
// cluster { $CLUSTER } job_name: 'worker' task_index: 0
// cluster { $CLUSTER } job_name: 'worker' task_index: 1
// cluster { $CLUSTER } job_name: 'worker' task_index: 2
// cluster { $CLUSTER } job_name: 'ps' task_index: 0
// cluster { $CLUSTER } job_name: 'ps' task_index: 1

// Defines a single job in a TensorFlow cluster.
message JobDef {
// The name of this job.
string name = 1;

// Mapping from task ID to "hostname:port" string.
//
// If the `name` field contains "worker", and the `tasks` map contains a
// mapping from 7 to "example.org:2222", then the device prefix
// "/job:worker/task:7" will be assigned to "example.org:2222".
map<int32, string> tasks = 2;
}

// Defines a TensorFlow cluster as a set of jobs.
message ClusterDef {
// The jobs that comprise the cluster.
repeated JobDef job = 1;
}
3 changes: 3 additions & 0 deletions src/TensorflowCpy/proto/tensorflow/core/protobuf/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package tensorflow;
import "tensorflow/core/framework/cost_graph.proto";
import "tensorflow/core/framework/graph.proto";
import "tensorflow/core/framework/step_stats.proto";
import "tensorflow/core/protobuf/cluster.proto";
import "tensorflow/core/protobuf/coordination_config.proto";
import "tensorflow/core/protobuf/debug.proto";
import "tensorflow/core/protobuf/rewriter_config.proto";
Expand Down Expand Up @@ -529,6 +530,8 @@ message ConfigProto {
// Options that apply when this session uses the distributed runtime.
RPCOptions rpc_options = 13;

// Optional list of all workers to use in this session.
ClusterDef cluster_def = 14;

// If true, any resources such as Variables used in the session will not be
// shared with other sessions. However, when clusterspec propagation is
Expand Down

0 comments on commit f401404

Please sign in to comment.