Function: set_config

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Functions as an extension 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.

Prototype

  • C Prototype
    1
    aclError aclprofSetConfig(aclprofConfigType configType, const char *config, size_t configLength)
    
  • Python Function
    1
    ret = acl.prof.set_config(config_type, config)
    

Parameter Description

Parameter

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: collection frequency of on-chip memory, QoS 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].
  • 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 inference products:
      • read: read events, that is, the L3 cache read rate.
      • write: write events, that is, the L3 cache write rate. Defaults to read.
    • Atlas training products:
      • read: read events, that is, the L3 cache read rate.
      • write: write events, that is, the L3 cache write rate. Defaults to read.
    • Atlas 200I/500 A2 inference products:
      • read: read events, that is, the L3 cache read rate.
      • write: write events, that is, the L3 cache write rate. Defaults to read.
    • Atlas A2 training products/Atlas A2 inference products:
      • read: read events, that is, the L3 cache read rate.
      • write: write events, that is, the L3 cache write rate. Defaults to read.
    • Atlas A3 training products/Atlas A3 inference products:
      • 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 200I/500 A2 inference products: supports NIC collection. This option does not take effect in container scenarios.
    • Atlas training products: supports NIC and RoCE collection.
    • Atlas A2 training products/Atlas A2 inference products: supports NIC and RoCE collection.
    • Atlas A3 training products/Atlas A3 inference products: 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 inference products: supports PCIe data collection.
    • Atlas training products: supports HCCS and PCIe data collection.
    • Atlas A2 training products/Atlas A2 inference products: supports HCCS, PCIe data, and inter-chip transmission bandwidth information collection.
    • Atlas A3 training products/Atlas A3 inference products: supports HCCS, PCIe data, inter-chip transmission bandwidth, and SIO data collection.
  • ACL_PROF_DVPP_FREQ: DVPP data collection frequency. The value range is [1, 100].

    Atlas inference products: supports profile data collection but not data parsing.

  • 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 Description

Return Value

Description

ret

Int, error code.

Restrictions

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