Overview

This section describes how to collect profile data using APIs in offline inference scenarios. The following collection methods are supported.

Table 1 Collection methods

Collection Method

Description

Method 1: Collecting and flushing profile data

Write the collected profile data to a file, parse the file by using the msprof tool, and display the profile data analysis result.

Method 2: Using the msproftx APIs to collect and flush profile data

To locate the performance bottleneck of your application or the upper-layer framework application, call the msproftx APIs during the profiling process (between the acl.prof.start and acl.prof.stop calls). msproftx is used to record the time span of specific events during application running and write data to a profile data file. You can use the profiling tool to parse the file and export the profile data.

Method 3: Subscribing to operator information

Parse the collected profile data and write it to a pipeline. Then, users read the data to the memory and call APIs to obtain it.

Note: For details about the APIs, see "Profile Data Collection".

  • Before using the APIs to collect profile data, you need to develop, build, and run an application project.
  • Methods 1 and 2 cannot be used with method 3.