Function: set_config

C Prototype

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

Python Function

ret = acl.prof.set_config(config_type, config)

Function Usage

Functions as an extended API of acl.prof.create_config 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.

Input Description

config_type: int. Each constant indicates a different collection configuration. To use different options of this API 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 = 1: 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 = 3: DDR and HBM bandwidth and memory, LLC read/write bandwidth data, acc_pmu data and SoC transmission bandwidth data , and component memory data collection frequency. The value range is [1, 100].
    • Atlas 200/300/500 Inference Product: The DDR, LLC, and component memory can be collected.
    • Atlas Training Series Product: The DDR, HBM, LLC, and component memory can be collected.
  • ACL_PROF_LLC_MODE = 4: 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 = 5: 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 = 6: collection frequency of the HCCS bandwidth, PCIe data collection switch, and inter-chip transmission bandwidth statistics. 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 = 8: host-side process-level profile data collection option, selected from cpu and mem.
  • ACL_PROF_HOST_SYS_USAGE = 9: host-side system- and process-level profile data collection option, selected from cpu and mem.
  • ACL_PROF_HOST_SYS_USAGE_FREQ = 10: CPU and memory usage collection frequency. The value range is [1, 50].

config: str, configuration parameter value.

Return Value

ret: int, error code.

Restrictions

Call acl.prof.set_config and then acl.prof.start. You can call this API as required.