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_reporter.h 1.9 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (c) Huawei Technologies Co., Ltd. 2019-2021. All rights reserved.
  3. * Description: handle perf data
  4. * Author: xp
  5. * Create: 2019-10-13
  6. */
  7. #ifndef MSPROF_ENGINE_PROF_REPORTER_H
  8. #define MSPROF_ENGINE_PROF_REPORTER_H
  9. #if (defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER))
  10. #define MSVP_PROF_API __declspec(dllexport)
  11. #else
  12. #define MSVP_PROF_API __attribute__((visibility("default")))
  13. #endif
  14. #include "prof_callback.h"
  15. /**
  16. * @file prof_reporter.h
  17. * @defgroup reporter the reporter group
  18. * This is the reporter group
  19. */
  20. namespace Msprof {
  21. namespace Engine {
  22. /**
  23. * @ingroup reporter
  24. * @brief class Reporter
  25. * the Reporter class .used to send data to profiling
  26. */
  27. class MSVP_PROF_API Reporter {
  28. public:
  29. virtual ~Reporter() {}
  30. public:
  31. /**
  32. * @ingroup reporter
  33. * @name : Report
  34. * @brief : API of libmsprof, report data to libmsprof, it's a non-blocking function \n
  35. The data will be firstly appended to cache, if the cache is full, data will be ignored
  36. * @param data [IN] const ReporterData * the data send to libmsporf
  37. * @retval PROFILING_SUCCESS 0 (success)
  38. * @retval PROFILING_FAILED -1 (failed)
  39. *
  40. * @par depend:
  41. * @li libmsprof
  42. * @li prof_reporter.h
  43. * @since c60
  44. * @see Flush
  45. */
  46. virtual int Report(const ReporterData *data) = 0;
  47. /**
  48. * @ingroup reporter
  49. * @name : Flush
  50. * @brief : API of libmsprof, notify libmsprof send data over, it's a blocking function \n
  51. The all datas of cache will be write to file or send to host
  52. * @retval PROFILING_SUCCESS 0 (success)
  53. * @retval PROFILING_FAILED -1 (failed)
  54. *
  55. * @par depend:
  56. * @li libmsprof
  57. * @li prof_reporter.h
  58. * @since c60
  59. * @see ProfMgrStop
  60. */
  61. virtual int Flush() = 0;
  62. virtual uint32_t GetReportDataMaxLen() = 0;
  63. };
  64. } // namespace Engine
  65. } // namespace Msprof
  66. #endif // MSPROF_ENGINE_PROF_REPORTER_H

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