xref: /aosp_15_r20/external/tensorflow/tensorflow/core/util/autotune_maps/conv_parameters.proto (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1// LINT: LEGACY_NAMES
2/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15==============================================================================*/
16
17// Protocol messages for describing parameters of convolution-related
18// operations.
19
20// For Google-internal use only.
21syntax = "proto3";
22
23package tensorflow;
24
25import "tensorflow/compiler/xla/stream_executor/dnn.proto";
26import "tensorflow/core/framework/types.proto";
27
28// LINT.IfChange
29
30// This is the underlying data structure of class ConvParameters, which are used
31// as the keys in cuDNN autotuning maps for retrieving corresponding cuDNN
32// algorithms. This is used as a serialization format for saving/loading
33// autotuning databases.
34message ConvParametersProto {
35  // This stores the information for fused convolution operations where an
36  // activation and a side input might follow the convolution.
37  message Fusion {
38    // If true, this proto corresponds to a FusedConvBiasActivation operation
39    // implemented in the contrib library, otherwise this proto corresponds to
40    // the FusedConv operation implemented in the core library.
41    // Compared with FusedConv, FusedConvBiasActivation supports more types of
42    // activation function (including no activation) as well as the side_input.
43    // For now they have same type of keys in autotune maps, but the semantics
44    // of some fields (like padding) are different. So we add this field to
45    // distinguish them.
46    // TODO(b/177365158) Remove this field once these two operations are merged.
47    bool is_contrib = 1;
48    stream_executor.dnn.ActivationMode activation_mode = 2;
49    double conv_scale = 3;
50    double side_input_scale = 4;
51  }
52  int64 batch = 1;
53  int64 in_depths = 2;
54  int64 out_depths = 3;
55  repeated int64 in = 4;
56  // data_format corresponds to type TensorFormat in
57  // third_party/tensorflow/core/util/tensor_format.h.
58  int32 data_format = 5;
59  repeated int64 filter = 6;
60  repeated int64 dilation = 7;
61  repeated int64 stride = 8;
62  repeated int64 padding = 9;
63  tensorflow.DataType dtype = 10;
64  int32 group_count = 11;
65  // A string uniquely identifying a particular GPU model, e.g. V100 vs RTX
66  // 2080.
67  string device_identifier = 12;
68  Fusion fusion = 13;
69  // The version number of ConvParameters class. Offline autotune results
70  // whose version number is different from the runtime's version number
71  // (defined in ConvParameters::kVersion) will be rejected and ignored by
72  // LoadSerializedAutotuneMaps. This ensures that we will not load out-of-date
73  // autotune results.
74  int32 version = 14;
75}
76
77//  LINT.ThenChange(
78//  "conv_parameters.h:conv_parameters_version"
79//  )
80