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.

data_common.h 2.4 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /**
  2. * @file data_common.h
  3. *
  4. * Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
  5. *
  6. * This program is used to data structure
  7. */
  8. #ifndef HOST_INNER_INC_DATA_COMMON_H_
  9. #define HOST_INNER_INC_DATA_COMMON_H_
  10. #include <string>
  11. namespace tdt {
  12. #ifndef TDT_DATA_TYPE
  13. #define TDT_DATA_TYPE
  14. /**
  15. * @ingroup Tdt data.
  16. *
  17. * Tdt data type.
  18. */
  19. enum TdtDataType {
  20. TDT_IMAGE_LABEL = 0, /**< Image label*/
  21. TDT_TFRECORD, /**< TF Record*/
  22. TDT_DATA_LABEL, /**< Data label*/
  23. TDT_END_OF_SEQUENCE, /**< End of Sequence*/
  24. TDT_TENSOR, /**< Tensor*/
  25. TDT_ABNORMAL, /**< ABNORMAL*/
  26. TDT_DATATYPE_MAX /**< Max*/
  27. };
  28. #endif
  29. /**
  30. * @ingroup Tdt data.
  31. *
  32. * Tdt push data between host and device.
  33. */
  34. struct TdtDataItem {
  35. TdtDataType dataType_; /**< Input data type*/
  36. uint64_t label_; /**< Input data label*/
  37. uint64_t dataLen_; /**< Input data type length*/
  38. uint64_t realDataLen_; /**< Real Input data type length*/
  39. std::string tensorShape_; /**< Tensor shape*/
  40. std::string tensorType_; /**< Tensor type*/
  41. uint32_t cnt_; /**< Data count*/
  42. uint32_t currentCnt_; /**< Data current count*/
  43. uint64_t index_; /**< Data inde*/
  44. std::string tensorName_; /**< Tensor name*/
  45. uint64_t md5ValueHead_; /**< Data md5*/
  46. uint64_t md5ValueTail_; /**< Data md5*/
  47. std::shared_ptr<void> dataPtr_; /**< Data pointer*/
  48. std::string headMD5_; /**< MD5 header, 8byte*/
  49. std::string tailMD5_; /**< MD5 tail, 8byte*/
  50. };
  51. /**
  52. * @ingroup Tdt data.
  53. *
  54. * Tdt push data for queuedataset ort mind-data.
  55. */
  56. struct DataItem {
  57. TdtDataType dataType_; /**< Input data type*/
  58. std::string tensorName_; /**< Tensor name*/
  59. std::string tensorShape_; /**< Tensor shape*/
  60. std::string tensorType_; /**< Tensor type*/
  61. uint64_t dataLen_; /**< Input data type length*/
  62. std::shared_ptr<void> dataPtr_; /**< Data pointer*/
  63. };
  64. /**
  65. * @ingroup Tsdclient.
  66. *
  67. * tsdclient func type;
  68. */
  69. enum TsdCmdType {
  70. TSDCLOSE = 0,
  71. TSDOPEN = 1
  72. };
  73. /**
  74. * @ingroup Tsdclient.
  75. *
  76. * tsdclient func input value object.
  77. */
  78. enum InputItem {
  79. OPEN_DEVICEID = 0,
  80. OPEN_RANKSIZE,
  81. CLOSE_DEVICEID
  82. };
  83. } // namespace tdt
  84. #endif // HOST_INNER_INC_DATA_COMMON_H_

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