1// Copyright 2020 Huawei Technologies Co., Ltd. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto2"; 16 17package mindspore.irpb; 18option cc_enable_arenas = true; 19 20 21// Event Protocol buffer, Top define 22message LineageEvent { 23 // Timestamp 24 required double wall_time = 1; 25 26 // The step of train. 27 optional int64 step = 2; 28 29 oneof what { 30 // An event file was started, with the specified version. 31 // Now version is "MindSpore.Event:1" 32 string version = 3; 33 34 // Train lineage 35 TrainLineage train_lineage = 6; 36 37 // Evaluation lineage 38 EvaluationLineage evaluation_lineage = 7; 39 40 // Dataset graph 41 DatasetGraph dataset_graph = 9; 42 43 // User defined info 44 UserDefinedInfo user_defined_info = 10; 45 } 46} 47 48// User defined info 49message UserDefinedInfo{ 50 // repeated user defined info 51 repeated UserDefinedInfo user_info = 1; 52 53 // key/value which contains both scalar and dict 54 map<string, UserDefinedInfo> map_dict = 2; 55 map<string, int32> map_int32 = 3; 56 map<string, string> map_str = 4; 57 map<string, double> map_double = 5; 58} 59 60// TrainLineage records infos of a train. 61message TrainLineage{ 62 message HyperParameters{ 63 optional string optimizer = 1; 64 optional float learning_rate = 2; 65 optional string loss_function = 3; 66 optional int32 epoch = 4; 67 optional string parallel_mode = 5; 68 optional int32 device_num = 6; 69 optional int32 batch_size = 8; 70 } 71 72 message TrainDataset{ 73 optional string train_dataset_path = 1; 74 optional int32 train_dataset_size = 2; 75 } 76 77 message Algorithm{ 78 optional string network = 1; 79 optional float loss = 2; 80 } 81 82 message Model{ 83 optional string path = 3; 84 optional int64 size = 4; 85 } 86 87 optional HyperParameters hyper_parameters = 1; 88 optional TrainDataset train_dataset = 2; 89 optional Algorithm algorithm = 3; 90 optional Model model = 4; 91} 92 93//EvalLineage records infos of evaluation. 94message EvaluationLineage{ 95 message ValidDataset{ 96 optional string valid_dataset_path = 1; 97 optional int32 valid_dataset_size = 2; 98 } 99 100 optional string metric = 2; 101 optional ValidDataset valid_dataset = 3; 102} 103 104 105// DatasetGraph 106message DatasetGraph { 107 repeated DatasetGraph children = 1; 108 optional OperationParameter parameter = 2; 109 repeated Operation operations = 3; 110 optional Operation sampler = 4; 111} 112 113message Operation { 114 optional OperationParameter operationParam = 1; 115 repeated int32 size = 2; 116 repeated float weights = 3; 117} 118 119message OperationParameter{ 120 map<string, string> mapStr = 1; 121 map<string, StrList> mapStrList = 2; 122 map<string, bool> mapBool = 3; 123 map<string, int32> mapInt = 4; 124 map<string, double> mapDouble = 5; 125} 126 127message StrList { 128 repeated string strValue = 1; 129} 130