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

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

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