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.

CMakeLists.txt 3.7 kB

5 years ago
5 years ago
5 years ago
4 years ago
4 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. set(PROTO_LIST
  2. "${METADEF_DIR}/proto/om.proto"
  3. "${METADEF_DIR}/proto/ge_ir.proto"
  4. "${METADEF_DIR}/proto/insert_op.proto"
  5. "${METADEF_DIR}/proto/task.proto"
  6. )
  7. protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})
  8. set(SRC_LIST
  9. "main.cc"
  10. "single_op_parser.cc"
  11. "keep_dtype_option.cc"
  12. "../session/omg.cc"
  13. "../ir_build/atc_ir_common.cc"
  14. )
  15. ############ atc_atc.bin ############
  16. add_executable(atc_atc.bin ${SRC_LIST} ${PROTO_HDRS})
  17. target_compile_options(atc_atc.bin PRIVATE
  18. -Werror
  19. -O2
  20. -Wno-deprecated-declarations
  21. -fno-common
  22. )
  23. target_compile_definitions(atc_atc.bin PRIVATE
  24. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  25. COMPILE_OMG_PACKAGE
  26. google=ascend_private
  27. LOG_CPP
  28. )
  29. target_include_directories(atc_atc.bin PRIVATE
  30. ${CMAKE_CURRENT_LIST_DIR}
  31. ${GE_CODE_DIR}
  32. ${GE_CODE_DIR}/ge
  33. ${GE_CODE_DIR}/inc/external
  34. ${GE_CODE_DIR}/common/inc/external
  35. ${GE_CODE_DIR}/common/inc/external/graph
  36. ${GE_CODE_DIR}/inc
  37. ${GE_CODE_DIR}/inc/framework
  38. ${METADEF_DIR}/inc
  39. ${METADEF_DIR}/inc/graph
  40. ${METADEF_DIR}/inc/register
  41. ${METADEF_DIR}/inc/external
  42. ${METADEF_DIR}/inc/external/graph
  43. ${METADEF_DIR}/inc/external/register
  44. ${PARSER_DIR}
  45. ${CMAKE_BINARY_DIR}
  46. ${CMAKE_BINARY_DIR}/proto/ge
  47. #### yellow zone ####
  48. ${GE_CODE_DIR}/../inc
  49. ${GE_CODE_DIR}/../inc/common
  50. #### blue zone ####
  51. ${GE_CODE_DIR}/third_party/fwkacllib/inc
  52. ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
  53. )
  54. target_link_libraries(atc_atc.bin PRIVATE
  55. $<BUILD_INTERFACE:intf_pub>
  56. ascend_protobuf
  57. ge_common
  58. register
  59. c_sec
  60. graph
  61. error_manager
  62. ge_compiler
  63. parser_common
  64. gflags
  65. json
  66. runtime_compile
  67. slog
  68. static_mmpa
  69. -lrt
  70. -ldl
  71. )
  72. set_target_properties(atc_atc.bin PROPERTIES
  73. OUTPUT_NAME atc.bin
  74. RUNTIME_OUTPUT_DIRECTORY atclib
  75. )
  76. ############ fwk_atc.bin ############
  77. add_executable(fwk_atc.bin ${SRC_LIST} ${PROTO_HDRS})
  78. target_compile_options(fwk_atc.bin PRIVATE
  79. -Werror
  80. -O2
  81. -Wno-deprecated-declarations
  82. -fno-common
  83. )
  84. target_compile_definitions(fwk_atc.bin PRIVATE
  85. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  86. COMPILE_OMG_PACKAGE
  87. google=ascend_private
  88. LOG_CPP
  89. )
  90. target_include_directories(fwk_atc.bin PRIVATE
  91. ${CMAKE_CURRENT_LIST_DIR}
  92. ${GE_CODE_DIR}
  93. ${GE_CODE_DIR}/ge
  94. ${GE_CODE_DIR}/inc/external
  95. ${GE_CODE_DIR}/common/inc/external
  96. ${GE_CODE_DIR}/common/inc/external/graph
  97. ${GE_CODE_DIR}/inc
  98. ${GE_CODE_DIR}/inc/framework
  99. ${METADEF_DIR}/inc
  100. ${METADEF_DIR}/inc/graph
  101. ${METADEF_DIR}/inc/register
  102. ${METADEF_DIR}/inc/external
  103. ${METADEF_DIR}/inc/external/graph
  104. ${METADEF_DIR}/inc/external/register
  105. ${PARSER_DIR}
  106. ${CMAKE_BINARY_DIR}
  107. ${CMAKE_BINARY_DIR}/proto/ge
  108. #### yellow zone ####
  109. ${GE_CODE_DIR}/../inc
  110. ${GE_CODE_DIR}/../inc/common
  111. #### blue zone ####
  112. ${GE_CODE_DIR}/third_party/fwkacllib/inc
  113. ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
  114. )
  115. target_link_libraries(fwk_atc.bin PRIVATE
  116. $<BUILD_INTERFACE:intf_pub>
  117. ascend_protobuf
  118. ge_common
  119. register
  120. c_sec
  121. graph
  122. error_manager
  123. ge_runner
  124. parser_common
  125. gflags
  126. json
  127. runtime
  128. slog
  129. static_mmpa
  130. -lrt
  131. -ldl
  132. )
  133. set_target_properties(fwk_atc.bin PROPERTIES
  134. OUTPUT_NAME atc.bin
  135. RUNTIME_OUTPUT_DIRECTORY fwkacl
  136. )
  137. ############ install ############
  138. set(INSTALL_BASE_DIR "")
  139. set(INSTALL_LIBRARY_DIR lib)
  140. install(TARGETS atc_atc.bin OPTIONAL
  141. RUNTIME DESTINATION ${INSTALL_LIBRARY_DIR}/atclib
  142. )
  143. install(TARGETS fwk_atc.bin OPTIONAL
  144. RUNTIME DESTINATION ${INSTALL_LIBRARY_DIR}/fwkacl
  145. )

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