1/* Copyright 2016 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.contrib.mpi_collectives; 19 20import "tensorflow/core/framework/tensor_shape.proto"; 21import "tensorflow/core/framework/types.proto"; 22 23// An MPIRequest is a message sent from a rank greater than zero to the 24// coordinator (rank zero), informing the coordinator of an operation that 25// the rank wants to do and the tensor that it wants to apply the operation to. 26message MPIRequest { 27 enum RequestType { 28 ALLREDUCE = 0; 29 ALLGATHER = 1; 30 } 31 32 // The request rank is necessary to create a consistent ordering of results, 33 // for example in the allgather where the order of outputs should be sorted 34 // by rank. 35 int32 request_rank = 1; 36 RequestType request_type = 2; 37 DataType tensor_type = 3; 38 string tensor_name = 4; 39 TensorShapeProto tensor_shape = 5; 40}; 41 42// An MPIResponse is a message sent from the coordinator (rank zero) to a rank 43// greater than zero, informing the rank of an operation should be performed 44// now. If the operation requested would result in an error (for example, due 45// to a type or shape mismatch), then the MPIResponse can contain an error and 46// an error message instead. Finally, an MPIResponse can be a DONE message (if 47// there are no more tensors to reduce on this tick of the background loop) or 48// SHUTDOWN if all MPI processes should shut down. 49message MPIResponse { 50 enum ResponseType { 51 ALLREDUCE = 0; 52 ALLGATHER = 1; 53 ERROR = 2; 54 DONE = 3; 55 SHUTDOWN = 4; 56 } 57 58 // Empty if the type is DONE or SHUTDOWN. 59 ResponseType response_type = 1; 60 string tensor_name = 2; 61 62 // Empty unless response_type is ERROR. 63 string error_message = 3; 64}; 65