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 1.8 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. "../session/omg.cc"
  12. "../ir_build/atc_ir_common.cc"
  13. )
  14. ############ atc ############
  15. add_executable(atc ${SRC_LIST} ${PROTO_HDRS})
  16. target_compile_options(atc PRIVATE
  17. -Werror
  18. -O2
  19. )
  20. target_compile_definitions(atc PRIVATE
  21. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  22. COMPILE_OMG_PACKAGE
  23. )
  24. target_include_directories(atc PRIVATE
  25. ${CMAKE_CURRENT_LIST_DIR}
  26. ${GE_CODE_DIR}
  27. ${GE_CODE_DIR}/ge
  28. ${GE_CODE_DIR}/inc/external
  29. ${GE_CODE_DIR}/common/inc/external
  30. ${GE_CODE_DIR}/common/inc/external/graph
  31. ${GE_CODE_DIR}/inc
  32. ${GE_CODE_DIR}/inc/framework
  33. ${METADEF_DIR}/inc
  34. ${METADEF_DIR}/inc/graph
  35. ${METADEF_DIR}/inc/register
  36. ${METADEF_DIR}/inc/external
  37. ${METADEF_DIR}/inc/external/graph
  38. ${METADEF_DIR}/inc/external/register
  39. ${PARSER_DIR}
  40. ${CMAKE_BINARY_DIR}
  41. ${CMAKE_BINARY_DIR}/proto/ge
  42. #### yellow zone ####
  43. ${GE_CODE_DIR}/../inc
  44. ${GE_CODE_DIR}/../inc/common
  45. #### blue zone ####
  46. ${GE_CODE_DIR}/third_party/fwkacllib/inc
  47. ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
  48. )
  49. target_link_libraries(atc PRIVATE
  50. $<BUILD_INTERFACE:intf_pub>
  51. protobuf
  52. ge_common
  53. register
  54. c_sec
  55. graph
  56. error_manager
  57. ge_compiler
  58. parser_common
  59. gflags
  60. json
  61. runtime_compile
  62. slog
  63. mmpa
  64. -lrt
  65. -ldl
  66. )
  67. ############ install ############
  68. set(INSTALL_BASE_DIR "")
  69. set(INSTALL_LIBRARY_DIR lib)
  70. install(TARGETS atc OPTIONAL
  71. LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
  72. )

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