aclprofSetConfig

Description

Functions as an extended API of aclprofCreateConfig and is used to set profile data collection parameters.

This API can be called for multiple times. You need to ensure data consistency and accuracy.

Restrictions

Call aclprofSetConfig and then aclprofStart. You can call this API as required.

Prototype

aclError aclprofSetConfig(aclprofConfigType configType, const char *config, size_t configLength)

Parameters

Parameter

Input/Output

Description

configType

Input

Select from the following values as the value of configType: Each enumerated value indicates a different collection configuration. To collect multiple types of profile data, you need to call this API for multiple times. The details are as follows:

  • ACL_PROF_STORAGE_LIMIT: maximum size of files that can be stored in a specified disk directory. The valid value range is [200, 4294967295], in MB.
  • ACL_PROF_SYS_HARDWARE_MEM_FREQ: collection frequency of on-chip memory, bandwidth and memory, LLC read/write bandwidth data, acc_pmu data and SoC transmission bandwidth data , and component memory data. The value range is [1, 100].

    The support for different products varies.

    NOTE:

    Sampling memory data in the environment where glibc (2.34 or an earlier version) is installed may trigger a known Bug 19329. This problem can be solved by upgrading the glibc version.

  • ACL_PROF_LLC_MODE: LLC profiling event. ACL_PROF_SYS_HARDWARE_MEM_FREQ must be set at the same time. The options are as follows:
    • Atlas 200/300/500 Inference Product:
      • capacity: LLC capacity of the AI CPU and Ctrl CPU.
      • bandwidth: LLC bandwidth. Defaults to capacity.
    • Atlas Training Series Product:
      • read: read events, that is, the L3 cache read rate.
      • write: write events, that is, the L3 cache write rate. Defaults to read.
  • ACL_PROF_SYS_IO_FREQ: NIC and RoCE data collection frequency. The value range is [1,100] and the unit is Hz.
    • Atlas 200/300/500 Inference Product: supports NIC collection.
    • Atlas Training Series Product: supports NIC and RoCE collection.
  • ACL_PROF_SYS_INTERCONNECTION_FREQ: HCCS bandwidth, PCIe, and inter-chip transmission bandwidth data collection frequency. The value range is [1,50] and the unit is Hz.
    • Atlas Training Series Product: supports HCCS and PCIe data collection.
  • ACL_PROF_DVPP_FREQ: DVPP data collection frequency. The value range is [1, 100].
  • ACL_PROF_HOST_SYS: host-side process-level profile data collection option, selected from cpu and mem.
  • ACL_PROF_HOST_SYS_USAGE: host-side system- and process-level profile data collection option, selected from cpu and mem.
  • ACL_PROF_HOST_SYS_USAGE_FREQ: CPU and memory usage collection frequency. The value range is [1, 50].

config

Input

Configuration parameter value.

configLength

Input

Length of the config, in bytes. The maximum length is 256 bytes.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.