Analyzes AI Core Error faults, parses Dump files to .bin/.npy, converts .bin dtypes, and checks Ascend hardware/software environment via msaicerr.py.
Ships in cann-tools-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
分析 AI Core Error 故障信息、解析 Dump 文件、检查软硬件环境。工具随 CANN Toolkit 包部署,脚本路径为 {install_path}/tools/msaicerr/msaicerr.py。
| 项 | 要求 |
|---|---|
| 分析方式 | 仅支持本地分析,部署工具的环境必须与日志产生环境为同一运行环境 |
| Python | 依赖 python3.7.5 或以上版本,需提前安装 |
| 产品形态 | 不支持 Ascend RC 形态 |
| 软件包 | 已安装 CANN Toolkit,并以 CANN 运行用户执行 source {INSTALL_DIR}/set_env.sh |
| 执行目录 | 使用前需 cd 到 {install_path}/tools/msaicerr;且不能在 -p 指定目录或其子目录下执行 |
部分算子的 AI Core Error 问题暂不支持分析(MatmulAllReduce 类、AllGatherMatmul、MemSet 等),完整清单与约束见 functions-and-restrictions.md;环境准备步骤见 environment-preparation.md。
环境自检:bash scripts/preflight.sh;传入故障信息目录(bash scripts/preflight.sh <故障信息目录>)可追加检查收集完整性与路径关系([4/5][5/5] 项)。
| 场景 | 命令 | 详细参考 |
|---|---|---|
日志/屏显报 there is an xx aicore error、aivec error | python3 msaicerr.py -p <故障信息目录> -out <结果目录> | aicore-error-analysis.md |
| 把 Dump 文件解析成 .bin/.npy 看算子输入输出 | python3 msaicerr.py -d <dump文件> | dump-parsing.md |
| .bin 文件按指定数据类型转成 .npy | python3 msaicerr.py -d <bin文件> -dtype <dtype> | dump-dtype-conversion.md |
| 怀疑软硬件环境异常,先验证环境 | python3 msaicerr.py -e -dev 0 | environment-check.md |
| 确认工具能不能分析当前算子 | — | functions-and-restrictions.md |
# 进入工具目录({install_path} 替换为 CANN 实际安装路径)
cd /usr/local/Ascend/cann/tools/msaicerr
# 分析 AI Core Error(-p 必选,-out/-dev 可选)
python3 msaicerr.py -p $HOME/aic_err_info -out $HOME/result
python3 msaicerr.py -p $HOME/aic_err_info -out $HOME/result -dev 0
# 解析 Dump 文件为 .bin/.npy
python3 msaicerr.py -d /demo/extra-info/data-dump/0/exception_info.2.1.20250611171538370
python3 msaicerr.py -d <dump文件> -out $HOME/parsed
# 转换 *.bin 数据类型为 .npy(-dtype 必选)
python3 msaicerr.py -d <文件>.input.0.bin -dtype int8
# 检查环境(-e 必选,-dev 可选,默认 0)
python3 msaicerr.py -e
python3 msaicerr.py -e -dev 1
| 参数 | 全称 | 适用场景 | 必选性 |
|---|---|---|---|
-p | --report_path | AI Core Error 分析 | 该场景必选 |
-d | --data | Dump 解析 / 数据类型转换 | 该场景必选 |
-dtype | --dest_dtype | 数据类型转换 | 该场景必选 |
-e | --env | 环境检查 | 该场景必选 |
-out | --output_path | 全部场景 | 可选 |
-dev | --device_id | AI Core Error 分析 / 环境检查 | 可选,默认 0 |
分析前先检查故障信息是否齐全。在收集到的故障信息目录中确认:dfx/data-dump 下有 dump 文件、有异常算子编译信息(*.o 和 *.json),dfx/log/host/cann 下有日志文件。缺失则无法用 msaicerr 提取 AI Core Error 信息,应先补齐采集。
路径关系是最常见的卡住原因。工具的执行目录不能是 -p 指定目录或其子目录,-out 指定目录也不能是 -p 目录或其子目录,否则会出现解析卡住或失败。习惯做法:在 {install_path}/tools/msaicerr 下执行,-p 与 -out 各指向独立路径。
多个 AI Core Error 只解析第一个。故障信息中存在多个 AI Core Error 时,工具按日志时间解析第一次出现的问题。定位后续问题需要处理完首个问题后重新采集。
结果读取路径:分析结果看终端提示的 info.txt;工具自身执行日志在执行 msaicerr.py 的同级目录下的 debug_info.txt 或 info_{时间戳}/debug_info.txt,解析异常时先看这个文件。
数据类型不识别时装第三方库。debug_info.txt 提示 Can not read with dtype xxx 表示存在工具不能识别的数据类型,需自行安装对应第三方库,例如提示 Can not read with dtype bfloat16 则安装 bfloat16ext 库。
AI Core Error 分析会顺带跑一次环境检查。-p 分析过程中工具会运行一个内置算子样例检查软硬件环境是否正常,-dev 即指定该样例运行的 Device ID。
本技能内容来自 CANN 社区仓 cann/oam-tools 的 docs/zh/msaicerr 官方文档。命令输出示例因版本而异,请以环境实际输出为准。
evals/evals.json (opens in a new tab)references/aicore-error-analysis.md (opens in a new tab)references/dump-dtype-conversion.md (opens in a new tab)references/dump-parsing.md (opens in a new tab)references/environment-check.md (opens in a new tab)references/environment-preparation.md (opens in a new tab)references/functions-and-restrictions.md (opens in a new tab)scripts/preflight.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
8 skills in this plugin
/npu-objdump-toolkit使用 npu-objdump/msobjdump 分析 Ascend 算子编译产物。触发:查看元数据、提取 device ELF、反汇编 AIC/AIV 指令,或结合报错日志中的异常 PC 定位指令时。/tool-aml为 oam-tools-diag 的 AICore STL 诊断模块(aicore_stl_detect)新增算子的工具。当用户提供形态(Ascend950/Ascend960DT)、算子类型(aic/aiv/mix)、算子名、aic/aiv kernel cce 代码,以及每个输入的 size/填充方式/dtype 和每个输出每 block 的 size 时,自动生成 ops/<算子名>/ 下的 .cpp(host 规格+下发+注册)、.asc(kernel 下发包装)与 aic_/aiv_*.cce 文件,并完成 host so 编译与注册校验。触发场景:为 aicore_stl_detect 模块新增、修改或校验 STL 算子。/tool-asysCANN 一键式故障信息收集工具 asys 使用指导。覆盖故障信息收集(collect)、业务复跑收集(launch)、软硬件与 Device 状态查询(info)、健康检查(health)、综合检测与组件检测(diagnose)、trace/coredump/stackcore/coretrace/UB/AI Core Error 六类文件解析(analyze)、实时堆栈导出、环境配置(config)、性能数据采集(profiling)。触发场景:需要收集 NPU 故障维测信息、训练或推理进程卡死要导出堆栈、Segmentation fault 要解析 coredump、日志出现 aivec/aicore error exception、排查 Device 健康状态与故障码、做 HBM/CPU/AI Core 硬件检测、或用 asys 采集系统级性能数据时。/tool-exception-dump昇腾 NPU AI Core Error 系统化诊断工作流:环境与输入检查、故障信息收集、场景判定与报错行定位、错误类型识别、单算子复现、证据链汇聚与修复建议,基于 msaicerr/asys 官方工具管线执行与判读,输出六段式证据链诊断报告。
Use when(满足任一强信号即触发):当用户提到 aicore error、aivec error、AI Core Error、AI Core 异常、核错误、算子报错;越界、野指针、内存踩踏、地址非法;exception dump 解析、plog、故障日志收集、asys collect、msaicerr -p/-d/-e;报错行定位、错误码定位、寄存器解码、结论码 101-107;单算子复现、最小复现、根因分析;Kernel 报错调试。即使只是询问某报错是否为 AI Core Error 也应使用本技能。
Do NOT use:仅询问 msaicerr/asys 工具用法与参数细节(转 tool-msaicerr、tool-asys 技能);GE/图编译层问题(转 graph/ 域技能);算子精度不达标(转 ascendc-precision-debug);AI CPU Error、HCCL 等其他错误类型(不在覆盖范围,说明后指路)。
/tool-msnpureportmsnpureport 工具使用技能。用于:(1) 导出 Device 侧系统类日志和维测信息(单次导出、常驻进程连续导出),(2) 查询 Device 维测配置(日志级别、Coremask、加速器复位、singlecommit),(3) 设置 Device 维测配置(日志级别、TaskSchedule 自动复位、AI Core singlecommit、屏蔽 AI Core/Vector Core、icache bit 翻转校验范围),(4) 配置 msnpureport 自身维测日志级别与展示位置,(5) 解读导出目录结构并定位日志文件。触发关键词:msnpureport、Device侧日志、导出Device日志、黑匣子、bbox、hisi_logs、stackcore、slog、连续导出日志、Device日志级别、Coremask、屏蔽AI Core、屏蔽Vector Core、accelerator_recover、singlecommit、icachecheck、msnpureport_auto_export.sh、vmcore、fault_event。/tool-npu-check使用 npu-check 检查 Ascend 算子的内存访问、同步配对、初始化和访问竞争,运行工具并解读报告。适用于明确请求 npu-check、memcheck、synccheck、initcheck、racecheck,或 Ascend 算子定位任务中已有非法访问、同步不配对、未初始化读取或冲突访问线索的场景。仅有普通数值精度偏差、性能问题或 Host 侧异常时不直接触发。/cann-tools-skills:tool-msaicerrfrom cann-tools-skills
npx claudepluginhub hicann/cannbot-skills --plugin cann-tools-skillsOther plugins' skills for the same job