Agent skill

Tilelang Error Fixer

by tile-ai in tile-ai/tilelang-ascend

TileLang-Ascend 错误诊断、调试与修复技能。融合了 GDB 故障定位、IR Dump 分析、目标代码倒推(AOT)的诊断能力。提供从环境检查、错误定位、AOT验证到 C++ Pass 修复的端到端工作流。

MITAuto-check passedDevelopment

Install Tilelang Error Fixer

skills CLI
$ npx skills add tile-ai/tilelang-ascend --skill tilelang-error-fixer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tile-ai/tilelang-ascend tilelang-error-fixer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tile-ai/tilelang-ascend.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/tilelang-custom-skill/tilelang-error-fixer .claude/skills/tilelang-error-fixer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tilelang-error-fixer
GitHub stars
400
Token cost
~925 tokens
SKILL.md length
300 words
Files
1
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

TileLang-Ascend 错误诊断、调试与修复技能。融合了 GDB 故障定位、IR Dump 分析、目标代码倒推(AOT)的诊断能力。提供从环境检查、错误定位、AOT验证到 C++ Pass 修复的端到端工作流。

  • Works in 2 steps: 执行环境检查脚本验证 TL_ROOT, PYTHONPATH,… → 确认 C++ 工程是否处于最新编译状态。
  • Development work in your project
  • SKILL.md covers 使用场景, 触发机制, 工作流程 and 输出格式
  • Calls make

What it does

Tilelang Error Fixer is an agent skill from tile-ai/tilelang-ascend. TileLang-Ascend 错误诊断、调试与修复技能。融合了 GDB 故障定位、IR Dump 分析、目标代码倒推(AOT)的诊断能力。提供从环境检查、错误定位、AOT验证到 C++ Pass 修复的端到端工作流。

Its SKILL.md is about 930 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with C++. The repository describes itself as: Ascend TileLang adapter. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/tilelang-error-fixer”

Requirements

  • Python 3

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. 执行环境检查脚本验证 TL_ROOT, PYTHONPATH, ASCEND_HOME_PATH, LD_LIBRARY_PATH 等变量。
  2. 确认 C++ 工程是否处于最新编译状态。

What it can do on your machine

Read from SKILL.md and the folder at commit 3d17c28. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tilelang Error Fixer loads about 925 tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 300 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~33
When it runs · the whole SKILL.md, loaded when a task matches
~925

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from tile-ai/tilelang-ascend at commit 3d17c28, republished under its MIT licence (© tile-ai). 300 words, ~925 tokens.

