Debug AscendC kernel precision issues using DumpTensor. Guides systematic dump placement for Cube/Vector operators, data flow backtracking, and minimal sampling to locate numerical errors, NaN/Inf, or wrong results.
Ships in tilelang2ascend-ops-developer-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.
系统性的 AscendC kernel 精度问题定位方法,按算子类型选择对应调试流程。
DumpTensor 是默认首选工具。不要因为“看起来不复杂”或“怀疑是别的问题”就跳过 dump;在能插桩的位置,先 dump 再分析。DumpTensor 不会单独写日志系统,而是直接把内容打印到当前任务的终端输出。需要持久化或便于 grep 时,主动把任务输出重定向到 debug 日志文件再分析。S = Q @ K^T 异常时,先回查同一块 Q 和 K 是否已经错误,再判断 MMAD、layout、fixpipe 或同步问题。{task_dir}/ascendc_debug_trace.md({task_dir} 为当前 simple_task/ 或 full_task/),格式如下:## 迭代 N
**操作**: 插入 DumpTensor 位置、参数、验证用例。
**结果**: NPU vs CPU golden 数值对比、错误特征。
**分析**: 从结果推导的结论。
**下一步**: 后续调试或修复方向。
**状态**: 调试中 / 已定位 / 已修复验证通过
| 类型 | 特征 | 示例 |
|---|---|---|
| 类型 A - 简单 Vector | 单核、无 Cube、无跨核同步、线性数据流 | Add、Mul、Softmax、LayerNorm |
| 类型 B - 复杂 Cube+Vector | 双核分离、Mmad/Matmul、跨核同步、Workspace 中间数据 | FlashAttention、Matmul fusion |
每次调试遵循这个顺序,禁止跳步:
dumpSize 先用 8/16/32。grep 按 desc过滤阅读。追踪点:CopyIn 后 → Compute 步骤 → CopyOut 前
编号约定:
详细步骤请读取 references/debug-workflow-simple.md
核心原则:追踪 GM/UB 上的 ND 数据,避免 L1/L0 的 NZ 格式。
编号约定:
详细步骤请读取 references/debug-workflow-complex.md
按需读取,不要一次性全读:
references/api-reference.md - DumpTensor API 参数说明(必读)references/error-patterns.md - 常见错误模式与根因对照表references/debug-workflow-simple.md - 类型 A 详细调试步骤 (适用于Vector简单算子)references/debug-workflow-complex.md - 类型 B 详细调试步骤(适用于CV融合算子)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ascendc, dump-tensor, precision-debugging, kernel-debug, npu
6 skills in this plugin
/tilelang2ascend-case-simplifier测试用例精简专家 Skill。读取 `{output_dir}` 中与算子对应的 `.json` 文件, 对其中的输入 cases(JSON Lines 格式,每行一个 `{"inputs": [...]}` 对象)进行精简, 使 case 数量尽量不超过 10 个,同时保证覆盖度。 当测试用例数量过多需要精简时,使用此 skill。
/tilelang2ascend-operator-project-init初始化 AscendC 算子工程并创建可编译的算子骨架。触发场景:(1) 用户要求创建新算子;(2) 关键词:ascendc算子、新建算子、算子目录、算子初始化;(3) 需要基于 ascend-kernel 模板快速落地。本 skill 不只建目录,还输出“可继续开发”的标准文件与检查清单。/tilelang2ascend-tilelang-designerTileLang kernel 设计调度 Skill。协调 tilelang-op-design(设计方法论)和 tilelang-op-develop(编码规范), 完成 block-level 设计、tile-level 设计和 model_new_tilelang.py 生成, 并通过步骤 4(tilelang-perf-optimization 本体)完成测量驱动的性能迭代。 产物对接下游 AscendC translator 算子生成流程。 触发:当需要为复杂算子(Attention、MatMul 变体、Norm 变体、Sort、多输入融合)生成 TileLang kernel 设计时使用。
/tilelang2ascend-ops-developer-skills:tilelang2ascend-precision-tuningfrom tilelang2ascend-ops-developer-skills
npx claudepluginhub hicann/cannbot-skills --plugin tilelang2ascend-ops-developer-skills3 plugins ship this exact skill · first indexed Jun 25, 2026
Other plugins' skills for the same job