• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7    http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16syntax = "proto3";
17
18package tensorflow;
19
20option cc_enable_arenas = true;
21option java_outer_classname = "DeviceFiltersProtos";
22option java_multiple_files = true;
23option java_package = "org.tensorflow.distruntime";
24option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";
25
26// This file contains protos to be used when defining a TensorFlow
27// cluster.
28//
29// Configure device filters for remote tasks in the cluster. When associated
30// with a ClusterDef in setting up the cluster, a remote task will ignore all
31// devices which do not match any of its filters. Device filters must be
32// configured at the cluster startup, and cannot be updated once the cluster is
33// up and running.
34//
35// EXAMPLES
36// --------
37//
38// A two-job cluster with the following ClusterDef:
39//
40//  Cluster:
41//    job { name: 'worker' tasks { key: 0 value: 'worker1:2222' }
42//                         tasks { key: 1 value: 'worker2:2222' } }
43//    job { name: 'ps'     tasks { key: 0 value: 'ps0:2222' }
44//                         tasks { key: 1 value: 'ps1:2222' } }
45//
46// Set device filters to isolate worker tasks:
47//
48//  ClusterDeviceFilters:
49//    job { name: 'worker' tasks { key: 0
50//                                 value: device_filter '/job:ps'
51//                                        device_filter '/job:worker/task:0' }
52//                         tasks { key: 1
53//                                 value: device_filter '/job:ps'
54//                                        device_filter '/job:worker/task:1' } }
55
56// Defines the device filters for a remote task.
57message TaskDeviceFilters {
58  repeated string device_filters = 1;
59}
60
61// Defines the device filters for tasks in a job.
62message JobDeviceFilters {
63  // The name of this job.
64  string name = 1;
65
66  // Mapping from task ID to task device filters.
67  map<int32, TaskDeviceFilters> tasks = 2;
68}
69
70// Defines the device filters for jobs in a cluster.
71message ClusterDeviceFilters {
72  repeated JobDeviceFilters jobs = 1;
73}
74