To use the ATC tool to convert a model, ensure that the --status_check parameter has been added to the conversion command and set to 1, indicating that the overflow/underflow detection logic is added during operator compilation.
For details about the ATC tool and its parameters, see ATC Instructions.
When the aclInit API is called to initialize AscendCL, the dump configuration of an overflow/underflow operator is added to the JSON configuration file.
{
"dump":{
"dump_path":"output",
"dump_debug":"on"
}
}
If dump_path is set to a relative path, you can view the exported data files in {dump_path} under the directory of app executable files. For each overflow/underflow operator, two data files are exported:
You can identify an overflow/underflow operator based on the preceding information. To view the operator input and output, refer to Analyzing the Dump File of an Overflow/Underflow Operator.
You can obtain the overflow information by referring to Analyzing the Data File of an Overflow/Underflow Operator, including the model where an overflow/underflow operator is located and the status register of AI Core.
cd /home/HwHiAiUser/Ascend/ascend-toolkit/latest/toolkit/tools/operator_cmp/compare
python3 msaccucmp.py convert -d /home/HwHiAiUser/dump -out /home/HwHiAiUser/dumptonumpy -v 2
The -d option enables the conversion of a single dump file or all dump files in a path.
$ python3
>>> import numpy as np
>>> a = np.load("/home/HwHiAiUser/dumptonumpy/Pooling.pool1.1147.1589195081588018.output.0.npy")
>>> b = a.flatten()
>>> np.savetxt("/home/HwHiAiUser/dumptonumpy/Pooling.pool1.1147.1589195081588018.output.0.txt", b)
The dimension and Dtype information no longer exist in the .txt file. For more details, visit the NumPy website.
Since the generated overflow data is in binary format, you must interpret the binary file into a readable format, such as JSON.
cd /home/HwHiAiUser/Ascend/ascend-toolkit/latest/toolkit/tools/operator_cmp/compare
python3 msaccucmp.py convert -d /home/HwHiAiUser/opdebug/Opdebug.Node_OpDebug.59.1597922031178434 -out /home/HwHiAiUser/result
The key options are described as follows:
{
"DHA Atomic Add": {
"model_id": 0,
"stream_id": 0,
"task_id": 0,
"task_type": 0,
"pc_start": "0x0",
"para_base": "0x0",
"status": 0
},
"L2 Atomic Add": {
"model_id": 0,
"stream_id": 0,
"task_id": 0,
"task_type": 0,
"pc_start": "0x0",
"para_base": "0x0",
"status": 0
},
"AI Core": {
"model_id": 514,
"stream_id": 563,
"task_id": 57,
"task_type": 0,
"pc_start": "0x1008005b0000",
"para_base": "0x100800297000",
"kernel_code": "0x1008005ae000",
"block_idx": 1,
"status": 32
}
} The fields are described as follows:
For example, assume that the value of status is 272. The hexadecimal equivalent of the value is 0x00000110. Therefore, the error cause is 0x00000010+0x00000100.