Function: set_config

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

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

√

Description

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.

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)
    

Parameters

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: NIC data collection is supported. This parameter does not take effect in containerized scenarios.
    • Atlas training products: NIC and RoCE data collection is supported.
    • Atlas A2 training products/Atlas A2 inference products: NIC and RoCE data collection is supported.
    • Atlas A3 training products/Atlas A3 inference products: NIC and RoCE data collection is supported.
  • 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: PCIe data collection is supported.
    • Atlas training products: HCCS and PCIe data collection is supported.
    • Atlas A2 training products/Atlas A2 inference products: HCCS and PCIe data collection and inter-chip transmission bandwidth statistics collection are supported.
    • Atlas A3 training products/Atlas A3 inference products: HCCS and PCIe data collection, inter-chip transmission bandwidth statistics collection, and SIO data collection are supported.
  • ACL_PROF_DVPP_FREQ: DVPP data collection frequency. The value range is [1, 100].

    Atlas inference products: Profile data collection is supported, but parsing is not supported.

  • ACL_PROF_HOST_SYS = 8: Process-level profile data collection switch on the host. The value can be cpu or mem.
  • ACL_PROF_HOST_SYS_USAGE = 9: System and all-process profile data collection switch on the host. The value can be cpu or 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 Values

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.