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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /**
  2. * Copyright 2020 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 "mindinsight/debugger/proto/ms_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. }
  39. message Chunk {
  40. bytes buffer = 1;
  41. bool finished = 2;
  42. }
  43. message EventReply {
  44. enum Status {
  45. OK = 0;
  46. FAILED = 1;
  47. PENDING = 2;
  48. }
  49. Status status = 1;
  50. oneof cmd {
  51. bool exit = 2;
  52. RunCMD run_cmd = 3;
  53. SetCMD set_cmd = 4;
  54. ViewCMD view_cmd = 5;
  55. }
  56. }
  57. message RunCMD {
  58. // step level or node level. "step", "node" or "recheck".
  59. string run_level = 1;
  60. oneof cmd {
  61. int32 run_steps = 2;
  62. // the next node full name
  63. string node_name = 3;
  64. }
  65. }
  66. message SetCMD {
  67. repeated WatchNode watch_nodes = 1;
  68. WatchCondition watch_condition = 2;
  69. bool delete = 3;
  70. int32 id = 4;
  71. }
  72. message ViewCMD {
  73. repeated TensorProto tensors = 1;
  74. }
  75. message WatchCondition {
  76. enum Condition {
  77. nan = 0;
  78. inf = 1;
  79. overflow = 2;
  80. max_gt = 3;
  81. max_lt = 4;
  82. min_gt = 5;
  83. min_lt = 6;
  84. max_min_gt = 7;
  85. max_min_lt = 8;
  86. mean_gt = 9;
  87. mean_lt = 10;
  88. sd_gt = 11;
  89. sd_lt = 12;
  90. tensor_general_overflow = 13;
  91. tensor_initialization = 14;
  92. tensor_too_large = 15;
  93. tensor_too_small = 16;
  94. tensor_all_zero = 17;
  95. tensor_change_too_large = 18;
  96. tensor_change_too_small = 19;
  97. tensor_not_changed = 20;
  98. }
  99. Condition condition = 1;
  100. float value = 2;
  101. message Parameter {
  102. string name = 1;
  103. bool disabled = 2;
  104. double value = 3;
  105. bool hit = 4; // Whether this parameter is hit when checking tensor.
  106. }
  107. // The ID 3 has been used on the mindspore side repeated bool include=3, so skip 3 for backward compatibility.
  108. repeated Parameter params = 4;
  109. }
  110. message WatchNode {
  111. string node_name = 1;
  112. string node_type = 2;
  113. }
  114. message WatchpointHit {
  115. TensorProto tensor = 1;
  116. WatchCondition watch_condition = 2;
  117. int32 id = 3;
  118. }