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.

CMakeLists.txt 4.6 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. set(PROTO_LIST
  2. "${METADEF_DIR}/proto/om.proto"
  3. "${METADEF_DIR}/proto/ge_ir.proto"
  4. "${METADEF_DIR}/proto/insert_op.proto"
  5. "${METADEF_DIR}/proto/task.proto"
  6. )
  7. protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})
  8. set(SRC_LIST
  9. "main.cc"
  10. "single_op_parser.cc"
  11. "../session/omg.cc"
  12. "../ir_build/atc_ir_common.cc"
  13. )
  14. ############ atc ############
  15. add_executable(atc ${SRC_LIST} ${PROTO_HDRS})
  16. target_compile_options(atc PRIVATE
  17. -Werror
  18. -O2
  19. -Wno-deprecated-declarations
  20. )
  21. target_compile_definitions(atc PRIVATE
  22. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  23. COMPILE_OMG_PACKAGE
  24. google=ascend_private
  25. )
  26. target_include_directories(atc PRIVATE
  27. ${CMAKE_CURRENT_LIST_DIR}
  28. ${GE_CODE_DIR}
  29. ${GE_CODE_DIR}/ge
  30. ${GE_CODE_DIR}/inc/external
  31. ${GE_CODE_DIR}/common/inc/external
  32. ${GE_CODE_DIR}/common/inc/external/graph
  33. ${GE_CODE_DIR}/inc
  34. ${GE_CODE_DIR}/inc/framework
  35. ${METADEF_DIR}/inc
  36. ${METADEF_DIR}/inc/graph
  37. ${METADEF_DIR}/inc/register
  38. ${METADEF_DIR}/inc/external
  39. ${METADEF_DIR}/inc/external/graph
  40. ${METADEF_DIR}/inc/external/register
  41. ${PARSER_DIR}
  42. ${CMAKE_BINARY_DIR}
  43. ${CMAKE_BINARY_DIR}/proto/ge
  44. #### yellow zone ####
  45. ${GE_CODE_DIR}/../inc
  46. ${GE_CODE_DIR}/../inc/common
  47. #### blue zone ####
  48. ${GE_CODE_DIR}/third_party/fwkacllib/inc
  49. ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
  50. )
  51. target_link_libraries(atc PRIVATE
  52. $<BUILD_INTERFACE:intf_pub>
  53. ascend_protobuf
  54. ge_common
  55. register
  56. c_sec
  57. graph
  58. error_manager
  59. ge_compiler
  60. parser_common
  61. gflags
  62. json
  63. runtime_compile
  64. slog
  65. static_mmpa
  66. -lrt
  67. -ldl
  68. )
  69. ############ atc.bin ############
  70. add_executable(atc.bin ${SRC_LIST} ${PROTO_HDRS})
  71. target_compile_options(atc.bin PRIVATE
  72. -Werror
  73. -O2
  74. -Wno-deprecated-declarations
  75. )
  76. target_compile_definitions(atc.bin PRIVATE
  77. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  78. COMPILE_OMG_PACKAGE
  79. google=ascend_private
  80. )
  81. target_include_directories(atc.bin PRIVATE
  82. ${CMAKE_CURRENT_LIST_DIR}
  83. ${GE_CODE_DIR}
  84. ${GE_CODE_DIR}/ge
  85. ${GE_CODE_DIR}/inc/external
  86. ${GE_CODE_DIR}/common/inc/external
  87. ${GE_CODE_DIR}/common/inc/external/graph
  88. ${GE_CODE_DIR}/inc
  89. ${GE_CODE_DIR}/inc/framework
  90. ${METADEF_DIR}/inc
  91. ${METADEF_DIR}/inc/graph
  92. ${METADEF_DIR}/inc/register
  93. ${METADEF_DIR}/inc/external
  94. ${METADEF_DIR}/inc/external/graph
  95. ${METADEF_DIR}/inc/external/register
  96. ${PARSER_DIR}
  97. ${CMAKE_BINARY_DIR}
  98. ${CMAKE_BINARY_DIR}/proto/ge
  99. #### yellow zone ####
  100. ${GE_CODE_DIR}/../inc
  101. ${GE_CODE_DIR}/../inc/common
  102. #### blue zone ####
  103. ${GE_CODE_DIR}/third_party/fwkacllib/inc
  104. ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
  105. )
  106. target_link_libraries(atc.bin PRIVATE
  107. $<BUILD_INTERFACE:intf_pub>
  108. ascend_protobuf
  109. ge_common
  110. register
  111. c_sec
  112. graph
  113. error_manager
  114. ge_compiler
  115. parser_common
  116. gflags
  117. json
  118. runtime_compile
  119. slog
  120. static_mmpa
  121. -lrt
  122. -ldl
  123. )
  124. ############ fwk_atc.bin ############
  125. add_executable(fwk_atc.bin ${SRC_LIST} ${PROTO_HDRS})
  126. target_compile_options(fwk_atc.bin PRIVATE
  127. -Werror
  128. -O2
  129. -Wno-deprecated-declarations
  130. )
  131. target_compile_definitions(fwk_atc.bin PRIVATE
  132. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  133. COMPILE_OMG_PACKAGE
  134. google=ascend_private
  135. )
  136. target_include_directories(fwk_atc.bin PRIVATE
  137. ${CMAKE_CURRENT_LIST_DIR}
  138. ${GE_CODE_DIR}
  139. ${GE_CODE_DIR}/ge
  140. ${GE_CODE_DIR}/inc/external
  141. ${GE_CODE_DIR}/common/inc/external
  142. ${GE_CODE_DIR}/common/inc/external/graph
  143. ${GE_CODE_DIR}/inc
  144. ${GE_CODE_DIR}/inc/framework
  145. ${METADEF_DIR}/inc
  146. ${METADEF_DIR}/inc/graph
  147. ${METADEF_DIR}/inc/register
  148. ${METADEF_DIR}/inc/external
  149. ${METADEF_DIR}/inc/external/graph
  150. ${METADEF_DIR}/inc/external/register
  151. ${PARSER_DIR}
  152. ${CMAKE_BINARY_DIR}
  153. ${CMAKE_BINARY_DIR}/proto/ge
  154. #### yellow zone ####
  155. ${GE_CODE_DIR}/../inc
  156. ${GE_CODE_DIR}/../inc/common
  157. #### blue zone ####
  158. ${GE_CODE_DIR}/third_party/fwkacllib/inc
  159. ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
  160. )
  161. target_link_libraries(fwk_atc.bin PRIVATE
  162. $<BUILD_INTERFACE:intf_pub>
  163. ascend_protobuf
  164. ge_common
  165. register
  166. c_sec
  167. graph
  168. error_manager
  169. ge_compiler
  170. parser_common
  171. gflags
  172. json
  173. runtime_compile
  174. slog
  175. static_mmpa
  176. -lrt
  177. -ldl
  178. )
  179. ############ install ############
  180. set(INSTALL_BASE_DIR "")
  181. set(INSTALL_LIBRARY_DIR lib)
  182. install(TARGETS atc atc.bin fwk_atc.bin OPTIONAL
  183. LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
  184. )

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