Function: set_config

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

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 product:
      • 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 product:
      • 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 product:
      • 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 product/Atlas A2 inference product:
      • 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 product/Atlas A3 inference 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 200I/500 A2 inference product: NIC data collection is supported. This parameter does not take effect in containerized scenarios.
    • Atlas training product: NIC and RoCE data collection is supported.
    • Atlas A2 training product/Atlas A2 inference product: NIC and RoCE data collection is supported.
    • Atlas A3 training product/Atlas A3 inference product: 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 product: PCIe data collection is supported.
    • Atlas training product: HCCS and PCIe data collection is supported.
    • Atlas A2 training product/Atlas A2 inference product: HCCS and PCIe data collection and inter-chip transmission bandwidth statistics collection are supported.
    • Atlas A3 training product/Atlas A3 inference product: 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 product: Performance data collection is supported, but parsing is not supported.

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

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.