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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Copyright 2019-2020 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # ============================================================================
  15. # libge_executor.so
  16. # add all proto files, generate corresponding .h and .cc files
  17. # add src files
  18. file(GLOB PROTO_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
  19. "../../proto/task.proto"
  20. "../../proto/om.proto"
  21. "../../proto/insert_op.proto"
  22. "../../proto/op_mapping_info.proto"
  23. "../../proto/ge_ir.proto"
  24. "../../proto/dump_task.proto"
  25. )
  26. file(GLOB SRC_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
  27. "ge_executor.cc"
  28. "../common/dump/dump_properties.cc"
  29. "../common/dump/dump_manager.cc"
  30. "../common/dump/dump_op.cc"
  31. "../common/ge/op_tiling_manager.cc"
  32. "../common/ge/plugin_manager.cc"
  33. "../common/profiling/profiling_manager.cc"
  34. "../graph/execute/graph_execute.cc"
  35. "../graph/load/graph_loader.cc"
  36. "../graph/load/new_model_manager/aipp_utils.cc"
  37. "../graph/load/new_model_manager/cpu_queue_schedule.cc"
  38. "../graph/load/new_model_manager/data_dumper.cc"
  39. "../graph/load/new_model_manager/data_inputer.cc"
  40. "../graph/load/new_model_manager/davinci_model.cc"
  41. "../graph/load/new_model_manager/davinci_model_parser.cc"
  42. "../graph/load/new_model_manager/model_manager.cc"
  43. "../graph/load/new_model_manager/model_utils.cc"
  44. "../graph/load/new_model_manager/task_info/end_graph_task_info.cc"
  45. "../graph/load/new_model_manager/task_info/event_record_task_info.cc"
  46. "../graph/load/new_model_manager/task_info/event_wait_task_info.cc"
  47. "../graph/load/new_model_manager/task_info/fusion_start_task_info.cc"
  48. "../graph/load/new_model_manager/task_info/fusion_stop_task_info.cc"
  49. "../graph/load/new_model_manager/task_info/kernel_ex_task_info.cc"
  50. "../graph/load/new_model_manager/task_info/kernel_task_info.cc"
  51. "../graph/load/new_model_manager/task_info/label_goto_ex_task_info.cc"
  52. "../graph/load/new_model_manager/task_info/label_set_task_info.cc"
  53. "../graph/load/new_model_manager/task_info/label_switch_by_index_task_info.cc"
  54. "../graph/load/new_model_manager/task_info/memcpy_addr_async_task_info.cc"
  55. "../graph/load/new_model_manager/task_info/memcpy_async_task_info.cc"
  56. "../graph/load/new_model_manager/task_info/profiler_trace_task_info.cc"
  57. "../graph/load/new_model_manager/task_info/stream_active_task_info.cc"
  58. "../graph/load/new_model_manager/task_info/stream_switch_task_info.cc"
  59. "../graph/load/new_model_manager/task_info/stream_switchn_task_info.cc"
  60. "../graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc"
  61. "../graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc"
  62. "../graph/load/new_model_manager/task_info/task_info.cc"
  63. "../graph/load/new_model_manager/tbe_handle_store.cc"
  64. "../graph/load/new_model_manager/zero_copy_offset.cc"
  65. "../graph/load/new_model_manager/zero_copy_task.cc"
  66. "../graph/manager/graph_caching_allocator.cc"
  67. "../graph/manager/graph_manager_utils.cc"
  68. "../graph/manager/graph_mem_allocator.cc"
  69. "../graph/manager/graph_var_manager.cc"
  70. "../graph/manager/rdma_pool_allocator.cc"
  71. "../graph/manager/trans_var_data_utils.cc"
  72. "../graph/manager/util/debug.cc"
  73. "../hybrid/hybrid_davinci_model_stub.cc"
  74. "../hybrid/node_executor/aicpu/aicpu_ext_info.cc"
  75. "../model/ge_model.cc"
  76. "../model/ge_root_model.cc"
  77. "../omm/csa_interact.cc"
  78. "../single_op/single_op.cc"
  79. "../single_op/single_op_manager.cc"
  80. "../single_op/single_op_model.cc"
  81. "../single_op/stream_resource.cc"
  82. "../single_op/task/aicpu_task_builder.cc"
  83. "../single_op/task/build_task_utils.cc"
  84. "../single_op/task/op_task.cc"
  85. "../single_op/task/tbe_task_builder.cc"
  86. )
  87. protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})
  88. # include directories
  89. include_directories(${CMAKE_CURRENT_LIST_DIR})
  90. include_directories(${GE_SOURCE_DIR}/src/ge)
  91. include_directories(${GE_SOURCE_DIR}/inc/external)
  92. include_directories(${GE_SOURCE_DIR}/inc/external/graph)
  93. include_directories(${GE_SOURCE_DIR}/inc/framework)
  94. include_directories(${GE_SOURCE_DIR}/inc)
  95. include_directories(${GE_SOURCE_DIR}/inc/graph)
  96. include_directories(${GE_SOURCE_DIR}/third_party/fwkacllib/inc)
  97. include_directories(${GE_SOURCE_DIR}/third_party/fwkacllib/inc/cce)
  98. include_directories(${CMAKE_BINARY_DIR})
  99. include_directories(${CMAKE_BINARY_DIR}/proto/ge)
  100. ######## libge_executor.so ########
  101. add_library(ge_executor SHARED ${SRC_LIST} ${PROTO_HDRS})
  102. target_compile_definitions(ge_executor PRIVATE
  103. Werror
  104. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  105. DAVINCI_SUPPORT_PROFILING
  106. FMK_HOST_INFER)
  107. target_link_libraries(ge_executor
  108. ge_common
  109. graph
  110. ${PROTOBUF_LIBRARY}
  111. protobuf
  112. ${register}
  113. ${c_sec}
  114. ${runtime}
  115. ${slog}
  116. ${mmpa}
  117. ${msprof}
  118. ${error_manager}
  119. ${ascend_hal}
  120. rt
  121. dl)

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