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

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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_common.so
  16. file(GLOB PROTO_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
  17. "../../proto/om.proto"
  18. "../../proto/ge_ir.proto"
  19. "../../proto/task.proto"
  20. "../../proto/insert_op.proto"
  21. )
  22. file(GLOB SRC_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
  23. "../model/ge_model.cc"
  24. "auth/file_saver.cc"
  25. "context/ctx.cc"
  26. "cust_aicpu_kernel_store.cc"
  27. "debug/memory_dumper.cc"
  28. "fmk_error_codes.cc"
  29. "formats/format_transfers/datatype_transfer.cc"
  30. "formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc"
  31. "formats/format_transfers/format_transfer_dhwcn_fracz3D.cc"
  32. "formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc"
  33. "formats/format_transfers/format_transfer_fractal_nz.cc"
  34. "formats/format_transfers/format_transfer_fractal_z.cc"
  35. "formats/format_transfers/format_transfer_fractal_zz.cc"
  36. "formats/format_transfers/format_transfer_fracz_hwcn.cc"
  37. "formats/format_transfers/format_transfer_fracz_nchw.cc"
  38. "formats/format_transfers/format_transfer_fracz_nhwc.cc"
  39. "formats/format_transfers/format_transfer_hwcn_c1hwncoc0.cc"
  40. "formats/format_transfers/format_transfer_nc1hwc0_nchw.cc"
  41. "formats/format_transfers/format_transfer_nc1hwc0_nhwc.cc"
  42. "formats/format_transfers/format_transfer_nchw_fz_c04.cc"
  43. "formats/format_transfers/format_transfer_nchw_nc1hwc0.cc"
  44. "formats/format_transfers/format_transfer_nhwc_nc1hwc0.cc"
  45. "formats/format_transfers/format_transfer_transpose.cc"
  46. "formats/formats.cc"
  47. "formats/utils/formats_trans_utils.cc"
  48. "fp16_t.cc"
  49. "ge/datatype_util.cc"
  50. "ge/tbe_plugin_manager.cc"
  51. "ge_format_util.cc"
  52. "helper/model_helper.cc"
  53. "helper/om_file_helper.cc"
  54. "kernel_store.cc"
  55. "math/fp16_math.cc"
  56. "model_parser/base.cc"
  57. "model_saver.cc"
  58. "op/attr_value_util.cc"
  59. "op/ge_op_utils.cc"
  60. "properties_manager.cc"
  61. "tbe_kernel_store.cc"
  62. "thread_pool.cc"
  63. "types.cc"
  64. "util.cc"
  65. )
  66. ge_protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})
  67. # include directories
  68. include_directories(${CMAKE_CURRENT_LIST_DIR})
  69. include_directories(${CMAKE_CURRENT_LIST_DIR}/op)
  70. include_directories(${GE_SOURCE_DIR}/ge)
  71. include_directories(${GE_SOURCE_DIR}/inc)
  72. include_directories(${GE_SOURCE_DIR}/inc/common/util)
  73. include_directories(${GE_SOURCE_DIR}/inc/external)
  74. include_directories(${GE_SOURCE_DIR}/inc/framework)
  75. include_directories(${GE_SOURCE_DIR}/metadef/inc)
  76. include_directories(${GE_SOURCE_DIR}/metadef/inc/external)
  77. include_directories(${GE_SOURCE_DIR}/metadef/inc/external/graph)
  78. include_directories(${GE_SOURCE_DIR}/metadef/inc/graph)
  79. include_directories(${GE_SOURCE_DIR}/third_party/fwkacllib/inc)
  80. include_directories(${GE_SOURCE_DIR}/third_party/fwkacllib/inc/cce)
  81. include_directories(${CMAKE_BINARY_DIR})
  82. include_directories(${CMAKE_BINARY_DIR}/proto/ge)
  83. ############ libge_common.so ################
  84. add_library(ge_common SHARED ${SRC_LIST} ${PROTO_HDRS})
  85. target_compile_definitions(ge_common PUBLIC
  86. PROTOBUF_INLINE_NOT_IN_HEADERS=0
  87. HOST_VISIBILITY
  88. OS_CENTOS)
  89. target_link_libraries(ge_common
  90. graph
  91. ${PROTOBUF_LIBRARY}
  92. ${register}
  93. ${c_sec}
  94. ${slog}
  95. ${mmpa}
  96. ${resource}
  97. ${error_manager}
  98. rt
  99. dl)

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