xref: /aosp_15_r20/external/federated-compute/fcp/aggregation/protocol/configuration.proto (revision 14675a029014e728ec732f129a32e299b2da0601)
1*14675a02SAndroid Build Coastguard Worker/*
2*14675a02SAndroid Build Coastguard Worker * Copyright 2022 Google LLC
3*14675a02SAndroid Build Coastguard Worker *
4*14675a02SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*14675a02SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*14675a02SAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*14675a02SAndroid Build Coastguard Worker *
8*14675a02SAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*14675a02SAndroid Build Coastguard Worker *
10*14675a02SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*14675a02SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*14675a02SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*14675a02SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*14675a02SAndroid Build Coastguard Worker * limitations under the License.
15*14675a02SAndroid Build Coastguard Worker */
16*14675a02SAndroid Build Coastguard Worker
17*14675a02SAndroid Build Coastguard Workersyntax = "proto3";
18*14675a02SAndroid Build Coastguard Worker
19*14675a02SAndroid Build Coastguard Workerpackage fcp.aggregation;
20*14675a02SAndroid Build Coastguard Worker
21*14675a02SAndroid Build Coastguard Workerimport "tensorflow/core/framework/tensor.proto";
22*14675a02SAndroid Build Coastguard Workerimport "tensorflow/core/protobuf/struct.proto";
23*14675a02SAndroid Build Coastguard Worker
24*14675a02SAndroid Build Coastguard Workeroption java_package = "fcp.aggregation";
25*14675a02SAndroid Build Coastguard Workeroption java_multiple_files = true;
26*14675a02SAndroid Build Coastguard Worker
27*14675a02SAndroid Build Coastguard Worker// Configuration describing the kind of aggregation to perform.
28*14675a02SAndroid Build Coastguard Workermessage Configuration {
29*14675a02SAndroid Build Coastguard Worker  // Represents a single aggregation operation, combining one or more input
30*14675a02SAndroid Build Coastguard Worker  // tensors from a collection of clients into one or more output tensors on the
31*14675a02SAndroid Build Coastguard Worker  // server.
32*14675a02SAndroid Build Coastguard Worker  // TODO(team): Remove usage of TensorFlow from this message.
33*14675a02SAndroid Build Coastguard Worker  message ServerAggregationConfig {
34*14675a02SAndroid Build Coastguard Worker    // The uri of the aggregation intrinsic (e.g. 'federated_sum').
35*14675a02SAndroid Build Coastguard Worker    string intrinsic_uri = 1;
36*14675a02SAndroid Build Coastguard Worker
37*14675a02SAndroid Build Coastguard Worker    // Describes an argument to the aggregation operation.
38*14675a02SAndroid Build Coastguard Worker    message IntrinsicArg {
39*14675a02SAndroid Build Coastguard Worker      oneof arg {
40*14675a02SAndroid Build Coastguard Worker        // Input tensor provided by each client.
41*14675a02SAndroid Build Coastguard Worker        tensorflow.TensorSpecProto input_tensor = 2;
42*14675a02SAndroid Build Coastguard Worker
43*14675a02SAndroid Build Coastguard Worker        // Constant parameter that is independent of client data (e.g. a modulus
44*14675a02SAndroid Build Coastguard Worker        // for a federated modular sum operation).
45*14675a02SAndroid Build Coastguard Worker        tensorflow.TensorProto parameter = 3;
46*14675a02SAndroid Build Coastguard Worker      }
47*14675a02SAndroid Build Coastguard Worker    }
48*14675a02SAndroid Build Coastguard Worker
49*14675a02SAndroid Build Coastguard Worker    // List of arguments for the aggregation operation. The arguments can be
50*14675a02SAndroid Build Coastguard Worker    // dependent on client data (in which case they must be retrieved from
51*14675a02SAndroid Build Coastguard Worker    // clients) or they can be independent of client data (in which case they
52*14675a02SAndroid Build Coastguard Worker    // can be configured server-side). For now we assume all client-independent
53*14675a02SAndroid Build Coastguard Worker    // arguments are constants. The arguments must be in the order expected by
54*14675a02SAndroid Build Coastguard Worker    // the server.
55*14675a02SAndroid Build Coastguard Worker    repeated IntrinsicArg intrinsic_args = 4;
56*14675a02SAndroid Build Coastguard Worker
57*14675a02SAndroid Build Coastguard Worker    // List of server-side outputs produced by the aggregation operation.
58*14675a02SAndroid Build Coastguard Worker    repeated tensorflow.TensorSpecProto output_tensors = 5;
59*14675a02SAndroid Build Coastguard Worker
60*14675a02SAndroid Build Coastguard Worker    // List of inner aggregation intrinsics. This can be used to delegate parts
61*14675a02SAndroid Build Coastguard Worker    // of the aggregation logic (e.g. a groupby intrinsic may want to delegate
62*14675a02SAndroid Build Coastguard Worker    // a sum operation to a sum intrinsic).
63*14675a02SAndroid Build Coastguard Worker    repeated ServerAggregationConfig inner_aggregations = 6;
64*14675a02SAndroid Build Coastguard Worker  }
65*14675a02SAndroid Build Coastguard Worker
66*14675a02SAndroid Build Coastguard Worker  // A list of client-to-server aggregations to perform.
67*14675a02SAndroid Build Coastguard Worker  repeated ServerAggregationConfig aggregation_configs = 1;
68*14675a02SAndroid Build Coastguard Worker}
69