---
title: 单算子运行报错
description: "如果info.txt中给出如下结论，说明是单算子运行报错或pass异常。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/troubleshooting/troubleshooting_0014.html
sourcePath: /source/zh/canncommercial/900/maintenref/troubleshooting/troubleshooting_0014.html
indexId: 1083fdc2e1c62f46604dff1d10341b1a36f149558f29f8d3cc903f3f4a3c2bdf82
---
# 单算子运行报错

#### 分析结果

如果info.txt中给出如下结论，说明是单算子运行报错或pass异常。

```
**********************Root cause conclusion******************
Failed to execute the single-operator test case. The operator logic may be incorrect.
```

此时可以结合info.txt文件中的以下信息，通过单算子复现的方法进行问题处理。还可以执行python3 test_single_op.py进一步查看异常算子执行过程中的报错信息，便于分析异常算子的报错原因。

1. Basic information中给出的算子信息，示例如下：

```
***********************1. Basic information********************
error time   : 2023-06-09-06:55:34.798.772
device id    : 0
core id      : 0
task id      : 6
stream id    : 7
node name    : GatherV2
kernel name  : te_gatherv2_657cb48fa1743a43209d7bc779fe8c294760a5b09b3079a3323fdf18376fc408_1
flip num     :
kernel file  : te_gatherv2_657cb48fa1743a43209d7bc779fe8c294760a5b09b3079a3323fdf18376fc408_1.o
json file  : te_gatherv2_657cb48fa1743a43209d7bc779fe8c294760a5b09b3079a3323fdf18376fc408_1.json
cce file          :
rts_block_dim     : 8
driver_aicore_num : 24
```


2. AICERROR code中给出的详细报错信息，示例如下：

```
***********************2. Ai Core DFX Register***********************
error code  : 0x10
CCU_ERR_INFO: 0x2c6290000324442
ccu_err_addr bit[22:8]=011001001000100  meaning:CCU Error Address [17:3]  approximate:0x19220
ccu_illegal_instr，非法执行：1.指令的binary错误  2.指令地址非对齐
```


3. Instructions中给出的大概报错的cce行号，示例如下：

```
***********************3. Operator Error Line Number************************
start   pc   : 0x1000124080064000
current pc   : 0x124080067d2c
Error occurred most likely at line: 3d08
/home/HwHiAiUser/tf/info_20230609065654/aicerror_0_20230609065534/te_gatherv2_657cb48fa1743a43209d7bc779fe8c294760a5b09b3079a3323fdf18376fc408_1.o.txt:3d08
te_gatherv2_657cb48fa1743a43209d7bc779fe8c294760a5b09b3079a3323fdf18376fc408_1.cce:1364
....../opp/built-in/op_impl/ai_core/tbe/impl/dynamic/gather_v2.py:1214
....../opp/built-in/op_impl/ai_core/tbe/impl/dynamic/gather_v2.py:1214
related instructions (error occurred before the mark *):
3d08: <not available>
3d0c: <not available>
3d10: <not available>
3d14: <not available>
3d18: <not available>
3d1c: <not available>
3d20: <not available>
3d24: <not available>
3d28: <not available>
*   3d2c: <not available>
For complete instructions, please view /home/tf/info_20230609065654/aicerror_0_20230609065534/te_gatherv2_657cb48fa1743a43209d7bc779fe8c294760a5b09b3079a3323fdf18376fc408_1.o.txt
```


#### 故障根因

出现该问题，可能由以下原因：

- 算子自身逻辑错误，比如读写一些未分配的地址。
- 编译器错误，算子的逻辑正确，但编译器将其编译成了错误的底层汇编指令，导致芯片报AI Core error。
- 输入数据错误。通常输入数据是作为索引输入，错误的索引导致算子的非法访问。
- tilingdata数据计算或选择问题。


#### 处理方法

此类问题可以通过单算子复现的方法定位处理：

在执行msaicerr.py工具分析结束后，在执行msaicerr.py工具的同级目录下，会生成“info_{时间戳}/debug_info.txt”文件、异常算子测试脚本“info_{时间戳}/aicerror_{number}_{时间戳}/test_single_op.py”。

在debug_info.txt文件中异常算子测试脚本的执行命令（命令示例如下），再执行脚本，复现AI Core error问题。

```
Run 'export PYTHONPATH=/usr/local/Ascend/CANN-7.3/tools/msaicerr/:$PYTHONPATH;cd /usr/local/Ascend/CANN-7.3/tools/msaicerr;python3 /home/xxxxxxx/xxx/info_xxxx/aicerror_xxxx/test_single_op.py' can test op!
```

该问题需要您收集msaicerr.py工具分析结果信息（info_时间戳目录下所有文件），根据这些文件如果无法定位或解决问题，再通过https://gitee.com/ascend网站(https://gitee.com/ascend)提交issue获取帮助。
