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

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. set(SRC_LIST
  2. "ge_executor.cc"
  3. "../common/profiling/profiling_manager.cc"
  4. "../common/dump/dump_op.cc"
  5. "../common/dump/opdebug_register.cc"
  6. "../common/dump/exception_dumper.cc"
  7. "../common/profiling/ge_profiling.cc"
  8. "../graph/load/graph_loader.cc"
  9. "../graph/execute/graph_execute.cc"
  10. "../graph/manager/graph_manager_utils.cc"
  11. "../graph/manager/graph_var_manager.cc"
  12. "../graph/manager/graph_mem_allocator.cc"
  13. "../graph/manager/graph_caching_allocator.cc"
  14. "../graph/manager/session_scope_mem_allocator.cc"
  15. "../graph/manager/graph_mem_manager.cc"
  16. "../graph/manager/trans_var_data_utils.cc"
  17. "../graph/manager/util/debug.cc"
  18. "../graph/manager/rdma_pool_allocator.cc"
  19. "../graph/manager/host_mem_allocator.cc"
  20. "../hybrid/node_executor/aicpu/aicpu_ext_info.cc"
  21. "../graph/load/model_manager/davinci_model.cc"
  22. "../graph/load/model_manager/model_manager.cc"
  23. "../graph/load/model_manager/tbe_handle_store.cc"
  24. "../graph/load/model_manager/cpu_queue_schedule.cc"
  25. "../graph/load/model_manager/model_utils.cc"
  26. "../graph/load/model_manager/aipp_utils.cc"
  27. "../graph/load/model_manager/data_inputer.cc"
  28. "../graph/load/model_manager/data_dumper.cc"
  29. "../graph/load/model_manager/zero_copy_task.cc"
  30. "../graph/load/model_manager/zero_copy_offset.cc"
  31. "../graph/load/model_manager/task_info/task_info.cc"
  32. "../graph/load/model_manager/task_info/event_record_task_info.cc"
  33. "../graph/load/model_manager/task_info/event_wait_task_info.cc"
  34. "../graph/load/model_manager/task_info/ffts_task_info.cc"
  35. "../graph/load/model_manager/task_info/fusion_start_task_info.cc"
  36. "../graph/load/model_manager/task_info/fusion_stop_task_info.cc"
  37. "../graph/load/model_manager/task_info/kernel_ex_task_info.cc"
  38. "../graph/load/model_manager/task_info/kernel_task_info.cc"
  39. "../graph/load/model_manager/task_info/label_set_task_info.cc"
  40. "../graph/load/model_manager/task_info/label_switch_by_index_task_info.cc"
  41. "../graph/load/model_manager/task_info/label_goto_ex_task_info.cc"
  42. "../graph/load/model_manager/task_info/memcpy_async_task_info.cc"
  43. "../graph/load/model_manager/task_info/memcpy_addr_async_task_info.cc"
  44. "../graph/load/model_manager/task_info/profiler_trace_task_info.cc"
  45. "../graph/load/model_manager/task_info/stream_active_task_info.cc"
  46. "../graph/load/model_manager/task_info/stream_switch_task_info.cc"
  47. "../graph/load/model_manager/task_info/stream_switchn_task_info.cc"
  48. "../graph/load/model_manager/task_info/end_graph_task_info.cc"
  49. "../graph/load/model_manager/task_info/model_exit_task_info.cc"
  50. "../graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc"
  51. "../graph/load/model_manager/task_info/super_kernel/super_kernel.cc"
  52. "../opskernel_manager/ops_kernel_builder_manager.cc"
  53. "../single_op/single_op_manager.cc"
  54. "../single_op/single_op_model.cc"
  55. "../single_op/single_op.cc"
  56. "../single_op/stream_resource.cc"
  57. "../single_op/task/op_task.cc"
  58. "../single_op/task/build_task_utils.cc"
  59. "../single_op/task/tbe_task_builder.cc"
  60. "../single_op/task/aicpu_task_builder.cc"
  61. "../single_op/task/aicpu_kernel_task_builder.cc"
  62. "../single_op/task/rts_kernel_task_builder.cc"
  63. "../hybrid/common/tensor_value.cc"
  64. "../hybrid/common/npu_memory_allocator.cc"
  65. "../hybrid/executor/rt_callback_manager.cc"
  66. "../hybrid/executor/node_state.cc"
  67. "../hybrid/executor/node_done_manager.cc"
  68. "../hybrid/executor/hybrid_profiler.cc"
  69. "../hybrid/executor/hybrid_model_executor.cc"
  70. "../hybrid/executor/hybrid_model_pipeline_executor.cc"
  71. "../hybrid/executor/hybrid_model_async_executor.cc"
  72. "../hybrid/executor/hybrid_execution_context.cc"
  73. "../hybrid/executor/subgraph_context.cc"
  74. "../hybrid/executor/subgraph_executor.cc"
  75. "../hybrid/executor/worker/task_compile_engine.cc"
  76. "../hybrid/executor/worker/shape_inference_engine.cc"
  77. "../hybrid/executor/worker/execution_engine.cc"
  78. "../hybrid/model/hybrid_model.cc"
  79. "../hybrid/model/hybrid_model_builder.cc"
  80. "../hybrid/model/node_item.cc"
  81. "../hybrid/model/graph_item.cc"
  82. "../hybrid/node_executor/aicore/aicore_node_executor.cc"
  83. "../hybrid/node_executor/aicore/aicore_op_task.cc"
  84. "../hybrid/node_executor/aicore/aicore_task_builder.cc"
  85. "../hybrid/node_executor/aicpu/aicpu_node_executor.cc"
  86. "../hybrid/node_executor/compiledsubgraph/known_node_executor.cc"
  87. "../hybrid/node_executor/ge_local/ge_local_node_executor.cc"
  88. "../hybrid/node_executor/host_cpu/host_cpu_node_executor.cc"
  89. "../hybrid/node_executor/controlop/control_op_executor.cc"
  90. "../hybrid/node_executor/partitioned_call/partitioned_call_node_executor.cc"
  91. "../hybrid/node_executor/rts/rts_node_executor.cc"
  92. "../hybrid/node_executor/rts/rts_node_task.cc"
  93. "../hybrid/node_executor/rts/rts_task_factory.cc"
  94. "../hybrid/node_executor/node_executor.cc"
  95. "../hybrid/node_executor/task_context.cc"
  96. "../hybrid/hybrid_davinci_model.cc"
  97. "../ge_local_engine/engine/host_cpu_engine.cc"
  98. "../graph/manager/host_mem_manager.cc"
  99. "../graph/build/memory/var_mem_assign_util.cc"
  100. "../host_kernels/transpose_kernel.cc"
  101. "../host_kernels/add_kernel.cc"
  102. "../host_kernels/broadcast_args_kernel.cc"
  103. "../host_kernels/broadcast_gradient_args_kernel.cc"
  104. "../host_kernels/cast_kernel.cc"
  105. "../host_kernels/concat_offset_kernel.cc"
  106. "../host_kernels/concat_v2_kernel.cc"
  107. "../host_kernels/dynamic_stitch_kernel.cc"
  108. "../host_kernels/identity_kernel.cc"
  109. "../host_kernels/empty_kernel.cc"
  110. "../host_kernels/expanddims_kernel.cc"
  111. "../host_kernels/fill_kernel.cc"
  112. "../host_kernels/floordiv_kernel.cc"
  113. "../host_kernels/floormod_kernel.cc"
  114. "../host_kernels/gather_v2_kernel.cc"
  115. "../host_kernels/greater_kernel.cc"
  116. "../host_kernels/kernel_utils.cc"
  117. "../host_kernels/maximum_kernel.cc"
  118. "../host_kernels/mul_kernel.cc"
  119. "../host_kernels/pack_kernel.cc"
  120. "../host_kernels/permute_kernel.cc"
  121. "../host_kernels/range_kernel.cc"
  122. "../host_kernels/rank_kernel.cc"
  123. "../host_kernels/reduce_prod_kernel.cc"
  124. "../host_kernels/reshape_kernel.cc"
  125. "../host_kernels/rsqrt_kernel.cc"
  126. "../host_kernels/shape_kernel.cc"
  127. "../host_kernels/shape_n_kernel.cc"
  128. "../host_kernels/size_kernel.cc"
  129. "../host_kernels/slice_d_kernel.cc"
  130. "../host_kernels/slice_kernel.cc"
  131. "../host_kernels/squeeze_kernel.cc"
  132. "../host_kernels/unsqueeze_kernel.cc"
  133. "../host_kernels/ssd_prior_box_kernel.cc"
  134. "../host_kernels/strided_slice_kernel.cc"
  135. "../host_kernels/sub_kernel.cc"
  136. "../host_kernels/transdata_kernel.cc"
  137. "../host_kernels/unpack_kernel.cc"
  138. "../graph/passes/pass_utils.cc"
  139. )
  140. ######## libge_executor.a ########
  141. add_library(ge_executor STATIC ${SRC_LIST})
  142. add_dependencies(ge_executor
  143. graphengine_protos
  144. )
  145. target_compile_options(ge_executor PRIVATE
  146. $<$<OR:$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>,$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations -fno-common>
  147. $<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd>
  148. $<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT>
  149. $<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-variable>
  150. $<$<STREQUAL:${CMAKE_CXX_COMPILER_VERSION},7.3.0>:-Werror=unused-const-variable -Werror=format>
  151. )
  152. target_compile_definitions(ge_executor PRIVATE
  153. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  154. DAVINCI_SUPPORT_PROFILING
  155. google=ascend_private
  156. $<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,OS_TYPE=WIN,OS_TYPE=0>
  157. $<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX>
  158. $<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
  159. LOG_CPP
  160. )
  161. target_include_directories(ge_executor SYSTEM PRIVATE
  162. ${GE_CODE_DIR}/ge
  163. ${GE_CODE_DIR}/inc
  164. ${GE_CODE_DIR}/inc/external
  165. ${GE_CODE_DIR}/inc/framework
  166. ${METADEF_DIR}/inc
  167. ${METADEF_DIR}/inc/external
  168. ${CMAKE_BINARY_DIR}
  169. ${CMAKE_BINARY_DIR}/proto/graphengine_protos
  170. #### yellow zone ####
  171. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${GE_DEPEND_DIR}/inc>
  172. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<TARGET_PROPERTY:runtime_headers,INTERFACE_INCLUDE_DIRECTORIES>>
  173. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<TARGET_PROPERTY:cce_headers,INTERFACE_INCLUDE_DIRECTORIES>>
  174. #### blue zone ####
  175. $<$<BOOL:${ENABLE_OPEN_SRC}>:${GE_CODE_DIR}/third_party/fwkacllib/inc>
  176. $<$<BOOL:${ENABLE_OPEN_SRC}>:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain>
  177. )
  178. target_link_libraries(ge_executor PRIVATE
  179. $<BUILD_INTERFACE:intf_pub>
  180. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
  181. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
  182. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
  183. json
  184. ascend_protobuf_static
  185. c_sec
  186. $<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
  187. -ldl
  188. )
  189. ######## libge_executor.so ########
  190. add_library(ge_executor_shared SHARED ${SRC_LIST})
  191. add_dependencies(ge_executor_shared
  192. graphengine_protos
  193. )
  194. target_compile_options(ge_executor_shared PRIVATE
  195. -fno-common
  196. -Werror
  197. -O2
  198. -Wno-deprecated-declarations
  199. -fvisibility=hidden
  200. )
  201. target_compile_definitions(ge_executor_shared PRIVATE
  202. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  203. DAVINCI_SUPPORT_PROFILING
  204. google=ascend_private
  205. FUNC_VISIBILITY
  206. $<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
  207. )
  208. target_include_directories(ge_executor_shared PRIVATE
  209. ${GE_CODE_DIR}/ge
  210. ${GE_CODE_DIR}/inc
  211. ${GE_CODE_DIR}/inc/external
  212. ${GE_CODE_DIR}/inc/framework
  213. ${METADEF_DIR}/inc
  214. ${METADEF_DIR}/inc/external
  215. ${CMAKE_BINARY_DIR}
  216. ${CMAKE_BINARY_DIR}/proto/graphengine_protos
  217. #### yellow zone ####
  218. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:${GE_DEPEND_DIR}/inc>
  219. #### blue zone ####
  220. $<$<BOOL:${ENABLE_OPEN_SRC}>:${GE_CODE_DIR}/third_party/fwkacllib/inc>
  221. )
  222. target_link_options(ge_executor_shared PRIVATE
  223. -Wl,-Bsymbolic
  224. -Wl,--exclude-libs,ALL
  225. )
  226. target_link_libraries(ge_executor_shared PRIVATE
  227. $<BUILD_INTERFACE:intf_pub>
  228. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:slog_headers>>
  229. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:msprof_headers>>
  230. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:mmpa_headers>>
  231. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:runtime_headers>>
  232. $<$<NOT:$<BOOL:${ENABLE_OPEN_SRC}>>:$<BUILD_INTERFACE:cce_headers>>
  233. -Wl,--no-as-needed
  234. ge_common
  235. runtime
  236. slog
  237. graph
  238. register
  239. error_manager
  240. ascend_protobuf
  241. c_sec
  242. -Wl,--as-needed
  243. json
  244. $<$<NOT:$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-lrt>
  245. -ldl
  246. )
  247. set_target_properties(ge_executor_shared PROPERTIES
  248. OUTPUT_NAME ge_executor
  249. )
  250. ############ install ############
  251. set(INSTALL_BASE_DIR "")
  252. set(INSTALL_LIBRARY_DIR lib)
  253. install(TARGETS ge_executor_shared OPTIONAL
  254. LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
  255. )

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