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