-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransport.proto
123 lines (115 loc) · 3.21 KB
/
transport.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Copyright 2020 Adap GmbH. 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";
option go_package = ".goflwr";
package flwr.proto;
service FlowerService {
rpc Join(stream ClientMessage) returns (stream ServerMessage) {}
}
enum Code {
OK = 0;
GET_PROPERTIES_NOT_IMPLEMENTED = 1;
GET_PARAMETERS_NOT_IMPLEMENTED = 2;
FIT_NOT_IMPLEMENTED = 3;
EVALUATE_NOT_IMPLEMENTED = 4;
}
message Status {
Code code = 1;
string message = 2;
}
message Parameters {
repeated bytes tensors = 1;
string tensor_type = 2;
}
enum Reason {
UNKNOWN = 0;
RECONNECT = 1;
POWER_DISCONNECTED = 2;
WIFI_UNAVAILABLE = 3;
ACK = 4;
}
message ServerMessage {
message ReconnectIns { int64 seconds = 1; }
message GetPropertiesIns { map<string, Scalar> config = 1; }
message GetParametersIns { map<string, Scalar> config = 1; }
message FitIns {
Parameters parameters = 1;
map<string, Scalar> config = 2;
}
message EvaluateIns {
Parameters parameters = 1;
map<string, Scalar> config = 2;
}
oneof msg {
ReconnectIns reconnect_ins = 1;
GetPropertiesIns get_properties_ins = 2;
GetParametersIns get_parameters_ins = 3;
FitIns fit_ins = 4;
EvaluateIns evaluate_ins = 5;
}
}
message ClientMessage {
message DisconnectRes { Reason reason = 1; }
message GetPropertiesRes {
Status status = 1;
map<string, Scalar> properties = 2;
}
message GetParametersRes {
Status status = 1;
Parameters parameters = 2;
}
message FitRes {
Status status = 1;
Parameters parameters = 2;
int64 num_examples = 3;
map<string, Scalar> metrics = 4;
}
message EvaluateRes {
Status status = 1;
float loss = 2;
int64 num_examples = 3;
map<string, Scalar> metrics = 4;
}
oneof msg {
DisconnectRes disconnect_res = 1;
GetPropertiesRes get_properties_res = 2;
GetParametersRes get_parameters_res = 3;
FitRes fit_res = 4;
EvaluateRes evaluate_res = 5;
}
}
message Scalar {
// The following `oneof` contains all types that ProtoBuf considers to be
// "Scalar Value Types". Commented-out types are listed for reference and
// might be enabled in future releases. Source:
// https://developers.google.com/protocol-buffers/docs/proto3#scalar
oneof scalar {
double double = 1;
// float float = 2;
// int32 int32 = 3;
// int64 int64 = 4;
// uint32 uint32 = 5;
// uint64 uint64 = 6;
// sint32 sint32 = 7;
sint64 sint64 = 8;
// fixed32 fixed32 = 9;
// fixed64 fixed64 = 10;
// sfixed32 sfixed32 = 11;
// sfixed64 sfixed64 = 12;
bool bool = 13;
string string = 14;
bytes bytes = 15;
}
}