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.

ge_common.mk 6.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. LOCAL_PATH := $(call my-dir)
  2. GE_COMMON_LOCAL_SRC_FILES := \
  3. context/ctx.cc \
  4. model_saver.cc \
  5. ge/datatype_util.cc \
  6. helper/om_file_helper.cc \
  7. helper/model_helper.cc \
  8. ../model/ge_model.cc \
  9. auth/file_saver.cc \
  10. fp16_t.cc \
  11. math/fp16_math.cc \
  12. debug/memory_dumper.cc \
  13. formats/utils/formats_trans_utils.cc \
  14. dump/dump_properties.cc \
  15. formats/format_transfers/datatype_transfer.cc \
  16. formats/format_transfers/format_transfer_transpose.cc \
  17. formats/format_transfers/format_transfer_nchw_nc1hwc0.cc \
  18. formats/format_transfers/format_transfer_fractal_z.cc \
  19. formats/format_transfers/format_transfer_fractal_nz.cc \
  20. formats/format_transfers/format_transfer_fractal_zz.cc \
  21. formats/format_transfers/format_transfer_nhwc_nc1hwc0.cc \
  22. formats/format_transfers/format_transfer_nc1hwc0_nchw.cc \
  23. formats/format_transfers/format_transfer_nc1hwc0_nhwc.cc \
  24. formats/format_transfers/format_transfer_hwcn_c1hwncoc0.cc \
  25. formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc \
  26. formats/format_transfers/format_transfer_fracz_nchw.cc \
  27. formats/format_transfers/format_transfer_fracz_nhwc.cc \
  28. formats/format_transfers/format_transfer_fracz_hwcn.cc \
  29. formats/format_transfers/format_transfer_dhwcn_fracz3D.cc \
  30. formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc \
  31. formats/format_transfers/format_transfer_nchw_fz_c04.cc \
  32. formats/formats.cc \
  33. ge_format_util.cc \
  34. fmk_error_codes.cc \
  35. util.cc \
  36. properties_manager.cc \
  37. types.cc\
  38. model_parser/base.cc \
  39. kernel_store.cc \
  40. tbe_kernel_store.cc \
  41. cust_aicpu_kernel_store.cc \
  42. op/attr_value_util.cc \
  43. op/ge_op_utils.cc \
  44. thread_pool.cc \
  45. ge/tbe_plugin_manager.cc \
  46. GE_COMMON_LOCAL_C_INCLUDES := \
  47. proto/om.proto \
  48. proto/ge_ir.proto \
  49. proto/task.proto \
  50. proto/insert_op.proto \
  51. proto/tensorflow/graph.proto \
  52. proto/tensorflow/node_def.proto \
  53. proto/tensorflow/function.proto \
  54. proto/tensorflow/versions.proto \
  55. proto/tensorflow/attr_value.proto \
  56. proto/tensorflow/tensor.proto \
  57. proto/tensorflow/tensor_shape.proto \
  58. proto/tensorflow/op_def.proto \
  59. proto/tensorflow/types.proto \
  60. proto/tensorflow/resource_handle.proto \
  61. $(TOPDIR)inc \
  62. $(TOPDIR)inc/external \
  63. $(TOPDIR)inc/external/graph \
  64. $(TOPDIR)inc/framework \
  65. $(TOPDIR)inc/common/util \
  66. $(TOPDIR)libc_sec/include \
  67. $(TOPDIR)third_party/json/include \
  68. $(TOPDIR)third_party/protobuf/include \
  69. $(TOPDIR)third_party/openssl/include/x86/include \
  70. $(TOPDIR)framework/domi \
  71. $(TOPDIR)framework/domi/common \
  72. $(TOPDIR)framework/domi/common/op \
  73. $(TOPDIR)graphengine/ge \
  74. $(TOPDIR)graphengine/ge/common \
  75. $(TOPDIR)graphengine/ge/common/op \
  76. #compile host libge_common
  77. include $(CLEAR_VARS)
  78. LOCAL_MODULE := libge_common
  79. LOCAL_CFLAGS += -Werror -DFMK_SUPPORT_DUMP
  80. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2 -Dgoogle=ascend_private
  81. ifeq ($(DEBUG), 1)
  82. LOCAL_CFLAGS += -g -O0
  83. else
  84. LOCAL_CFLAGS += -fvisibility=hidden -DHOST_VISIBILITY
  85. endif
  86. ifeq ($(host_os), euleros)
  87. LOCAL_CFLAGS += -DOS_CENTOS
  88. endif
  89. ifeq ($(host_os), centos)
  90. LOCAL_CFLAGS += -DOS_CENTOS
  91. endif
  92. ifeq ($(TARGET_OS), euleros)
  93. LOCAL_CFLAGS += -DOS_CENTOS
  94. endif
  95. ifeq ($(TARGET_OS), centos)
  96. LOCAL_CFLAGS += -DOS_CENTOS
  97. endif
  98. LOCAL_C_INCLUDES := $(GE_COMMON_LOCAL_C_INCLUDES)
  99. LOCAL_SRC_FILES := $(GE_COMMON_LOCAL_SRC_FILES)
  100. LOCAL_SHARED_LIBRARIES := \
  101. libascend_protobuf \
  102. libc_sec \
  103. libslog \
  104. libmmpa \
  105. libgraph \
  106. libregister \
  107. liberror_manager \
  108. LOCAL_LDFLAGS := -lrt -ldl
  109. include $(BUILD_HOST_SHARED_LIBRARY)
  110. #compile device libge_common
  111. include $(CLEAR_VARS)
  112. LOCAL_MODULE := libge_common
  113. LOCAL_CFLAGS += -Werror -DFMK_SUPPORT_DUMP
  114. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2 -Dgoogle=ascend_private
  115. ifeq ($(DEBUG), 1)
  116. LOCAL_CFLAGS += -g -O0
  117. else
  118. LOCAL_CFLAGS += -fvisibility=hidden -DDEV_VISIBILITY
  119. endif
  120. ifeq ($(host_os), euleros)
  121. LOCAL_CFLAGS += -DOS_CENTOS
  122. endif
  123. ifeq ($(host_os), centos)
  124. LOCAL_CFLAGS += -DOS_CENTOS
  125. endif
  126. ifeq ($(TARGET_OS), euleros)
  127. LOCAL_CFLAGS += -DOS_CENTOS
  128. endif
  129. ifeq ($(TARGET_OS), centos)
  130. LOCAL_CFLAGS += -DOS_CENTOS
  131. endif
  132. LOCAL_C_INCLUDES := $(GE_COMMON_LOCAL_C_INCLUDES)
  133. LOCAL_SRC_FILES := $(GE_COMMON_LOCAL_SRC_FILES)
  134. LOCAL_SHARED_LIBRARIES := \
  135. libascend_protobuf \
  136. libc_sec \
  137. libslog \
  138. libmmpa \
  139. libgraph \
  140. libregister \
  141. liberror_manager \
  142. ifeq ($(device_os),android)
  143. LOCAL_LDFLAGS += -ldl
  144. LOCAL_LDLIBS += -L$(PWD)/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29 -llog
  145. else
  146. LOCAL_LDFLAGS := -lrt -ldl
  147. endif
  148. include $(BUILD_SHARED_LIBRARY)
  149. #compile host libge_common static lib
  150. include $(CLEAR_VARS)
  151. LOCAL_MODULE := libge_common
  152. LOCAL_CFLAGS += -Werror -DFMK_SUPPORT_DUMP
  153. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2 -Dgoogle=ascend_private
  154. ifeq ($(DEBUG), 1)
  155. LOCAL_CFLAGS += -g -O0
  156. endif
  157. ifeq ($(host_os), euleros)
  158. LOCAL_CFLAGS += -DOS_CENTOS
  159. endif
  160. ifeq ($(host_os), centos)
  161. LOCAL_CFLAGS += -DOS_CENTOS
  162. endif
  163. ifeq ($(TARGET_OS), euleros)
  164. LOCAL_CFLAGS += -DOS_CENTOS
  165. endif
  166. ifeq ($(TARGET_OS), centos)
  167. LOCAL_CFLAGS += -DOS_CENTOS
  168. endif
  169. LOCAL_C_INCLUDES := $(GE_COMMON_LOCAL_C_INCLUDES)
  170. LOCAL_SRC_FILES := $(GE_COMMON_LOCAL_SRC_FILES)
  171. LOCAL_STATIC_LIBRARIES := \
  172. libgraph \
  173. libascend_protobuf \
  174. LOCAL_SHARED_LIBRARIES := \
  175. libc_sec \
  176. libslog \
  177. libmmpa \
  178. libregister \
  179. liberror_manager \
  180. LOCAL_LDFLAGS := -lrt -ldl
  181. include $(BUILD_HOST_STATIC_LIBRARY)
  182. #compile device libge_common static_lib
  183. include $(CLEAR_VARS)
  184. LOCAL_MODULE := libge_common
  185. LOCAL_CFLAGS += -Werror -DFMK_SUPPORT_DUMP
  186. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2 -Dgoogle=ascend_private
  187. ifeq ($(DEBUG), 1)
  188. LOCAL_CFLAGS += -g -O0
  189. endif
  190. ifeq ($(host_os), euleros)
  191. LOCAL_CFLAGS += -DOS_CENTOS
  192. endif
  193. ifeq ($(host_os), centos)
  194. LOCAL_CFLAGS += -DOS_CENTOS
  195. endif
  196. ifeq ($(TARGET_OS), euleros)
  197. LOCAL_CFLAGS += -DOS_CENTOS
  198. endif
  199. ifeq ($(TARGET_OS), centos)
  200. LOCAL_CFLAGS += -DOS_CENTOS
  201. endif
  202. LOCAL_C_INCLUDES := $(GE_COMMON_LOCAL_C_INCLUDES)
  203. LOCAL_SRC_FILES := $(GE_COMMON_LOCAL_SRC_FILES)
  204. LOCAL_STATIC_LIBRARIES := \
  205. libgraph \
  206. libascend_protobuf \
  207. LOCAL_SHARED_LIBRARIES := \
  208. libc_sec \
  209. libslog \
  210. libmmpa \
  211. libregister \
  212. liberror_manager \
  213. LOCAL_LDFLAGS := -lrt -ldl
  214. include $(BUILD_STATIC_LIBRARY)

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