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
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. ${GE_CODE_DIR}/third_party/fwkacllib/inc
  43. ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
  44. #### yellow zone ####
  45. ${GE_CODE_DIR}/../inc
  46. ${GE_CODE_DIR}/../inc/common
  47. )
  48. target_link_libraries(atc PRIVATE
  49. $<BUILD_INTERFACE:intf_pub>
  50. protobuf
  51. ge_common
  52. register
  53. c_sec
  54. graph
  55. error_manager
  56. ge_compiler
  57. parser_common
  58. gflags
  59. json
  60. runtime_compile
  61. slog
  62. mmpa
  63. -lrt
  64. -ldl
  65. )
  66. ############ install ############
  67. set(INSTALL_BASE_DIR "")
  68. set(INSTALL_LIBRARY_DIR lib)
  69. install(TARGETS atc OPTIONAL
  70. LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
  71. )

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