You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

debug_grpc.proto 3.9 kB

5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /**
  2. * Copyright 2019-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. syntax = "proto3";
  17. package debugger;
  18. import "debug_graph.proto";
  19. service EventListener {
  20. rpc WaitCMD (Metadata) returns (EventReply) {};
  21. rpc SendMetadata (Metadata) returns (EventReply) {};
  22. rpc SendGraph (stream Chunk) returns (EventReply) {};
  23. rpc SendTensors (stream TensorProto) returns (EventReply) {};
  24. rpc SendTensorBase (TensorBase) returns (EventReply) {};
  25. rpc SendTensorStats (TensorSummary) returns (EventReply) {};
  26. rpc SendWatchpointHits (stream WatchpointHit) returns (EventReply) {};
  27. rpc SendMultiGraphs (stream Chunk) returns (EventReply) {};
  28. rpc SendHeartbeat (Heartbeat) returns (EventReply) {};
  29. }
  30. message Metadata {
  31. string device_name = 1;
  32. int32 cur_step = 2;
  33. // define the backend is 'GPU' or "Ascend"
  34. string backend = 3;
  35. // the full name of current node
  36. string cur_node = 4;
  37. // check if training is done.
  38. bool training_done = 5;
  39. // the number of total graphs
  40. int32 graph_num = 6;
  41. // mindspore version
  42. string ms_version = 7;
  43. }
  44. message Chunk {
  45. bytes buffer = 1;
  46. bool finished = 2;
  47. }
  48. message EventReply {
  49. enum Status {
  50. OK = 0;
  51. FAILED = 1;
  52. PENDING = 2;
  53. }
  54. Status status = 1;
  55. oneof cmd {
  56. bool exit = 2;
  57. RunCMD run_cmd = 3;
  58. SetCMD set_cmd = 4;
  59. ViewCMD view_cmd = 5;
  60. bool version_matched = 6;
  61. }
  62. }
  63. message RunCMD {
  64. // step level or node level. "step" or "node"
  65. string run_level = 1;
  66. oneof cmd {
  67. int32 run_steps = 2;
  68. // the next node full name
  69. string node_name = 3;
  70. }
  71. }
  72. message SetCMD {
  73. repeated WatchNode watch_nodes = 1;
  74. WatchCondition watch_condition = 2;
  75. bool delete = 3;
  76. int32 id = 4;
  77. }
  78. message ViewCMD {
  79. repeated TensorProto tensors = 1;
  80. enum Level {
  81. value = 0;
  82. statistics = 1;
  83. base = 2;
  84. }
  85. Level level = 2;
  86. }
  87. message WatchCondition {
  88. enum Condition {
  89. nan = 0;
  90. inf = 1;
  91. overflow = 2;
  92. max_gt = 3;
  93. max_lt = 4;
  94. min_gt = 5;
  95. min_lt = 6;
  96. max_min_gt = 7;
  97. max_min_lt = 8;
  98. mean_gt = 9;
  99. mean_lt = 10;
  100. sd_gt = 11;
  101. sd_lt = 12;
  102. tensor_general_overflow = 13;
  103. tensor_initialization = 14;
  104. tensor_too_large = 15;
  105. tensor_too_small = 16;
  106. tensor_all_zero = 17;
  107. tensor_change_too_large = 18;
  108. tensor_change_too_small = 19;
  109. tensor_not_changed = 20;
  110. tensor_range = 21;
  111. }
  112. Condition condition = 1;
  113. float value = 2;
  114. message Parameter {
  115. string name = 1;
  116. bool disabled = 2;
  117. double value = 3;
  118. bool hit = 4; // Whether this parameter is hit when checking tensor.
  119. double actual_value = 5;
  120. }
  121. repeated Parameter params = 4;
  122. }
  123. message WatchNode {
  124. string node_name = 1;
  125. string node_type = 2;
  126. }
  127. message WatchpointHit {
  128. TensorProto tensor = 1;
  129. WatchCondition watch_condition = 2;
  130. int32 id = 3;
  131. int32 error_code = 4;
  132. }
  133. message Heartbeat {
  134. string message = 1;
  135. int32 period = 2;
  136. }
  137. message TensorSummary{
  138. TensorBase tensor_base = 1;
  139. Statistics statistics = 2;
  140. }
  141. message Statistics {
  142. bool is_bool = 1;
  143. float max_value = 2;
  144. float min_value = 3;
  145. float avg_value = 4;
  146. int32 count = 5;
  147. int32 neg_zero_count = 6;
  148. int32 pos_zero_count = 7;
  149. int32 nan_count = 8;
  150. int32 neg_inf_count = 9;
  151. int32 pos_inf_count = 10;
  152. int32 zero_count = 11;
  153. }
  154. message TensorBase{
  155. int32 data_type = 1;
  156. repeated int64 shape = 2;
  157. int64 data_size = 3;
  158. }