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.

acl_op.h 21 kB

3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. /**
  2. * Copyright 2019-2022 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 INC_EXTERNAL_ACL_ACL_OP_H_
  17. #define INC_EXTERNAL_ACL_ACL_OP_H_
  18. #include "acl_base.h"
  19. #include "acl_rt.h"
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. typedef struct aclopHandle aclopHandle;
  24. typedef struct aclopAttr aclopAttr;
  25. typedef struct aclopKernelDesc aclopKernelDesc;
  26. typedef void (*aclDataDeallocator)(void *data, size_t length);
  27. static const int ACL_COMPILE_FLAG_BIN_SELECTOR = 1;
  28. typedef enum aclEngineType {
  29. ACL_ENGINE_SYS,
  30. ACL_ENGINE_AICORE,
  31. ACL_ENGINE_VECTOR,
  32. } aclopEngineType;
  33. /**
  34. * @ingroup AscendCL
  35. * @brief Set base directory that contains single op models
  36. *
  37. * @par Restriction
  38. * The aclopSetModelDir interface can be called only once in a process.
  39. * @param modelDir [IN] path of the directory
  40. *
  41. * @retval ACL_SUCCESS The function is successfully executed.
  42. * @retval OtherValues Failure
  43. */
  44. ACL_FUNC_VISIBILITY aclError aclopSetModelDir(const char *modelDir);
  45. /**
  46. * @ingroup AscendCL
  47. * @brief load single op models from memory
  48. *
  49. * @par Restriction
  50. * The aclopLoad interface can be called more than one times in a process.
  51. * @param model [IN] address of single op models
  52. * @param modelSize [IN] size of single op models
  53. *
  54. * @retval ACL_SUCCESS The function is successfully executed.
  55. * @retval OtherValues Failure
  56. */
  57. ACL_FUNC_VISIBILITY aclError aclopLoad(const void *model, size_t modelSize);
  58. /**
  59. * @ingroup AscendCL
  60. * @brief create data of type aclopAttr
  61. *
  62. * @retval pointer to created instance.
  63. * @retval nullptr if run out of memory
  64. */
  65. ACL_FUNC_VISIBILITY aclopAttr *aclopCreateAttr();
  66. /**
  67. * @ingroup AscendCL
  68. * @brief destroy data of typ aclopAttr
  69. *
  70. * @param attr [IN] pointer to the instance of aclopAttr
  71. */
  72. ACL_FUNC_VISIBILITY void aclopDestroyAttr(const aclopAttr *attr);
  73. /**
  74. * @ingroup AscendCL
  75. * @brief set an attribute. the type of the attribute is bool
  76. *
  77. * @param attr [OUT] pointer to the instance of aclopAttr
  78. * @param attrName [IN] attribute name
  79. * @param attrValue [IN] attribute value
  80. * false if attrValue is 0, true otherwise.
  81. *
  82. * @retval ACL_SUCCESS The function is successfully executed.
  83. * @retval OtherValues Failure
  84. */
  85. ACL_FUNC_VISIBILITY aclError aclopSetAttrBool(aclopAttr *attr, const char *attrName, uint8_t attrValue);
  86. /**
  87. * @ingroup AscendCL
  88. * @brief set an attribute. the type of the attribute is int64_t
  89. *
  90. * @param attr [OUT] pointer to the instance of aclopAttr
  91. * @param attrName [IN] attribute name
  92. * @param attrValue [IN] attribute value
  93. *
  94. * @retval ACL_SUCCESS The function is successfully executed.
  95. * @retval OtherValues Failure
  96. */
  97. ACL_FUNC_VISIBILITY aclError aclopSetAttrInt(aclopAttr *attr, const char *attrName, int64_t attrValue);
  98. /**
  99. * @ingroup AscendCL
  100. * @brief set an attribute. the type of the attribute is float
  101. *
  102. * @param attr [OUT] pointer to the instance of aclopAttr
  103. * @param attrName [IN] attribute name
  104. * @param attrValue [IN] attribute value
  105. *
  106. * @retval ACL_SUCCESS The function is successfully executed.
  107. * @retval OtherValues Failure
  108. */
  109. ACL_FUNC_VISIBILITY aclError aclopSetAttrFloat(aclopAttr *attr, const char *attrName, float attrValue);
  110. /**
  111. * @ingroup AscendCL
  112. * @brief set an attribute. the type of the attribute is string
  113. *
  114. * @param attr [OUT] pointer to the instance of aclopAttr
  115. * @param attrName [IN] attribute name
  116. * @param attrValue [IN] attribute value
  117. *
  118. * @retval ACL_SUCCESS The function is successfully executed.
  119. * @retval OtherValues Failure
  120. */
  121. ACL_FUNC_VISIBILITY aclError aclopSetAttrString(aclopAttr *attr, const char *attrName, const char *attrValue);
  122. /**
  123. * @ingroup AscendCL
  124. * @brief set an attribute. the type of the attribute is aclDataType
  125. *
  126. * @param attr [OUT] pointer to the instance of aclopAttr
  127. * @param attrName [IN] attribute name
  128. * @param attrValue [IN] attribute value
  129. *
  130. * @retval ACL_SUCCESS The function is successfully executed.
  131. * @retval OtherValues Failure
  132. */
  133. ACL_FUNC_VISIBILITY aclError aclopSetAttrDataType(aclopAttr *attr, const char *attrName, aclDataType attrValue);
  134. /**
  135. * @ingroup AscendCL
  136. * @brief set an attribute. the type of the attribute is list of aclDataType
  137. *
  138. * @param attr [OUT] pointer to the instance of aclopAttr
  139. * @param attrName [IN] attribute name
  140. * @param numValues [IN] number of values. false if attrValue is 0, true otherwise.
  141. * @param values [IN] pointer to values
  142. *
  143. * @retval ACL_SUCCESS The function is successfully executed.
  144. * @retval OtherValues Failure
  145. */
  146. ACL_FUNC_VISIBILITY aclError aclopSetAttrListDataType(aclopAttr *attr, const char *attrName, int numValues,
  147. const aclDataType values[]);
  148. /**
  149. * @ingroup AscendCL
  150. * @brief set an attribute. the type of the attribute is list of bools
  151. *
  152. * @param attr [OUT] pointer to the instance of aclopAttr
  153. * @param attrName [IN] attribute name
  154. * @param numValues [IN] number of values. false if attrValue is 0, true otherwise.
  155. * @param values [IN] pointer to values
  156. *
  157. * @retval ACL_SUCCESS The function is successfully executed.
  158. * @retval OtherValues Failure
  159. */
  160. ACL_FUNC_VISIBILITY aclError aclopSetAttrListBool(aclopAttr *attr, const char *attrName, int numValues,
  161. const uint8_t *values);
  162. /**
  163. * @ingroup AscendCL
  164. * @brief set an attribute. the type of the attribute is list of ints
  165. *
  166. * @param attr [OUT] pointer to the instance of aclopAttr
  167. * @param attrName [IN] attribute name
  168. * @param numValues [IN] number of values
  169. * @param values [IN] pointer to values
  170. *
  171. * @retval ACL_SUCCESS The function is successfully executed.
  172. * @retval OtherValues Failure
  173. */
  174. ACL_FUNC_VISIBILITY aclError aclopSetAttrListInt(aclopAttr *attr, const char *attrName, int numValues,
  175. const int64_t *values);
  176. /**
  177. * @ingroup AscendCL
  178. * @brief set an attribute. the type of the attribute is list of floats
  179. *
  180. * @param attr [OUT] pointer to the instance of aclopAttr
  181. * @param attrName [IN] attribute name
  182. * @param numValues [IN] number of values
  183. * @param values [IN] pointer to values
  184. *
  185. * @retval ACL_SUCCESS The function is successfully executed.
  186. * @retval OtherValues Failure
  187. */
  188. ACL_FUNC_VISIBILITY aclError aclopSetAttrListFloat(aclopAttr *attr, const char *attrName, int numValues,
  189. const float *values);
  190. /**
  191. * @ingroup AscendCL
  192. * @brief set an attribute. the type of the attribute is list of strings
  193. *
  194. * @param attr [OUT] pointer to the instance of aclopAttr
  195. * @param attrName [IN] attribute name
  196. * @param numValues [IN] number of values
  197. * @param values [IN] pointer to values
  198. *
  199. * @retval ACL_SUCCESS The function is successfully executed.
  200. * @retval OtherValues Failure
  201. */
  202. ACL_FUNC_VISIBILITY aclError aclopSetAttrListString(aclopAttr *attr, const char *attrName, int numValues,
  203. const char **values);
  204. /**
  205. * @ingroup AscendCL
  206. * @brief set an attribute. the type of the attribute is list of list of ints
  207. *
  208. * @param attr [OUT] pointer to the instance of aclopAttr
  209. * @param attrName [IN] attribute name
  210. * @param numLists [IN] number of lists
  211. * @param numValues [IN] pointer to number of values of each list
  212. * @param values [IN] pointer to values
  213. *
  214. * @retval ACL_SUCCESS The function is successfully executed.
  215. * @retval OtherValues Failure
  216. */
  217. ACL_FUNC_VISIBILITY aclError aclopSetAttrListListInt(aclopAttr *attr, const char *attrName, int numLists,
  218. const int *numValues, const int64_t *const values[]);
  219. /**
  220. * @ingroup AscendCL
  221. * @brief Load and execute the specified operator asynchronously
  222. *
  223. * @par Restriction
  224. * @li The input and output organization of each operator is different,
  225. * and the application needs to organize the operator strictly
  226. * according to the operator input and output parameters when calling.
  227. * @li When the user calls aclopExecute,
  228. * the ACL finds the corresponding task according to the optype,
  229. * the description of the input tesnsor,
  230. * the description of the output tesnsor, and attr, and issues the execution.
  231. *
  232. * @param opType [IN] type of op
  233. * @param numInputs [IN] number of inputs
  234. * @param inputDesc [IN] pointer to array of input tensor descriptions
  235. * @param inputs [IN] pointer to array of input buffers
  236. * @param numOutputs [IN] number of outputs
  237. * @param outputDesc [IN] pointer to array of output tensor descriptions
  238. * @param outputs [OUT] pointer to array of output buffers
  239. * @param attr [IN] pointer to instance of aclopAttr.
  240. * may pass nullptr if the op has no attribute
  241. * @param stream [IN] stream
  242. *
  243. * @retval ACL_SUCCESS The function is successfully executed.
  244. * @retval OtherValues Failure
  245. */
  246. ACL_DEPRECATED_MESSAGE("aclopExecute is deprecated, use aclopExecuteV2 instead")
  247. ACL_FUNC_VISIBILITY aclError aclopExecute(const char *opType, int numInputs, const aclTensorDesc *const inputDesc[],
  248. const aclDataBuffer *const inputs[], int numOutputs,
  249. const aclTensorDesc *const outputDesc[], aclDataBuffer *const outputs[],
  250. const aclopAttr *attr, aclrtStream stream);
  251. /**
  252. * @ingroup AscendCL
  253. * @brief Load and execute the specified operator
  254. * The difference with aclopExecute is that aclopExecuteV2 will refresh outputDesc
  255. *
  256. * @par Restriction
  257. * @li The input and output organization of each operator is different,
  258. * and the application needs to organize the operator strictly
  259. * according to the operator input and output parameters when calling.
  260. * @li When the user calls aclopExecuteV2,
  261. * the ACL finds the corresponding task according to the optype,
  262. * the description of the input tesnsor,
  263. * the description of the output tesnsor, and attr, and issues the execution.
  264. *
  265. * @param opType [IN] type of op
  266. * @param numInputs [IN] number of inputs
  267. * @param inputDesc [IN] pointer to array of input tensor descriptions
  268. * @param inputs [IN] pointer to array of input buffers
  269. * @param numOutputs [IN] number of outputs
  270. * @param outputDesc [IN|OUT] pointer to array of output tensor descriptions
  271. * @param outputs [OUT] pointer to array of output buffers
  272. * @param attr [IN] pointer to instance of aclopAttr.
  273. * may pass nullptr if the op has no attribute
  274. * @param stream [IN] stream
  275. *
  276. * @retval ACL_SUCCESS The function is successfully executed.
  277. * @retval OtherValues Failure
  278. */
  279. ACL_FUNC_VISIBILITY aclError aclopExecuteV2(const char *opType, int numInputs, aclTensorDesc *inputDesc[],
  280. aclDataBuffer *inputs[], int numOutputs, aclTensorDesc *outputDesc[],
  281. aclDataBuffer *outputs[], aclopAttr *attr, aclrtStream stream);
  282. /**
  283. * @ingroup AscendCL
  284. * @brief create a instance of aclopHandle.
  285. *
  286. * @param opType [IN] type of op
  287. * @param numInputs [IN] number of inputs
  288. * @param inputDesc [IN] pointer to array of input tensor descriptions
  289. * @param numOutputs [IN] number of outputs
  290. * @param outputDesc [IN] pointer to array of output tensor descriptions
  291. * @param opAttr [IN] pointer to instance of aclopAttr.
  292. * may pass nullptr if the op has no attribute
  293. * @param handle [OUT] pointer to the pointer to the handle
  294. *
  295. * @retval ACL_SUCCESS The function is successfully executed.
  296. * @retval OtherValues Failure
  297. */
  298. ACL_FUNC_VISIBILITY aclError aclopCreateHandle(const char *opType, int numInputs,
  299. const aclTensorDesc *const inputDesc[], int numOutputs,
  300. const aclTensorDesc *const outputDesc[], const aclopAttr *opAttr,
  301. aclopHandle **handle);
  302. /**
  303. * @ingroup AscendCL
  304. * @brief destroy aclopHandle instance
  305. *
  306. * @param handle [IN] pointer to the instance of aclopHandle
  307. */
  308. ACL_FUNC_VISIBILITY void aclopDestroyHandle(aclopHandle *handle);
  309. /**
  310. * @ingroup AscendCL
  311. * @brief execute an op with the handle.
  312. * can save op model matching cost compared with aclopExecute
  313. *
  314. * @param handle [IN] pointer to the instance of aclopHandle.
  315. * The aclopCreateHandle interface has been called
  316. * in advance to create aclopHandle type data.
  317. * @param numInputs [IN] number of inputs
  318. * @param inputs [IN] pointer to array of input buffers.
  319. * The aclCreateDataBuffer interface has been called
  320. * in advance to create aclDataBuffer type data.
  321. * @param numOutputs [IN] number of outputs
  322. * @param outputs [OUT] pointer to array of output buffers
  323. * @param stream [IN] stream
  324. *
  325. * @retval ACL_SUCCESS The function is successfully executed.
  326. * @retval OtherValues Failure
  327. *
  328. * @see aclopCreateHandle | aclCreateDataBuffer
  329. */
  330. ACL_FUNC_VISIBILITY aclError aclopExecWithHandle(aclopHandle *handle, int numInputs,
  331. const aclDataBuffer *const inputs[], int numOutputs,
  332. aclDataBuffer *const outputs[], aclrtStream stream);
  333. /**
  334. * @ingroup AscendCL
  335. * @brief cast data type
  336. *
  337. * @param srcDesc [IN] source tensor desc
  338. * @param srcBuffer [IN] source tensor buffer
  339. * @param dstDesc [IN] destination tensor desc
  340. * @param dstBuffer [OUT] destination tensor buffer
  341. * @param truncate [IN] do not truncate if value is 0, truncate otherwise
  342. * @param stream [IN] stream
  343. *
  344. * @retval ACL_SUCCESS The function is successfully executed.
  345. * @retval OtherValues Failure
  346. */
  347. ACL_FUNC_VISIBILITY aclError aclopCast(const aclTensorDesc *srcDesc, const aclDataBuffer *srcBuffer,
  348. const aclTensorDesc *dstDesc, aclDataBuffer *dstBuffer, uint8_t truncate,
  349. aclrtStream stream);
  350. /**
  351. * @ingroup AscendCL
  352. * @brief create a handle for casting datatype
  353. *
  354. * @param srcDesc [IN] source tensor desc
  355. * @param dstDesc [IN] destination tensor desc
  356. * @param truncate [IN] do not truncate if value is 0, truncate otherwise
  357. * @param handle [OUT] pointer to the pointer to the handle
  358. *
  359. * @retval ACL_SUCCESS The function is successfully executed.
  360. * @retval OtherValues Failure
  361. */
  362. ACL_FUNC_VISIBILITY aclError aclopCreateHandleForCast(aclTensorDesc *srcDesc, aclTensorDesc *dstDesc, uint8_t truncate,
  363. aclopHandle **handle);
  364. /**
  365. * @ingroup AscendCL
  366. * @brief create kernel
  367. *
  368. * @param opType [IN] op type
  369. * @param kernelId [IN] kernel id
  370. * @param kernelName [IN] kernel name
  371. * @param binData [IN] kernel bin data
  372. * @param binSize [IN] kernel bin size
  373. * @param enginetype [IN] enigne type
  374. * @param deallocator [IN] callback function for deallocating bin data,
  375. * null if bin data to be deallocated by caller
  376. *
  377. * @retval ACL_SUCCESS The function is successfully executed.
  378. * @retval OtherValues Failure
  379. *
  380. * @see aclopCompile
  381. */
  382. ACL_FUNC_VISIBILITY aclError aclopCreateKernel(const char *opType, const char *kernelId, const char *kernelName,
  383. void *binData, int binSize, aclopEngineType enginetype,
  384. aclDataDeallocator deallocator);
  385. /**
  386. * @ingroup AscendCL
  387. * @brief create kernel
  388. *
  389. * @param numInputs [IN] number of inputs
  390. * @param inputDesc [IN] pointer to array of input tensor descriptions
  391. * @param numOutputs [IN] number of outputs
  392. * @param outputDesc [IN] pointer to array of output tensor descriptions
  393. * @param opAttr [IN] pointer to instance of aclopAttr
  394. * @param aclopKernelDesc [IN] pointer to instance of aclopKernelDesc
  395. *
  396. * @retval ACL_SUCCESS The function is successfully executed.
  397. * @retval OtherValues Failure
  398. */
  399. typedef aclError (*aclopCompileFunc)(int numInputs, const aclTensorDesc *const inputDesc[], int numOutputs,
  400. const aclTensorDesc *const outputDesc[], const aclopAttr *opAttr,
  401. aclopKernelDesc *aclopKernelDesc);
  402. /**
  403. * @ingroup AscendCL
  404. * @brief register compile function
  405. *
  406. * @param opType [IN] op type
  407. * @param func [IN] compile function
  408. *
  409. * @retval ACL_SUCCESS The function is successfully executed.
  410. * @retval OtherValues Failure
  411. *
  412. * @see aclopUnregisterCompileFunc
  413. */
  414. ACL_FUNC_VISIBILITY aclError aclopRegisterCompileFunc(const char *opType, aclopCompileFunc func);
  415. /**
  416. * @ingroup AscendCL
  417. * @brief unregister compile function
  418. *
  419. * @param opType [IN] op type
  420. *
  421. * @retval ACL_SUCCESS The function is successfully executed.
  422. * @retval OtherValues Failure
  423. */
  424. ACL_FUNC_VISIBILITY aclError aclopUnregisterCompileFunc(const char *opType);
  425. /**
  426. * @ingroup AscendCL
  427. * @brief set kernel args
  428. *
  429. * @param kernelDesc [IN] pointer to instance of aclopKernelDesc
  430. * @param kernelId [IN] kernel id
  431. * @param blockDim [IN] block dim
  432. * @param args [IN] args
  433. * @param argSize [IN] size in bytes of args
  434. *
  435. * @retval ACL_SUCCESS The function is successfully executed.
  436. * @retval OtherValues Failure
  437. */
  438. ACL_FUNC_VISIBILITY aclError aclopSetKernelArgs(aclopKernelDesc *kernelDesc, const char *kernelId, uint32_t blockDim,
  439. const void *args, uint32_t argSize);
  440. /**
  441. * @ingroup AscendCL
  442. * @brief set workspace sizes
  443. *
  444. * @param kernelDesc [IN] pointer to instance of aclopKernelDesc
  445. * @param numWorkspaces [IN] number of workspaces
  446. * @param workspaceSizes [IN] pointer to array of sizes of workspaces
  447. *
  448. * @retval ACL_SUCCESS The function is successfully executed.
  449. * @retval OtherValues Failure
  450. */
  451. ACL_FUNC_VISIBILITY aclError aclopSetKernelWorkspaceSizes(aclopKernelDesc *kernelDesc, int numWorkspaces,
  452. size_t *workspaceSizes);
  453. /**
  454. * @ingroup AscendCL
  455. * @brief compile op with dynamic shape
  456. *
  457. * @param opType [IN] op type
  458. * @param numInputs [IN] number of inputs
  459. * @param inputDesc [IN] pointer to array of input tensor descriptions
  460. * @param numOutputs [IN] number of outputs
  461. * @param outputDesc [IN] pointer to array of output tensor descriptions
  462. * @param attr [IN] pointer to instance of aclopAttr.
  463. * may pass nullptr if the op has no attribute
  464. *
  465. * @retval ACL_SUCCESS The function is successfully executed.
  466. * @retval OtherValues Failure
  467. */
  468. ACL_FUNC_VISIBILITY aclError aclopUpdateParams(const char *opType, int numInputs,
  469. const aclTensorDesc *const inputDesc[], int numOutputs,
  470. const aclTensorDesc *const outputDesc[], const aclopAttr *attr);
  471. /**
  472. * @ingroup AscendCL
  473. * @brief inferShape the specified operator synchronously
  474. *
  475. * @param opType [IN] type of op
  476. * @param numInputs [IN] number of inputs
  477. * @param inputDesc [IN] pointer to array of input tensor descriptions
  478. * @param inputs [IN] pointer to array of input buffers
  479. * @param numOutputs [IN] number of outputs
  480. * @param outputDesc [OUT] pointer to array of output tensor descriptions
  481. * @param attr [IN] pointer to instance of aclopAttr.
  482. * may pass nullptr if the op has no attribute
  483. *
  484. * @retval ACL_SUCCESS The function is successfully executed.
  485. * @retval OtherValues Failure
  486. */
  487. ACL_FUNC_VISIBILITY aclError aclopInferShape(const char *opType, int numInputs, aclTensorDesc *inputDesc[],
  488. aclDataBuffer *inputs[], int numOutputs, aclTensorDesc *outputDesc[],
  489. aclopAttr *attr);
  490. #ifdef __cplusplus
  491. }
  492. #endif
  493. #endif // INC_EXTERNAL_ACL_ACL_OP_H_

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