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

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. -Wno-deprecated-declarations
  20. )
  21. target_compile_definitions(atc PRIVATE
  22. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  23. COMPILE_OMG_PACKAGE
  24. google=ascend_private
  25. )
  26. target_include_directories(atc PRIVATE
  27. ${CMAKE_CURRENT_LIST_DIR}
  28. ${GE_CODE_DIR}
  29. ${GE_CODE_DIR}/ge
  30. ${GE_CODE_DIR}/inc/external
  31. ${GE_CODE_DIR}/common/inc/external
  32. ${GE_CODE_DIR}/common/inc/external/graph
  33. ${GE_CODE_DIR}/inc
  34. ${GE_CODE_DIR}/inc/framework
  35. ${METADEF_DIR}/inc
  36. ${METADEF_DIR}/inc/graph
  37. ${METADEF_DIR}/inc/register
  38. ${METADEF_DIR}/inc/external
  39. ${METADEF_DIR}/inc/external/graph
  40. ${METADEF_DIR}/inc/external/register
  41. ${PARSER_DIR}
  42. ${CMAKE_BINARY_DIR}
  43. ${CMAKE_BINARY_DIR}/proto/ge
  44. #### yellow zone ####
  45. ${GE_CODE_DIR}/../inc
  46. ${GE_CODE_DIR}/../inc/common
  47. #### blue zone ####
  48. ${GE_CODE_DIR}/third_party/fwkacllib/inc
  49. ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
  50. )
  51. target_link_libraries(atc PRIVATE
  52. $<BUILD_INTERFACE:intf_pub>
  53. ascend_protobuf
  54. ge_common
  55. register
  56. c_sec
  57. graph
  58. error_manager
  59. ge_compiler
  60. parser_common
  61. gflags
  62. json
  63. runtime_compile
  64. slog
  65. static_mmpa
  66. -lrt
  67. -ldl
  68. )
  69. ############ install ############
  70. set(INSTALL_BASE_DIR "")
  71. set(INSTALL_LIBRARY_DIR lib)
  72. install(TARGETS atc OPTIONAL
  73. LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
  74. )

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