Function Description

Overview

This section describes how to collect and flush profile data by using profiling pyACL 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 "Data Parsing and Export" in Profiling Instructions.

The following two API call modes are available:
  • Call the following APIs: acl.prof.init, acl.prof.start, acl.prof.stop, and acl.prof.finalize. You can obtain the pyACL 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.

  • Call acl.init. During pyACL initialization, the profiling configuration is passed as a JSON configuration file. You can obtain the pyACL API profile data, time taken to execute AI Core operators, as well as AI Core metrics.

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

General Restrictions

The APIs in this section cannot be called with Profiling pyACL APIs for Subscription (Subscribing to Operator Information) together. acl.prof.model_subscribe, aclprofGet*, and acl.prof.model_unsubscribe cannot be called between acl.prof.init and acl.prof.finalize.

API Constraints