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.1 kB

5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /**
  2. * Copyright 2019 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 SendWatchpointHits (stream WatchpointHit) returns (EventReply) {};
  25. rpc SendMultiGraphs (stream Chunk) returns (EventReply) {};
  26. }
  27. message Metadata {
  28. string device_name = 1;
  29. int32 cur_step = 2;
  30. // define the backend is 'GPU' or "Ascend"
  31. string backend = 3;
  32. // the full name of current node
  33. string cur_node = 4;
  34. // check if training is done.
  35. bool training_done = 5;
  36. // the number of total graphs
  37. int32 graph_num = 6;
  38. // mindspore version
  39. string ms_version = 7;
  40. }
  41. message Chunk {
  42. bytes buffer = 1;
  43. bool finished = 2;
  44. }
  45. message EventReply {
  46. enum Status {
  47. OK = 0;
  48. FAILED = 1;
  49. PENDING = 2;
  50. }
  51. Status status = 1;
  52. oneof cmd {
  53. bool exit = 2;
  54. RunCMD run_cmd = 3;
  55. SetCMD set_cmd = 4;
  56. ViewCMD view_cmd = 5;
  57. bool version_matched = 6;
  58. }
  59. }
  60. message RunCMD {
  61. // step level or node level. "step" or "node"
  62. string run_level = 1;
  63. oneof cmd {
  64. int32 run_steps = 2;
  65. // the next node full name
  66. string node_name = 3;
  67. }
  68. }
  69. message SetCMD {
  70. repeated WatchNode watch_nodes = 1;
  71. WatchCondition watch_condition = 2;
  72. bool delete = 3;
  73. int32 id = 4;
  74. }
  75. message ViewCMD {
  76. repeated TensorProto tensors = 1;
  77. }
  78. message WatchCondition {
  79. enum Condition {
  80. nan = 0;
  81. inf = 1;
  82. overflow = 2;
  83. max_gt = 3;
  84. max_lt = 4;
  85. min_gt = 5;
  86. min_lt = 6;
  87. max_min_gt = 7;
  88. max_min_lt = 8;
  89. mean_gt = 9;
  90. mean_lt = 10;
  91. sd_gt = 11;
  92. sd_lt = 12;
  93. tensor_general_overflow = 13;
  94. tensor_initialization = 14;
  95. tensor_too_large = 15;
  96. tensor_too_small = 16;
  97. tensor_all_zero = 17;
  98. tensor_change_too_large = 18;
  99. tensor_change_too_small = 19;
  100. tensor_not_changed = 20;
  101. tensor_range = 21;
  102. }
  103. Condition condition = 1;
  104. float value = 2;
  105. message Parameter {
  106. string name = 1;
  107. bool disabled = 2;
  108. double value = 3;
  109. bool hit = 4; // Whether this parameter is hit when checking tensor.
  110. double actual_value = 5;
  111. }
  112. repeated Parameter params = 4;
  113. }
  114. message WatchNode {
  115. string node_name = 1;
  116. string node_type = 2;
  117. }
  118. message WatchpointHit {
  119. TensorProto tensor = 1;
  120. WatchCondition watch_condition = 2;
  121. int32 id = 3;
  122. int32 error_code = 4;
  123. }