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

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

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