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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ############ libge_runtime.so ############
  2. set(GE_SRC_LIST
  3. "model_runner.cc"
  4. "runtime_model.cc"
  5. "output.cc"
  6. "task/aicpu_task.cc"
  7. "task/cce_task.cc"
  8. "task/tbe_task.cc"
  9. "task/event_record_task.cc"
  10. "task/event_wait_task.cc"
  11. "task/stream_active_task.cc"
  12. "task/stream_switch_task.cc"
  13. "task/hccl_task.cc"
  14. "task/memcpy_async_task.cc"
  15. "task/profiler_task.cc"
  16. "task/label_goto_task.cc"
  17. "task/label_set_task.cc"
  18. "task/label_switch_task.cc"
  19. )
  20. add_library(ge_runtime SHARED ${GE_SRC_LIST})
  21. target_compile_options(ge_runtime PRIVATE
  22. -Werror
  23. -O2
  24. -Wno-deprecated-declarations
  25. -fno-common
  26. )
  27. target_compile_definitions(ge_runtime PRIVATE
  28. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  29. LOG_CPP
  30. )
  31. target_include_directories(ge_runtime PRIVATE
  32. ${CMAKE_CURRENT_LIST_DIR}
  33. ${GE_CODE_DIR}
  34. ${GE_CODE_DIR}/ge
  35. ${GE_CODE_DIR}/inc
  36. ${GE_CODE_DIR}/inc/graph
  37. ${GE_CODE_DIR}/inc/external
  38. ${GE_CODE_DIR}/inc/framework
  39. ${GE_CODE_DIR}/inc/framework/common
  40. ${GE_CODE_DIR}/inc/framework/ge_runtime
  41. ${GE_CODE_DIR}/inc/cce
  42. ${GE_CODE_DIR}/third_party/fwkacllib/inc
  43. ${METADEF_DIR}
  44. ${METADEF_DIR}/inc
  45. ${METADEF_DIR}/inc/external/graph
  46. ${METADEF_DIR}/inc/external
  47. ${METADEF_DIR}/inc/graph
  48. ${CMAKE_BINARY_DIR}
  49. ${CMAKE_BINARY_DIR}/proto/ge
  50. )
  51. target_link_libraries(ge_runtime PRIVATE
  52. $<BUILD_INTERFACE:intf_pub>
  53. -Wl,--no-as-needed
  54. slog
  55. runtime
  56. c_sec
  57. graph
  58. -Wl,--as-needed
  59. -lrt
  60. -ldl
  61. )
  62. ############ install ############
  63. set(INSTALL_BASE_DIR "")
  64. set(INSTALL_LIBRARY_DIR lib)
  65. install(TARGETS ge_runtime OPTIONAL
  66. LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
  67. )

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