Function Description

Function

This section describes how to collect and flush profile data by using Profiling AscendCL APIs. The purpose is to write the collected profile data to a file, which is then parsed and displayed by the Profiling tool. For details, see Profiling Instructions.

The following two API call modes are available:
  • Mode 1 uses calls to the following APIs: aclprofInit, aclprofStart, aclprofStop, and aclprofFinalize. You can obtain the AscendCL API profile data, time taken to execute AI Core operators, as well as AI Core metrics. Currently, the preceding APIs perform process-level control. That is, if the APIs are called in any thread in the process, the calls also take effect in other threads in the same process.

    These APIs can be called repeatedly in a process, allowing for varied Profiling configurations with each call.

  • Mode 2 uses the aclInit call. During AscendCL initialization, the Profiling configuration is passed as a JSON configuration file. You can obtain the AscendCL API profile data, time taken to execute AI Core operators, as well as AI Core metrics.

    aclInit can be called only once per process. To modify the Profiling configuration, modify the JSON configuration file. For details, see the description of the aclInit API.

General Restrictions

You cannot call the APIs in Profiling AscendCL API for Subscription (Subscription to Operator Information), including aclprofModelSubscribe, aclprofGet*, and aclprofModelUnSubscribe, between the aclprofInit and aclprofFinalize calls.

API Constraints