1/** 2 * Copyright 2021 Huawei Technologies Co., Ltd 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 mindspore.profiler; 20 21message MemoryProto { 22 repeated GraphMemProto graph_mem = 1; // memory usage of multiple graphs 23 uint64 total_mem = 2; // total allocated device memory 24} 25 26message GraphMemProto { 27 int64 graph_id = 1; // graph id 28 int64 static_mem = 2; // size of allocated static memory for current graph 29 repeated NodeMemProto node_mems = 3; // execution nodes 30 repeated TensorMemProto tensor_mems = 4; // all tensors 31 string fp_start = 5; // node name of fp start 32 string bp_end = 6; // node name of bp end 33} 34 35message NodeMemProto { 36 string node_name = 1; // node name 37 uint64 node_id = 2; // node id with respect to the execution order 38 repeated uint64 input_tensor_id = 3; // input tensor id 39 repeated uint64 output_tensor_id = 4; // output tensor id 40 repeated uint64 workspace_tensor_id = 5; // workspace tensor id 41} 42 43message TensorMemProto { 44 uint64 tensor_id = 1; // tensor id 45 uint64 size = 2; // aligned tensor size 46 string type = 3; // tensor type, e.g. Common, OutputOnly 47 uint64 life_start = 4; // the exe node id at which tensor memory allocated 48 uint64 life_end = 5; // the exe node id at which tensor memory deallocated 49 string life_long = 6; // see LifeLongType enum 50} 51