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.

module.mk 8.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. LOCAL_PATH := $(call my-dir)
  2. local_ge_executor_src_files := \
  3. ge_executor.cc \
  4. ../common/profiling/profiling_manager.cc \
  5. ../common/dump/dump_properties.cc \
  6. ../common/dump/dump_manager.cc \
  7. ../common/dump/dump_op.cc \
  8. ../common/ge/plugin_manager.cc \
  9. ../common/ge/op_tiling_manager.cc \
  10. ../graph/load/graph_loader.cc \
  11. ../graph/execute/graph_execute.cc \
  12. ../omm/csa_interact.cc \
  13. ../graph/manager/graph_manager_utils.cc \
  14. ../graph/manager/graph_var_manager.cc \
  15. ../graph/manager/rdma_pool_allocator.cc \
  16. ../graph/manager/graph_mem_allocator.cc \
  17. ../graph/manager/graph_caching_allocator.cc \
  18. ../graph/manager/trans_var_data_utils.cc \
  19. ../graph/manager/util/debug.cc \
  20. ../model/ge_model.cc \
  21. ../model/ge_root_model.cc \
  22. ../graph/load/new_model_manager/davinci_model.cc \
  23. ../graph/load/new_model_manager/davinci_model_parser.cc \
  24. ../graph/load/new_model_manager/model_manager.cc \
  25. ../graph/load/new_model_manager/tbe_handle_store.cc \
  26. ../graph/load/new_model_manager/cpu_queue_schedule.cc \
  27. ../graph/load/new_model_manager/model_utils.cc \
  28. ../graph/load/new_model_manager/aipp_utils.cc \
  29. ../graph/load/new_model_manager/data_inputer.cc \
  30. ../graph/load/new_model_manager/data_dumper.cc \
  31. ../graph/load/new_model_manager/zero_copy_task.cc \
  32. ../graph/load/new_model_manager/zero_copy_offset.cc \
  33. ../graph/load/new_model_manager/task_info/task_info.cc \
  34. ../graph/load/new_model_manager/task_info/event_record_task_info.cc \
  35. ../graph/load/new_model_manager/task_info/event_wait_task_info.cc \
  36. ../graph/load/new_model_manager/task_info/fusion_start_task_info.cc \
  37. ../graph/load/new_model_manager/task_info/fusion_stop_task_info.cc \
  38. ../graph/load/new_model_manager/task_info/kernel_ex_task_info.cc \
  39. ../graph/load/new_model_manager/task_info/kernel_task_info.cc \
  40. ../graph/load/new_model_manager/task_info/label_set_task_info.cc \
  41. ../graph/load/new_model_manager/task_info/label_switch_by_index_task_info.cc \
  42. ../graph/load/new_model_manager/task_info/label_goto_ex_task_info.cc \
  43. ../graph/load/new_model_manager/task_info/memcpy_async_task_info.cc \
  44. ../graph/load/new_model_manager/task_info/memcpy_addr_async_task_info.cc \
  45. ../graph/load/new_model_manager/task_info/profiler_trace_task_info.cc \
  46. ../graph/load/new_model_manager/task_info/stream_active_task_info.cc \
  47. ../graph/load/new_model_manager/task_info/stream_switch_task_info.cc \
  48. ../graph/load/new_model_manager/task_info/stream_switchn_task_info.cc \
  49. ../graph/load/new_model_manager/task_info/end_graph_task_info.cc \
  50. ../graph/load/new_model_manager/task_info/model_exit_task_info.cc \
  51. ../graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc \
  52. ../graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc \
  53. ../opskernel_manager/ops_kernel_builder_manager.cc \
  54. ../single_op/single_op_manager.cc \
  55. ../single_op/single_op_model.cc \
  56. ../single_op/single_op.cc \
  57. ../single_op/stream_resource.cc \
  58. ../single_op/task/op_task.cc \
  59. ../single_op/task/build_task_utils.cc \
  60. ../single_op/task/tbe_task_builder.cc \
  61. ../single_op/task/aicpu_task_builder.cc \
  62. ../single_op/task/aicpu_kernel_task_builder.cc \
  63. ../hybrid/hybrid_davinci_model_stub.cc\
  64. ../hybrid/node_executor/aicpu/aicpu_ext_info.cc \
  65. ../graph/common/local_context.cc \
  66. local_ge_executor_c_include := \
  67. proto/insert_op.proto \
  68. proto/op_mapping_info.proto \
  69. proto/dump_task.proto \
  70. proto/ge_ir.proto \
  71. proto/task.proto \
  72. proto/om.proto \
  73. $(TOPDIR)inc/external \
  74. $(TOPDIR)metadef/inc/external \
  75. $(TOPDIR)graphengine/inc/external \
  76. $(TOPDIR)metadef/inc/external/graph \
  77. $(TOPDIR)graphengine/inc/framework \
  78. $(TOPDIR)inc \
  79. $(TOPDIR)metadef/inc \
  80. $(TOPDIR)graphengine/inc \
  81. $(LOCAL_PATH)/../ \
  82. $(TOPDIR)graphengine/ge \
  83. $(TOPDIR)libc_sec/include \
  84. third_party/protobuf/include \
  85. third_party/json/include \
  86. local_ge_executor_shared_library := \
  87. libascend_protobuf \
  88. libc_sec \
  89. libge_common \
  90. libruntime \
  91. libslog \
  92. libmmpa \
  93. libgraph \
  94. libregister \
  95. libmsprof \
  96. liberror_manager \
  97. local_ge_executor_ldflags := -lrt -ldl \
  98. #compile arm device dynamic lib
  99. include $(CLEAR_VARS)
  100. LOCAL_MODULE := libge_executor
  101. LOCAL_CFLAGS += -Werror -Wno-deprecated-declarations
  102. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2 -DDAVINCI_SUPPORT_PROFILING -Dgoogle=ascend_private
  103. LOCAL_SRC_FILES := $(local_ge_executor_src_files)
  104. LOCAL_C_INCLUDES := $(local_ge_executor_c_include)
  105. LOCAL_SHARED_LIBRARIES := $(local_ge_executor_shared_library)
  106. LOCAL_SHARED_LIBRARIES += libascend_hal
  107. LOCAL_STATIC_LIBRARIES := \
  108. libmsprofiler \
  109. ifeq ($(device_os),android)
  110. LOCAL_LDFLAGS += -ldl
  111. LOCAL_LDLIBS += -L$(PWD)/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29 -llog
  112. else
  113. LOCAL_LDFLAGS += $(local_ge_executor_ldflags)
  114. endif
  115. include $(BUILD_SHARED_LIBRARY)
  116. #compile x86 host dynamic lib
  117. include $(CLEAR_VARS)
  118. LOCAL_MODULE := libge_executor
  119. LOCAL_CFLAGS += -Werror -Wno-deprecated-declarations
  120. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -DDAVINCI_SUPPORT_PROFILING -Dgoogle=ascend_private
  121. ifeq ($(DEBUG), 1)
  122. LOCAL_CFLAGS += -g -O0
  123. else
  124. LOCAL_CFLAGS += -O2
  125. endif
  126. LOCAL_SRC_FILES := $(local_ge_executor_src_files)
  127. LOCAL_C_INCLUDES := $(local_ge_executor_c_include)
  128. LOCAL_SHARED_LIBRARIES := \
  129. libascend_protobuf \
  130. libc_sec \
  131. libge_common \
  132. libruntime \
  133. libslog \
  134. libmmpa \
  135. libgraph \
  136. libregister \
  137. libmsprof \
  138. liberror_manager \
  139. stub/libascend_hal \
  140. LOCAL_STATIC_LIBRARIES := \
  141. libmsprofiler \
  142. LOCAL_LDFLAGS += $(local_ge_executor_ldflags)
  143. include $(BUILD_HOST_SHARED_LIBRARY)
  144. #compile for host static lib
  145. include $(CLEAR_VARS)
  146. LOCAL_MODULE := libge_executor
  147. LOCAL_CFLAGS += -Werror -Wno-deprecated-declarations
  148. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -DDAVINCI_SUPPORT_PROFILING -Dgoogle=ascend_private
  149. ifeq ($(DEBUG), 1)
  150. LOCAL_CFLAGS += -g -O0
  151. else
  152. LOCAL_CFLAGS += -O2
  153. endif
  154. LOCAL_SRC_FILES := $(local_ge_executor_src_files)
  155. LOCAL_C_INCLUDES := $(local_ge_executor_c_include)
  156. LOCAL_STATIC_LIBRARIES := \
  157. libge_common \
  158. libgraph \
  159. libregister \
  160. libascend_protobuf \
  161. LOCAL_SHARED_LIBRARIES := \
  162. libc_sec \
  163. libruntime \
  164. libslog \
  165. libmmpa \
  166. libmsprof \
  167. LOCAL_LDFLAGS += $(local_ge_executor_ldflags)
  168. include $(BUILD_HOST_STATIC_LIBRARY)
  169. #compile for device static lib
  170. include $(CLEAR_VARS)
  171. LOCAL_MODULE := libge_executor
  172. LOCAL_CFLAGS += -Werror -Wno-deprecated-declarations
  173. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -DDAVINCI_SUPPORT_PROFILING -Dgoogle=ascend_private
  174. ifeq ($(DEBUG), 1)
  175. LOCAL_CFLAGS += -g -O0
  176. else
  177. LOCAL_CFLAGS += -O2
  178. endif
  179. LOCAL_SRC_FILES := $(local_ge_executor_src_files)
  180. LOCAL_C_INCLUDES := $(local_ge_executor_c_include)
  181. LOCAL_STATIC_LIBRARIES := \
  182. libge_common \
  183. libgraph \
  184. libregister \
  185. libascend_protobuf \
  186. LOCAL_SHARED_LIBRARIES := \
  187. libc_sec \
  188. libruntime \
  189. libslog \
  190. libmmpa \
  191. libmsprof \
  192. ifeq ($(device_os),android)
  193. LOCAL_LDFLAGS += -ldl
  194. LOCAL_LDLIBS += -L$(PWD)/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29 -llog
  195. else
  196. LOCAL_LDFLAGS += $(local_ge_executor_ldflags)
  197. endif
  198. include $(BUILD_STATIC_LIBRARY)

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