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 2.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. }
  26. message Metadata {
  27. string device_name = 1;
  28. int32 cur_step = 2;
  29. // define the backend is 'GPU' or 'Ascend'
  30. string backend = 3;
  31. // the full name of current node
  32. string cur_node = 4;
  33. // check if training is done.
  34. bool training_done = 5;
  35. }
  36. message Chunk {
  37. bytes buffer = 1;
  38. }
  39. message EventReply {
  40. enum Status {
  41. OK = 0;
  42. FAILED = 1;
  43. PENDING = 2;
  44. }
  45. Status status = 1;
  46. oneof cmd {
  47. bool exit = 2;
  48. RunCMD run_cmd = 3;
  49. SetCMD set_cmd = 4;
  50. ViewCMD view_cmd = 5;
  51. }
  52. }
  53. message RunCMD {
  54. // running level. 'step' or 'node'
  55. string run_level = 1;
  56. oneof cmd {
  57. int32 run_steps = 2;
  58. // the full name of next node
  59. string node_name = 3;
  60. }
  61. }
  62. message SetCMD {
  63. repeated WatchNode watch_nodes = 1;
  64. WatchCondition watch_condition = 2;
  65. bool delete = 3;
  66. int32 id = 4;
  67. }
  68. message ViewCMD {
  69. repeated TensorProto tensors = 1;
  70. }
  71. message WatchCondition {
  72. enum Condition {
  73. nan = 0;
  74. inf = 1;
  75. overflow = 2;
  76. max_gt = 3;
  77. max_lt = 4;
  78. min_gt = 5;
  79. min_lt = 6;
  80. max_min_gt = 7;
  81. max_min_lt = 8;
  82. mean_gt = 9;
  83. mean_lt = 10;
  84. }
  85. Condition condition = 1;
  86. float value = 2; // for between condition, there will be two values
  87. }
  88. message WatchNode {
  89. string node_name = 1;
  90. string node_type = 2;
  91. }
  92. message WatchpointHit {
  93. TensorProto tensor = 1;
  94. WatchCondition watch_condition = 2;
  95. int32 id = 3;
  96. }