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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. }
  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. }
  34. message Chunk {
  35. bytes buffer = 1;
  36. }
  37. message EventReply {
  38. enum Status {
  39. OK = 0;
  40. FAILED = 1;
  41. PENDING = 2;
  42. }
  43. Status status = 1;
  44. oneof cmd {
  45. bool exit = 2;
  46. RunCMD run_cmd = 3;
  47. SetCMD set_cmd = 4;
  48. ViewCMD view_cmd = 5;
  49. }
  50. }
  51. message RunCMD {
  52. // step level or node level. "step" or "node"
  53. string run_level = 1;
  54. oneof cmd {
  55. int32 run_steps = 2;
  56. // the next node full name
  57. string node_name = 3;
  58. }
  59. }
  60. message SetCMD {
  61. repeated WatchNode watch_nodes = 1;
  62. WatchCondition watch_condition = 2;
  63. bool delete = 3;
  64. int32 id = 4;
  65. }
  66. message ViewCMD {
  67. repeated TensorProto tensors = 1;
  68. }
  69. message WatchCondition {
  70. enum Condition {
  71. nan = 0;
  72. inf = 1;
  73. overflow = 2;
  74. ge = 3; // greater than and equal to
  75. gt = 4; // greater than
  76. le = 5; // less than and equal to
  77. lt = 6; // less than
  78. between = 7; // between
  79. }
  80. Condition condition = 1;
  81. repeated float value = 2; // for between condition, there will be two values
  82. repeated bool include = 3; // for between condition, define the value is included or not
  83. }
  84. message WatchNode {
  85. string node_name = 1;
  86. string node_type = 2;
  87. }
  88. message WatchpointHit {
  89. TensorProto tensor = 1;
  90. WatchCondition watch_condition = 2;
  91. int32 id = 3;
  92. }