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.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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)metadef/inc \
  63. $(TOPDIR)graphengine/inc \
  64. $(TOPDIR)inc/external \
  65. $(TOPDIR)metadef/inc/external \
  66. $(TOPDIR)graphengine/inc/external \
  67. $(TOPDIR)metadef/inc/external/graph \
  68. $(TOPDIR)graphengine/inc/framework \
  69. $(TOPDIR)metadef/inc/common/util \
  70. $(TOPDIR)libc_sec/include \
  71. $(TOPDIR)third_party/json/include \
  72. $(TOPDIR)third_party/protobuf/include \
  73. $(TOPDIR)third_party/openssl/include/x86/include \
  74. $(TOPDIR)graphengine/ge \
  75. $(TOPDIR)graphengine/ge/common \
  76. $(TOPDIR)graphengine/ge/common/op \
  77. #compile host libge_common
  78. include $(CLEAR_VARS)
  79. LOCAL_MODULE := libge_common
  80. LOCAL_CFLAGS += -Werror -DFMK_SUPPORT_DUMP -Wno-deprecated-declarations
  81. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2 -Dgoogle=ascend_private
  82. ifeq ($(DEBUG), 1)
  83. LOCAL_CFLAGS += -g -O0
  84. else
  85. LOCAL_CFLAGS += -fvisibility=hidden -DHOST_VISIBILITY
  86. endif
  87. ifeq ($(host_os), euleros)
  88. LOCAL_CFLAGS += -DOS_CENTOS
  89. endif
  90. ifeq ($(host_os), centos)
  91. LOCAL_CFLAGS += -DOS_CENTOS
  92. endif
  93. ifeq ($(TARGET_OS), euleros)
  94. LOCAL_CFLAGS += -DOS_CENTOS
  95. endif
  96. ifeq ($(TARGET_OS), centos)
  97. LOCAL_CFLAGS += -DOS_CENTOS
  98. endif
  99. LOCAL_C_INCLUDES := $(GE_COMMON_LOCAL_C_INCLUDES)
  100. LOCAL_SRC_FILES := $(GE_COMMON_LOCAL_SRC_FILES)
  101. LOCAL_SHARED_LIBRARIES := \
  102. libascend_protobuf \
  103. libc_sec \
  104. libslog \
  105. libgraph \
  106. libregister \
  107. liberror_manager \
  108. LOCAL_STATIC_LIBRARIES += libmmpa
  109. LOCAL_LDFLAGS := -lrt -ldl
  110. include $(BUILD_HOST_SHARED_LIBRARY)
  111. #compile device libge_common
  112. include $(CLEAR_VARS)
  113. LOCAL_MODULE := libge_common
  114. LOCAL_CFLAGS += -Werror -DFMK_SUPPORT_DUMP -Wno-deprecated-declarations
  115. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2 -Dgoogle=ascend_private
  116. ifeq ($(DEBUG), 1)
  117. LOCAL_CFLAGS += -g -O0
  118. else
  119. LOCAL_CFLAGS += -fvisibility=hidden -DDEV_VISIBILITY
  120. endif
  121. ifeq ($(host_os), euleros)
  122. LOCAL_CFLAGS += -DOS_CENTOS
  123. endif
  124. ifeq ($(host_os), centos)
  125. LOCAL_CFLAGS += -DOS_CENTOS
  126. endif
  127. ifeq ($(TARGET_OS), euleros)
  128. LOCAL_CFLAGS += -DOS_CENTOS
  129. endif
  130. ifeq ($(TARGET_OS), centos)
  131. LOCAL_CFLAGS += -DOS_CENTOS
  132. endif
  133. LOCAL_C_INCLUDES := $(GE_COMMON_LOCAL_C_INCLUDES)
  134. LOCAL_SRC_FILES := $(GE_COMMON_LOCAL_SRC_FILES)
  135. LOCAL_SHARED_LIBRARIES := \
  136. libascend_protobuf \
  137. libc_sec \
  138. libslog \
  139. libgraph \
  140. libregister \
  141. liberror_manager \
  142. LOCAL_STATIC_LIBRARIES += libmmpa
  143. ifeq ($(device_os),android)
  144. LOCAL_LDFLAGS += -ldl
  145. LOCAL_LDLIBS += -L$(PWD)/prebuilts/clang/linux-x86/aarch64/android-ndk-r21/sysroot/usr/lib/aarch64-linux-android/29 -llog
  146. else
  147. LOCAL_LDFLAGS := -lrt -ldl
  148. endif
  149. include $(BUILD_SHARED_LIBRARY)
  150. #compile host libge_common static lib
  151. include $(CLEAR_VARS)
  152. LOCAL_MODULE := libge_common
  153. LOCAL_CFLAGS += -Werror -DFMK_SUPPORT_DUMP -Wno-deprecated-declarations
  154. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2 -Dgoogle=ascend_private
  155. ifeq ($(DEBUG), 1)
  156. LOCAL_CFLAGS += -g -O0
  157. endif
  158. ifeq ($(host_os), euleros)
  159. LOCAL_CFLAGS += -DOS_CENTOS
  160. endif
  161. ifeq ($(host_os), centos)
  162. LOCAL_CFLAGS += -DOS_CENTOS
  163. endif
  164. ifeq ($(TARGET_OS), euleros)
  165. LOCAL_CFLAGS += -DOS_CENTOS
  166. endif
  167. ifeq ($(TARGET_OS), centos)
  168. LOCAL_CFLAGS += -DOS_CENTOS
  169. endif
  170. LOCAL_C_INCLUDES := $(GE_COMMON_LOCAL_C_INCLUDES)
  171. LOCAL_SRC_FILES := $(GE_COMMON_LOCAL_SRC_FILES)
  172. LOCAL_STATIC_LIBRARIES := \
  173. libgraph \
  174. libascend_protobuf \
  175. LOCAL_SHARED_LIBRARIES := \
  176. libc_sec \
  177. libslog \
  178. libmmpa \
  179. libregister \
  180. liberror_manager \
  181. LOCAL_LDFLAGS := -lrt -ldl
  182. include $(BUILD_HOST_STATIC_LIBRARY)
  183. #compile device libge_common static_lib
  184. include $(CLEAR_VARS)
  185. LOCAL_MODULE := libge_common
  186. LOCAL_CFLAGS += -Werror -DFMK_SUPPORT_DUMP -Wno-deprecated-declarations
  187. LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -O2 -Dgoogle=ascend_private
  188. ifeq ($(DEBUG), 1)
  189. LOCAL_CFLAGS += -g -O0
  190. endif
  191. ifeq ($(host_os), euleros)
  192. LOCAL_CFLAGS += -DOS_CENTOS
  193. endif
  194. ifeq ($(host_os), centos)
  195. LOCAL_CFLAGS += -DOS_CENTOS
  196. endif
  197. ifeq ($(TARGET_OS), euleros)
  198. LOCAL_CFLAGS += -DOS_CENTOS
  199. endif
  200. ifeq ($(TARGET_OS), centos)
  201. LOCAL_CFLAGS += -DOS_CENTOS
  202. endif
  203. LOCAL_C_INCLUDES := $(GE_COMMON_LOCAL_C_INCLUDES)
  204. LOCAL_SRC_FILES := $(GE_COMMON_LOCAL_SRC_FILES)
  205. LOCAL_STATIC_LIBRARIES := \
  206. libgraph \
  207. libascend_protobuf \
  208. LOCAL_SHARED_LIBRARIES := \
  209. libc_sec \
  210. libslog \
  211. libmmpa \
  212. libregister \
  213. liberror_manager \
  214. LOCAL_LDFLAGS := -lrt -ldl
  215. include $(BUILD_STATIC_LIBRARY)

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