Preparing Dump Data of an Offline Model
Prerequisites
This section describes how to dump data of an offline model in MindStudio. Before dumping data, perform the following operations:
- Use ATC to convert a Caffe, TensorFlow, or ONNX model into an offline OM model. For details, see Model Conversion.
- Develop, build, and run your application project, which means that you have an executable application project. For details, see Application Development.
Generating the Dump File
To generate dump data, perform the following steps:
- Open MindStudio and choose from the menu bar. The Select Offline Model dialog box is displayed, as shown in Figure 1.
You can also open the project file, right-click your .om file, and choose Dump Configuration.
- Select an .om file and click OK. The network topology of the model is displayed. Perform Dump Configuration, as shown in Figure 2.
- To dump multiple models, perform Dump Configuration for each .om file separately.
- If similar models are used, they might have the same Model Name. As a result, there is some confusion between the dump configurations in the acl.json file.
For example, if the values of YOLOv2 and YOLOv3 in Model Name are the same, and the dump configuration of YOLOv2 has been recorded in the acl.json file, then the dump configuration of YOLOv2 applies to YOLOv3.
To ensure each model has a unique Model Name, change the name field in the Caffe prototxt file and re-convert the model. You can also choose None during Dump Configuration to clear the previous configuration, and start Dump Configuration all over.
Set the dump parameters of the .om file on the upper right.
Table 1 Parameters Parameter
Description
Dump Option
Dump range. Possible values are:
- ALL: dumps all operators.
- Several: dumps specified operators. Right-click the operator to be dumped and choose Enable Dump.
- None: disables dump.
Dump Mode
Dump mode. Possible values are:
- All: dumps both the operator input and output.
- Input: dumps the operator input.
- Output: dumps the operator output.
Dump Path
Path for storing dump files. Defaults to {project_path}/dump. If the parameter is set to a different path, ensure that the MindStudio installation user has the read and write permissions on the path.
AclConfig File
ACL configuration file, which stores the dump configuration information of the operator during the dump operation. Generally, the path is {project_path}/src/acl.json. You can search for the actual path in the {project_path}/.project file. The format is shown in Figure 3 or Figure 4. To dump all operators of a model, the layer field is not included.
- Operators that do not have output (for example, StreamActive, NetOutput, Send, Recv, and const) do not generate dump data.
- For operators that are not executed on the AI CPU or AI Core (for example, concatD) after build, dump data cannot be generated.
- When only certain operators are to be dumped, since the Data operators are not executed on the AI CPU or AI Core, you need to select all the downstream operators of the Data operator.
- Use ATC to parse the .om file for obtaining the mapping between operators (for example, newly-added, one-to-many, many-to-one, many-to-many, and L1 batch). Mapped operators should have the same Enable Dump setting.
- Dump cannot be enabled for const operators.
- After Dump Configuration, click and in MindStudio, to build and run the application project.
Check the project file code to ensure the .om file with dump configured is used. For example, check aclmdlLoadFromFile() or aclmdlLoadFromFileWithMem().
After the project is run, find the dump data in the {project_path}/dump path. The path and format are described as follows:
time/device_id/model_name/model_id/data_index/dump_file
Table 2 Field description Field
Description
time
Dump time, formatted as YYYYMMDDhhmmss
device_id
Device ID.
model_name
Model name.
model_id
Model ID.
data_index
Execution sequence number of each task, starting at 0. This value is increased by 1 every dump.
dump_file
The naming rule is {op_type}.{op_name}.{taskid}.{timestamp}.
Note: Periods (.), forward slashes (/), backslashes (\), and spaces in model_name, op_type, or op_name are replaced with underscores (_).



