aclprofCreateConfig

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Description

Creates data of the aclprofConfig type as a Profiling configuration.

Created aclProfConfig data can be reused in multiple calls. You need to ensure the consistency and accuracy of the data.

To destroy data of the aclprofConfig type, call aclprofDestroyConfig.

Restrictions

  • Use the aclprofDestroyConfig API to destroy data of the aclprofConfig type. If data is not destroyed, the memory cannot be freed.
  • Use this API together with the aclprofDestroyConfig API. Call aclprofCreateConfig first and then aclprofDestroyConfig.

Prototype

1
aclprofConfig *aclprofCreateConfig(uint32_t *deviceIdList, uint32_t deviceNums, aclprofAicoreMetrics aicoreMetrics, const aclprofAicoreEvents *aicoreEvents, uint64_t dataTypeConfig)

Parameters

Parameter

Input/Output

Description

deviceIdList

Input

Device ID list. Set this parameter based on the actual device ID.

For details about the type definition, see aclprofConfig and aclprofAicoreMetrics.

deviceNums

Input

Device count. Ensure that the number of devices in deviceIdList matches deviceNums. Otherwise, service exceptions may occur subsequently.

aicoreMetrics

Input

AI Core metric to profile. For details, see aclprofAicoreMetrics.

aicoreEvents

Input

AI Core event, which is set to NULL.

dataTypeConfig

Input

Logical OR result of macros from the following list (for example, ACL_PROF_ACL_API | ACL_PROF_AICORE_METRICS). Each macro corresponds to a specific metric.

  • ACL_PROF_ACL_API: collects profile data of APIs, including the synchronous/asynchronous memory copy latencies between the host and devices and between devices.
  • ACL_PROF_TASK_TIME: collects operator delivery and execution duration data, as well as basic operator information, to provide more comprehensive profile data.
  • ACL_PROF_TASK_TIME_L0: collects operator delivery and execution duration data. Compared with ACL_PROF_TASK_TIME and ACL_PROF_TASK_TIME_L2, ACL_PROF_TASK_TIME_L0 does not collect basic operator information, so the performance overhead during collection is smaller, and this enables more accurate collection of statistics on time duration data.
  • ACL_PROF_TASK_TIME_L2: collects operator delivery and execution duration data, as well as basic operator information (including attr), to provide more comprehensive profile data.
  • ACL_PROF_GE_API_L0: collects the time consumption data of dynamic-shape operators in the main host scheduling phase to facilitate accurate statistics.
  • ACL_PROF_GE_API_L1: collects finer-grained time consumption data of dynamic-shape operators in the host scheduling phase to provide more comprehensive profile data.
  • ACL_PROF_OP_ATTR: collects operator attribute information. Currently, only the aclnn operator is supported.
  • ACL_PROF_AICORE_METRICS: collects AI Core metrics. This macro must be included in the logic OR for aicoreMetrics to take effect.
  • ACL_PROF_TASK_MEMORY: collects the memory usage of CANN operators to optimize memory consumption. In the single-operator scenario, the operator memory size and lifecycle information is collected based on GE component and operator dimensions (the GE component memory is not collected in the single-operator API execution mode). In the static graph and static subgraph scenarios, the operator memory size and lifecycle information is collected based on the operator dimension during the operator compilation phase.
  • ACL_PROF_AICPU: collects the start and end data of AI CPU tasks.
  • ACL_PROF_L2CACHE: collects the L2 cache data and TLB page table cache hit ratio.
  • ACL_PROF_HCCL_TRACE: collects communication data.
  • ACL_PROF_MSPROFTX: collects the profile data output by the user and upper-layer framework program. You can call either a msproftx extension API or a mstx API in the collection process (between the aclprofStart and aclprofStop calls) to record the time span of a specific event during app execution, write the profile data file, use the msprof tool to parse the file, and export and display the profile data.
  • ACL_PROF_TRAINING_TRACE: collects iteration traces.
  • ACL_PROF_RUNTIME_API: collects runtime API profile data.

Returns

  • Success: a pointer to data of the aclprofConfig type
  • Failure: nullptr