1syntax = "proto3"; 2 3package tensorflow; 4 5import "tensorflow/core/profiler/profiler_service.proto"; 6 7message NewProfileSessionRequest { 8 ProfileRequest request = 1; 9 // The place where we will dump profile data. We will normally use 10 // MODEL_DIR/plugins/profile as the repository root. 11 string repository_root = 2; 12 repeated string hosts = 3; // host or host:port, port will be ignored. 13 string session_id = 4; 14} 15 16message NewProfileSessionResponse { 17 // Auxiliary error_message. 18 string error_message = 1; 19 20 // Whether all hosts had returned a empty trace. 21 bool empty_trace = 2; 22} 23 24message EnumProfileSessionsAndToolsRequest { 25 string repository_root = 1; 26} 27 28message ProfileSessionInfo { 29 string session_id = 1; 30 // Which tool data is available for consumption. 31 repeated string available_tools = 2; 32} 33 34message EnumProfileSessionsAndToolsResponse { 35 // Auxiliary error_message. 36 string error_message = 1; 37 // If success, the returned sessions information are stored here. 38 repeated ProfileSessionInfo sessions = 2; 39} 40 41message ProfileSessionDataRequest { 42 // The place where we will read profile data. We will normally use 43 // MODEL_DIR/plugins/profile as the repository root. 44 string repository_root = 1; 45 string session_id = 2; 46 // Which host the data is associated. if empty, data from all hosts are 47 // aggregated. 48 string host_name = 5; 49 // Which tool 50 string tool_name = 3; 51 // Tool's specific parameters. e.g. TraceViewer's viewport etc 52 map<string, string> parameters = 4; 53} 54 55message ProfileSessionDataResponse { 56 // Auxiliary error_message. 57 string error_message = 1; 58 59 // Output format. e.g. "json" or "proto" or "blob" 60 string output_format = 2; 61 62 // TODO(jiesun): figure out whether to put bytes or oneof tool specific proto. 63 bytes output = 3; 64} 65//////////////////////////////////////////////////////////////////////////////// 66// ProfileAnalysis service provide entry point for profiling TPU and for 67// serving profiled data to Tensorboard through GRPC 68//////////////////////////////////////////////////////////////////////////////// 69service ProfileAnalysis { 70 // Starts a profiling session, blocks until it completes. 71 // TPUProfileAnalysis service delegate this to TPUProfiler service. 72 // Populate the profiled data in repository, then return status to caller. 73 rpc NewSession(NewProfileSessionRequest) returns (NewProfileSessionResponse) { 74 } 75 // Enumerate existing sessions and return available profile tools. 76 rpc EnumSessions(EnumProfileSessionsAndToolsRequest) 77 returns (EnumProfileSessionsAndToolsResponse) {} 78 // Retrieve specific tool's data for specific session. 79 rpc GetSessionToolData(ProfileSessionDataRequest) 80 returns (ProfileSessionDataResponse) {} 81} 82