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.

tsd_client.h 3.7 kB

5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /**
  2. * Copyright 2019-2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef TDT_HOST_INNER_INC_TSD_CLIENT_H_
  17. #define TDT_HOST_INNER_INC_TSD_CLIENT_H_
  18. #include <condition_variable>
  19. #include <map>
  20. #include <memory>
  21. #include <mutex>
  22. #include "tdt/status.h"
  23. #include "tdt/data_common.h"
  24. #include "toolchain/prof_callback.h"
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif // __cplusplus
  28. /**
  29. * @ingroup Open
  30. * @brief Used for the Framework process to communicate with the TSDDaemon process,
  31. * and notify TSD to complete the initialization of other processes
  32. *
  33. * @par Function
  34. * Used for the Framework process to communicate with the TSDDaemon process,
  35. * and notify TSD to complete the initialization of other processes
  36. *
  37. * @param logicDeviceId [IN] type #unsigned int. Logic device ID
  38. * @param rankSize [IN] type #unsigned int. The rankSize of the training.
  39. * The default value is 1. When rankSize is greater than 1,
  40. * HCCP will be pulled to perform set communication related operations.
  41. * @retval TDT_OK Success
  42. * @retval OtherValues Failure
  43. *
  44. * @par Dependency
  45. * @li libtsdclient.so: Library to which the interface belongs.
  46. * @li tsd_client.h: Header file where the interface declaration is located.
  47. * @li data_common.h: Header file where 'TDT_StatusT' defined
  48. */
  49. TDT_LIB_EXPORT TDT_StatusT TsdOpen(const uint32_t logicDeviceId, const uint32_t rankSize);
  50. /**
  51. * @ingroup Close
  52. * @brief notify TSDClient close resource
  53. *
  54. * @par Function
  55. * notify TSDClient close resource
  56. *
  57. * @param NA
  58. * @retval TDT_OK Success
  59. * @retval OtherValues Failure
  60. *
  61. * @par Dependency
  62. * @li libtsdclient.so: Library to which the interface belongs.
  63. * @li tsd_client.h: Header file where the interface declaration is located.
  64. * @li data_common.h: Header file where 'TDT_StatusT' defined
  65. */
  66. TDT_LIB_EXPORT TDT_StatusT TsdClose(const uint32_t logicDeviceId);
  67. /**
  68. * @ingroup UpdateProfilingMode
  69. * @brief notify TSDClient update profiling mode
  70. *
  71. * @par Function
  72. * notify TSDClient update profiling mode
  73. *
  74. * @param NA
  75. * @retval TDT_OK Success
  76. * @retval OtherValues Failure
  77. *
  78. * @par Dependency
  79. * @li libtsdclient.so: Library to which the interface belongs.
  80. * @li tsd_client.h: Header file where the interface declaration is located.
  81. * @li data_common.h: Header file where 'TDT_StatusT' defined
  82. */
  83. TDT_LIB_EXPORT TDT_StatusT UpdateProfilingMode(const uint32_t logicDeviceId, const uint32_t flag);
  84. /**
  85. * @ingroup TsdSetMsprofReporterCallback
  86. * @brief 用于推理场景下设置aicpu的profilng的callback函数
  87. *
  88. * @par Function
  89. * 设置offline模式下aicpu_sd进程的profiling的callback函数
  90. *
  91. * @param callback [IN] type #MsprofReporterCallback. 回调函数
  92. * @retval TDT_OK Success
  93. * @retval OtherValues Failure
  94. *
  95. * @par Dependency
  96. * @li libtsdclient.so: Library to which the interface belongs.
  97. * @li tsd_client.h: Header file where the interface declaration is located.
  98. * @li data_common.h: Header file where 'TDT_StatusT' defined
  99. * @li prof_callback.h: Headerfile where 'MsprofReporterCallback' defined
  100. */
  101. TDT_LIB_EXPORT TDT_StatusT TsdSetMsprofReporterCallback(MsprofReporterCallback callback);
  102. #ifdef __cplusplus
  103. }
  104. #endif // __cplusplus
  105. #endif // TDT_HOST_INNER_INC_TSD_CLIENT_H_

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