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