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.

prof_acl_api.h 3.7 kB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 MSPROFILER_API_PROF_ACL_API_H_
  17. #define MSPROFILER_API_PROF_ACL_API_H_
  18. // DataTypeConfig
  19. #define PROF_ACL_API 0x00000001
  20. #define PROF_TASK_TIME 0x00000002
  21. #define PROF_AICORE_METRICS 0x00000004
  22. #define PROF_AICPU_TRACE 0x00000008
  23. #define PROF_MODEL_EXECUTE 0x00000010
  24. #define PROF_RUNTIME_API 0x00000020
  25. #define PROF_RUNTIME_TRACE 0x00000040
  26. #define PROF_SCHEDULE_TIMELINE 0x00000080
  27. #define PROF_SCHEDULE_TRACE 0x00000100
  28. #define PROF_AIVECTORCORE_METRICS 0x00000200
  29. #define PROF_SUBTASK_TIME 0x00000400
  30. #define PROF_TRAINING_TRACE 0x00000800
  31. #define PROF_HCCL_TRACE 0x00001000
  32. #define PROF_TASK_TRACE 0x00001852
  33. // system profilinig switch
  34. #define PROF_CPU 0x00010000
  35. #define PROF_HARDWARE_MEMORY 0x00020000
  36. #define PROF_IO 0x00040000
  37. #define PROF_INTER_CONNECTION 0x00080000
  38. #define PROF_DVPP 0x00100000
  39. #define PROF_SYS_AICORE_SAMPLE 0x00200000
  40. #define PROF_AIVECTORCORE_SAMPLE 0x00400000
  41. #define PROF_MODEL_LOAD 0x8000000000000000
  42. // DataTypeConfig MASK
  43. #define PROF_ACL_API_MASK 0x00000001
  44. #define PROF_TASK_TIME_MASK 0x00000002
  45. #define PROF_AICORE_METRICS_MASK 0x00000004
  46. #define PROF_AICPU_TRACE_MASK 0x00000008
  47. #define PROF_MODEL_EXECUTE_MASK 0x00000010
  48. #define PROF_RUNTIME_API_MASK 0x00000020
  49. #define PROF_RUNTIME_TRACE_MASK 0x00000040
  50. #define PROF_SCHEDULE_TIMELINE_MASK 0x00000080
  51. #define PROF_SCHEDULE_TRACE_MASK 0x00000100
  52. #define PROF_AIVECTORCORE_METRICS_MASK 0x00000200
  53. #define PROF_SUBTASK_TIME_MASK 0x00000400
  54. #define PROF_TRAINING_TRACE_MASK 0x00000800
  55. #define PROF_HCCL_TRACE_MASK 0x00001000
  56. // system profilinig mask
  57. #define PROF_CPU_MASK 0x00010000
  58. #define PROF_HARDWARE_MEMORY_MASK 0x00020000
  59. #define PROF_IO_MASK 0x00040000
  60. #define PROF_INTER_CONNECTION_MASK 0x00080000
  61. #define PROF_DVPP_MASK 0x00100000
  62. #define PROF_SYS_AICORE_SAMPLE_MASK 0x00200000
  63. #define PROF_AIVECTORCORE_SAMPLE_MASK 0x00400000
  64. #define PROF_MODEL_LOAD_MASK 0x8000000000000000
  65. #ifndef OS_TYPE
  66. #define OS_TYPE 0
  67. #endif // OS_TYPE
  68. #if (OS_TYPE != LINUX)
  69. #define MSVP_PROF_API __declspec(dllexport)
  70. #else
  71. #define MSVP_PROF_API __attribute__((visibility("default")))
  72. #endif
  73. #include <cstdint>
  74. namespace Msprofiler {
  75. namespace Api {
  76. /**
  77. * @name ProfGetOpExecutionTime
  78. * @brief get op execution time of specific part of data
  79. * @param data [IN] data read from pipe
  80. * @param len [IN] data length
  81. * @param index [IN] index of part(op)
  82. * @return op execution time (us)
  83. */
  84. MSVP_PROF_API uint64_t ProfGetOpExecutionTime(const void *data, uint32_t len, uint32_t index);
  85. }
  86. }
  87. #ifdef __cplusplus
  88. extern "C" {
  89. #endif
  90. MSVP_PROF_API uint64_t ProfGetOpExecutionTime(const void *data, uint32_t len, uint32_t index);
  91. #ifdef __cplusplus
  92. }
  93. #endif
  94. #endif // MSPROFILER_API_PROF_ACL_API_H_

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