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.

insert_op.proto 4.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /**
  2. * Copyright 2019-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 domi;
  18. message InsertNewOps {
  19. repeated AippOpParams aipp_op = 1;
  20. repeated MultiShapeOpParams multi_shape_op = 2;
  21. }
  22. message AippOpParams {
  23. enum InputFormat {
  24. UNDEFINED = 0;
  25. YUV420SP_U8 = 1;
  26. XRGB8888_U8 = 2;
  27. RGB888_U8 = 3;
  28. YUV400_U8 = 4;
  29. NC1HWC0DI_FP16 = 5;
  30. NC1HWC0DI_S8 = 6;
  31. ARGB8888_U8 = 7;
  32. YUYV_U8 = 8;
  33. YUV422SP_U8 = 9;
  34. AYUV444_U8 = 10;
  35. RAW10 = 11;
  36. RAW12 = 12;
  37. RAW16 = 13;
  38. RAW24 = 14;
  39. RGB16 = 15;
  40. RGB20 = 16;
  41. RGB24 = 17;
  42. RGB8_IR = 18;
  43. RGB16_IR = 19;
  44. RGB24_IR = 20;
  45. }
  46. enum AippMode {
  47. undefined = 0;
  48. static = 1;
  49. dynamic = 2;
  50. }
  51. // AIPPģʽ־̬AIPPͶ̬AIPP
  52. AippMode aipp_mode = 1;
  53. // related_input_rankΪΪͣ÷Χ>=0, <=DataӵĸĬֵΪ0
  54. // ʶģ͵ĵڼAIPPģ룬ҪԵ2AIPPrelated_input_rankΪ1
  55. uint32 related_input_rank = 2;
  56. // input_edge_idxΪѡΪͣ÷ΧΪ>=0
  57. // øòãڶDataӲͬͬAIPPòûãĬ϶related_input_rankָģAIPP
  58. // ֵ <= Dataߵĸ
  59. repeated uint32 input_edge_idx = 3;
  60. // [Begin] ̬AIPPþ̬AIPPʱЧ
  61. uint32 max_src_image_size = 4;
  62. // Ƿ֧תĬϲ֧֣֧תʱжĿռʧ
  63. bool support_rotation = 5;
  64. // [End] ̬AIPP
  65. // [Begin] ̬AIPPö̬AIPPʱЧ
  66. InputFormat input_format = 51;
  67. bool csc_switch = 52;
  68. float cpadding_value = 53;
  69. bool rbuv_swap_switch = 54;
  70. bool ax_swap_switch = 55;
  71. bool single_line_mode = 56;
  72. int32 src_image_size_w = 57;
  73. int32 src_image_size_h = 58;
  74. bool crop = 59;
  75. int32 load_start_pos_w = 60;
  76. int32 load_start_pos_h = 61;
  77. int32 crop_size_w = 62;
  78. int32 crop_size_h = 63;
  79. bool resize = 64;
  80. int32 resize_output_w = 65;
  81. int32 resize_output_h = 66;
  82. bool padding = 67;
  83. int32 left_padding_size = 68;
  84. int32 right_padding_size = 69;
  85. int32 top_padding_size = 70;
  86. int32 bottom_padding_size = 71;
  87. int32 mean_chn_0 = 10;
  88. int32 mean_chn_1 = 11;
  89. int32 mean_chn_2 = 12;
  90. int32 mean_chn_3 = 19;
  91. float min_chn_0 = 13;
  92. float min_chn_1 = 14;
  93. float min_chn_2 = 15;
  94. float min_chn_3 = 20;
  95. repeated float var_reci_chn_0 = 16;
  96. repeated float var_reci_chn_1 = 17;
  97. repeated float var_reci_chn_2 = 18;
  98. repeated float var_reci_chn_3 = 21;
  99. repeated int32 matrix_r0c0 = 30;
  100. repeated int32 matrix_r0c1 = 31;
  101. repeated int32 matrix_r0c2 = 32;
  102. repeated int32 matrix_r1c0 = 33;
  103. repeated int32 matrix_r1c1 = 34;
  104. repeated int32 matrix_r1c2 = 35;
  105. repeated int32 matrix_r2c0 = 36;
  106. repeated int32 matrix_r2c1 = 37;
  107. repeated int32 matrix_r2c2 = 38;
  108. repeated int32 output_bias_0 = 39;
  109. repeated int32 output_bias_1 = 40;
  110. repeated int32 output_bias_2 = 41;
  111. repeated int32 input_bias_0 = 42;
  112. repeated int32 input_bias_1 = 43;
  113. repeated int32 input_bias_2 = 44;
  114. // [End] ̬AIPP
  115. // The n number that is used for raw/rgbir data into f16 transformation.
  116. // The transformation equation is x/(2^n). If set to 0, no transform is performed.
  117. uint32 raw_rgbir_to_f16_n = 45;
  118. }
  119. message MultiShapeOpParams {
  120. enum MultiShapeMode {
  121. batch = 0; //̬batch
  122. resolution = 1; //ֱ̬ʣչ
  123. }
  124. MultiShapeMode mode = 1; //ģʽ
  125. uint32 related_input_rank = 2; //Ӳ뵽ĸ
  126. repeated uint32 batch_list = 11; //batch_listֵbatch_listĸ28֮
  127. }

图引擎模块(GE)是MindSpore的一个子模块,其代码由C++实现,位于前端模块ME和底层硬件之间,起到承接作用。图引擎模块以ME下发的图作为输入,然后进行一系列的深度图优化操作,最后输出一张可以在底层硬件上高效运行的图。GE针对昇腾AI处理器的硬件结构特点,做了特定的优化工作,以此来充分发挥出昇腾AI处理器的强大算力。在进行模型训练/推理时,GE会被自动调用而用户并不感知。GE主要由GE API和GE Core两部分组成,详细的架构图如下所示