Function: set_dump

C Prototype

aclError aclmdlSetDump(const char *dumpCfgPath)

Python Function

ret = acl.mdl.set_dump(dump_cfg_path)

Function Usage

Sets dump configuration.

Input Description

dump_cfg_path: string, path of the configuration file, including the file name.

Currently, the following dump information can be configured:

  • Model dump configuration (used to export the input and output data of operators at each layer in the model) and single-operator dump configuration (used to export the input and output data of an operator). The exported data is used to compare with that of a specified model or operator to locate accuracy issues. For details about the configuration example, description, and restrictions, see Configuration File Example (for Model Dump and Single-Operator Dump). Dump configurations are disabled by default.
  • Dump configuration of the exception operator (used to export the input and output data, workspace information, and tiling information of the exception operator). The exported data is used to analyze AI Core errors. For details about the configuration example, see Configuration File Example (Exception Operator Dump Configuration). Dump configurations are disabled by default.
  • Overflow/Underflow operator dump configuration (used to export the input and output data of the overflow/underflow operator in the model). The exported data is used to analyze overflow/underflow causes and locate model accuracy issues. For details about the configuration example, description, and restrictions, see Example Configuration (Overflow/Underflow Operator Dump). Dump configurations are disabled by default.

Return Value

ret: int, error code.

Restrictions

  • The configured dump data is valid only when the model is loaded after this API call. The dump configuration does not take effect on models loaded before this API call unless you reload the models after this API call.

    For example, in the following API call sequence, the dump configuration is valid only for model 2:

    acl.mdl.init_dump --> model 1 loading --> acl.mdl.set_dump --> model 2 loading --> acl.mdl.finalize_dump

  • If this API is called repeatedly to set dump configuration for the same model, the most recent configuration is applied.

    For example, in the following API call sequence, the second dump configuration call overwrites the first call:

    acl.mdl.init_dump --> acl.mdl.set_dump --> acl.mdl.set_dump --> model 1 loading --> acl.mdl.finalize_dump

API

pyACL also provides the acl.init API. During pyACL initialization, the dump configuration is passed as a JSON configuration file to dump the app data at run time. In this mode, the acl.init API can be invoked only once in a process. To modify the dump configuration, you need to modify the configuration in the JSON file.