Download SKILL.mdSave it as .claude/skills/tilelang-error-fixer/SKILL.md (or your agent's skills folder).
name
tilelang-error-fixer
description
TileLang-Ascend 错误诊断、调试与修复技能。融合了 GDB 故障定位、IR Dump 分析、目标代码倒推(AOT)的诊断能力。提供从环境检查、错误定位、AOT验证到 C++ Pass 修复的端到端工作流。

TileLang-Ascend Pass 错误诊断与修复技能

本技能提供 TileLang-Ascend 框架中 Pass 层面错误的完整诊断和修复能力,支持从前端报错、Core Dump 崩溃追溯到后端 C++ Pass 的修复,并集成 AOT 目标代码验证机制。

使用场景

  • 遇到 Core Dump 或 Segmentation Fault 等严重崩溃,且无其他明确错误信息
  • TileLang 编译报错或生成的 Ascend 目标代码结果不符合预期(精度/性能问题)
  • 编写或修改 src/transform/*.cc 下的新 Pass 时出现逻辑异常
  • 需要使用 AOT 提前编译模式进行算子调试与倒推

触发机制

当用户输入包含以下关键字时自动触发:

  • "Core Dump"、"Segment Fault"、"段错误"
  • "TileLang 编译报错"、"Pass 生成代码错误"
  • "排查精度问题,分析 IR"、"使用 AOT 调试这个算子"
  • "修复 TileLang Pass"

工作流程

步骤 1:环境与状态检查

在进行任何 Pass 调试前,必须确保底层环境正常。

  1. 执行环境检查脚本验证 TL_ROOT, PYTHONPATH, ASCEND_HOME_PATH, LD_LIBRARY_PATH 等变量。
  2. 确认 C++ 工程是否处于最新编译状态。
步骤 2:多维度错误信息获取 (Dump & Catch)

根据报错类型,采取不同的信息获取策略:

  1. 严重崩溃 (Core Dump / Segment Fault):

    • 现象:脚本运行直接崩溃,没有任何 Python 异常堆栈。
    • 动作:使用 GDB 挂载 Python 进程进行排查。
      bash
      gdb --args python xxx.py
      # 在 GDB 命令行输入:
      (gdb) run
      # 崩溃后输入 bt 查看堆栈,精确定位是 C++ 源码中哪个函数/Pass 引发了内存违规
  2. C++ 编译报错 (Build Error):

    • 读取 /tmp/tmp*.cpp (获取最新的生成的失败代码) 定位语法或底层 API 错误。
  3. 逻辑/精度异常 (IR Dump):

    • 追踪 Pass 阶段性变换。在 tilelang/engine/lower.py 中的 lower() 函数内,添加 print(mod) 以查看最终 IR 图:
      python
      def lower(...):
          ...
          mod = OptimizeForTarget(mod, target)
          print(mod) # <--- 在此处打印 IR,排查 Pass 优化后的结果
          codegen_mod = device_codegen(mod, target)
  4. 目标代码分析 (Target Dump):

    • 通过 @tilelang.jit(debug_root_path=...) 或 .get_kernel_source() 抓取最终生成的 C++ 核函数。
步骤 3:核心错误原因分析 (TileLang 专属模式)

分析获取的 IR、目标代码或 GDB 堆栈,重点排查 TileLang-Ascend 特有的雷区:

  1. 循环嵌套与次数匹配:对比 Cube 和 Vec 部分的循环 extent,诊断类似 "Vec loop times is not enough" 的报错。
  2. 跨核同步点 (Sync Points):追踪 ascend_auto_set_cross_flag / wait_flag,排查死锁或数据竞争。
  3. 工作空间 (Workspace) 访问:检查张量切片范围,确认访问是否越界。
  4. 数据依赖与流水线 (Pipeline):分析 T.Pipelined 的 num_stages,检查读写重叠冲突。
步骤 4:修复方案制定(必要时使用 AOT 隔离)

根据步骤 3 的证据提出最小修复。需要区分 TileLang lowering 与目标代码行为时,可用 AOT 构造隔离实验:

方案 A:直接修复 C++ Pass(适用于 GDB 已明确指出问题代码行的情况)

  • 直接定位 src/transform/ 或 src/target/ 下的 .cc 文件,提供代码修改建议。

方案 B:AOT counterfactual

  • 复用 examples/gemm_aot 的 engine.lower → LibraryGenerator → ctypes 流程;不要维护 手写 Bisheng include/flag 命令。
  • 对生成 source 的实验性修改只能放在 disposable 副本中。实验通过只能定位问题层,最终 修复仍应落到产生该 source 的 frontend/pass/codegen,并用原始重现验证。
步骤 5:执行修复与 C++ 重新编译
  1. 展示修复方案(C++ 代码 Diff),等待用户确认。
  2. 备份涉及的原始 C++ 文件。
  3. 强制执行编译命令:修改 C++ Pass 后,必须在 build 目录下执行 make -j$(nproc)。
步骤 6:修复验证与回滚
  1. 重新执行用户的重现脚本。
  2. 对比修复前后的 IR 图(diff before.tir after.tir)或目标代码,确认修改符合预期。
  3. 失败处理:如果编译失败或运行不通过,恢复备份代码,清理 /tmp 缓存,重新进入步骤 3。

输出格式

TileLang Pass 诊断与修复报告
markdown
## TileLang Pass 分析报告

### 基本信息
- **触发报错模块**:[如:Segmentation Fault / CombineCV Pass]
- **涉及算子/脚本**:`example_flash_attention.py`
- **获取的调试信息**:[如:GDB Backtrace 指向 `src/transform/combine_cv.cc:145` / `lower.py` 打印的 IR 图]

### 错误原因分析
- **错误分类**:[如:空指针解引用 / 循环迭代不匹配]
- **详细分析**:通过 GDB 堆栈发现,在处理 `T.Pipelined` 节点时,试图访问不存在的 `extent` 属性,导致 Core Dump。
- **定位代码**:`src/transform/cross_core_pipeline.cc: 89行`

### 修复方案建议 (需用户确认)
**建议直接修复 Pass C++ 源码**
1. 修改 `src/transform/cross_core_pipeline.cc`,在访问节点前增加类型检查...
2. 代码 Diff:
   ```cpp
   // Before
   auto extent = op->extent.as<IntImmNode>()->value;
   // After
   if (const auto* imm = op->extent.as<IntImmNode>()) {
       auto extent = imm->value;
       // ...
   }
  1. 修复后将自动执行 make -j8。

(生成逻辑错误可参考 examples/gemm_aot 做隔离 AOT 实验;不得把生成 source 当作长期修复。)

执行与验证结果
  • 编译状态:✅ 成功
  • 测试脚本验证:✅ 通过
  • Core Dump 状态:已解决

© tile-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/tilelang-custom-skill/tilelang-error-fixer of tile-ai/tilelang-ascend.

Open the folder on GitHubat commit 3d17c28

Compare with similar skills

Tilelang Error Fixer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tilelang Error Fixer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tilelang Error Fixer this skilltile-ai/tilelang-ascend400—~925Automated safety check: PassMIT
Qt C++ Code Reviewx-tools-author/x-tools1.1k2 repos~4.3kAutomated safety check: PassBSD-3-Clause
YugabyteDB ASH Instrumentationyugabyte/yugabyte-db11k—~4.5kAutomated safety check: PassCustom licence
pybind11 Release Preparationpybind/pybind1118k—~1.7kAutomated safety check: PassCustom licence
Qt Cpp ReviewSerial-Studio/Serial-Studio7.2k—~4.3kAutomated safety check: PassCustom licence
Paddle Eager GraphPaddlePaddle/Paddle24k—~562Automated safety check: PassApache-2.0

Similar skills

  • Qt C++ Code Review

    x-tools-author/x-tools

    Read-only review of Qt6 C++ code that combines a deterministic lint script with six parallel analysis agents and reports only high-confidence issues.

    1.1k GitHub starsUsed in 2 repos~4.3k tokens
    DevelopmentAuto-check passed
  • YugabyteDB ASH Instrumentation

    yugabyte/yugabyte-db

    Procedure for adding or changing YugabyteDB Active Session History wait states in TServer and DocDB C++ code, including the macro to use for sync and async paths.

    11k GitHub stars~4.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Opens the pybind11 release-preparation pull request: picking the release base, bumping the version in common.h and integrating the changelog, following docs/release.rst.

    18k GitHub stars~1.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Qt Cpp Review

    Serial-Studio/Serial-Studio

    Qt6/C++ deep code review for Serial Studio. An agent skill from Serial-Studio/Serial-Studio.

    7.2k GitHub stars~4.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Paddle Eager Graph

    PaddlePaddle/Paddle

    A skill your agent uses when navigating Paddle eager-mode (dynamic graph) source code, tracing forward/backward execution, debugging autograd issues, understanding PyLayer, or investigating…

    24k GitHub stars~562 tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • ONNX Runtime Source Build

    microsoft/onnxruntime

    Official

    Builds ONNX Runtime from source with its build scripts, explaining the update, build and test phases, key flags and where the build output lands.

    22k GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed

More from tile-ai/tilelang-ascend

All 20 skills in this repo
  • Tilelang Submodule Pull

    tile-ai/tilelang-ascend

    Automatically pull tilelang repository and its third-party code.

    400 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Tilelang Debug Helper

    tile-ai/tilelang-ascend

    How to add debugging capabilities to TileLang Ascend example operators.

    400 GitHub stars~1.7k tokensUpdated today
    Auto-check: notes
  • Tilelang A5 Sim Convert

    tile-ai/tilelang-ascend

    将 tilelang example 脚本转换为可在 A5 camodel 仿真器上直接运行的版本。输入脚本路径,输出一个新的 sim.py 文件,不覆盖原始文件。触发:仿真运行、camodel、A5 仿真、sim 模式、转换脚本为仿真、不需要 NPU 跑 kernel、simulate A5。

    400 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Tilelang Env Check

    tile-ai/tilelang-ascend

    TileLang-Ascend 环境检查与配置验证技能。检查代码仓库完整性、编译安装状态、环境变量配置,并运行简单测试验证环境。发现问题会自动调用相关 skill 进行修复,并按依赖顺序重新执行后续步骤。触发关键词:"环境检查"、"检查环境"、"验证环境"、"环境配置"、"环境搭建"、"env check"、"check environment"、"verify…

    400 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Tilelang Op Test Design

    tile-ai/tilelang-ascend

    TileLang-Ascend 算子测试设计技能。支持多种场景:(1) 从 design.md 设计测试配置 (2) 从 examples/{op}/.py 补充测试 (3) 手动提供算子信息生成测试 (4) 测试覆盖率分析。理解算子实现逻辑后智能判断测试策略。触发:设计算子测试、生成测试用例、补充测试、测试覆盖率不足。

    400 GitHub stars~5.6k tokensUpdated today
    Auto-check passed
  • Tilelang Review

    tile-ai/tilelang-ascend

    检查代码格式是否符合 CI 规则。自动检测并安装缺失工具(ruff、clang-format),先运行检查生成报告,使用醒目方式询问用户后,仅在用户同意时执行修复。工作流程:检测环境→自动安装缺失工具→运行检查→生成报告→醒目询问→用户确认→执行修复。使用此技能当:用户要求"格式检查"、"格式化代码"、"代码格式化"、"检查代码格式"、"代码…

    400 GitHub stars~2.8k tokensUpdated today
    Auto-check: notes

Works with

Categories

Questions about Tilelang Error Fixer

What does Tilelang Error Fixer do?

TileLang-Ascend 错误诊断、调试与修复技能。融合了 GDB 故障定位、IR Dump 分析、目标代码倒推(AOT)的诊断能力。提供从环境检查、错误定位、AOT验证到 C++ Pass 修复的端到端工作流。. Tilelang Error Fixer is an agent skill from tile-ai/tilelang-ascend.

When should I use Tilelang Error Fixer?

Tilelang Error Fixer fits situations like: development work in your project.

How do I install Tilelang Error Fixer in Claude Code?

Run `npx skills add tile-ai/tilelang-ascend --skill tilelang-error-fixer -a claude-code`. Or copy the skill folder (.agents/skills/tilelang-custom-skill/tilelang-error-fixer in tile-ai/tilelang-ascend) into .claude/skills/tilelang-error-fixer in your project. Claude Code loads it when a task matches its description.

How do I install Tilelang Error Fixer in Codex?

Run `npx skills add tile-ai/tilelang-ascend --skill tilelang-error-fixer -a codex`. Or copy the skill folder (.agents/skills/tilelang-custom-skill/tilelang-error-fixer in tile-ai/tilelang-ascend) into .agents/skills/tilelang-error-fixer in your project. Codex loads it when a task matches its description.

Can I use Tilelang Error Fixer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tile-ai/tilelang-ascend --skill tilelang-error-fixer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tilelang-error-fixer, .gemini/skills/tilelang-error-fixer, .github/skills/tilelang-error-fixer and .opencode/skills/tilelang-error-fixer in your project.

What does Tilelang Error Fixer need to run?

Going by SKILL.md and its folder, Tilelang Error Fixer needs the command-line tools its instructions call (make). Our summary lists: Python 3.

Does Tilelang Error Fixer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Tilelang Error Fixer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tilelang Error Fixer use?

Tilelang Error Fixer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tilelang Error Fixer use?

About 925 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tilelang Error Fixer?

Skills that share tags, products or a category with Tilelang Error Fixer: Qt C++ Code Review (x-tools-author/x-tools, 1.1k stars), YugabyteDB ASH Instrumentation (yugabyte/yugabyte-db, 11k stars), pybind11 Release Preparation (pybind/pybind11, 18k stars) and Qt Cpp Review (Serial-Studio/Serial-Studio, 7.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tilelang Error Fixer?

tile-ai (a GitHub organization) maintains it in tile-ai/tilelang-ascend, which has 400 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 8, 2026.

Source: tile-ai/tilelang-ascend on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.