Orchestrates end-to-end Ascend Triton operator development: environment setup, design, code generation, static review, precision validation, performance evaluation, and optimization. Activates when users need to develop a Triton operator from scratch or follow a complete workflow.
Ships in external-gitcode-ascend-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.
None: SKILL.md is the whole skill.
构建 Triton 算子分 7 个阶段(含 1 个条件阶段):
| # | 阶段 | 产出 | Skill | 是否可跳过 |
|---|---|---|---|---|
| 1 | 环境配置 | 环境验证报告 | triton-operator-env-config | 是:torch/torch_npu/triton 已可用 |
| 2 | 需求设计 | 设计文档 | triton-operator-design | 是:用户已提供完整设计文档 |
| 3 | 代码生成 | kernel + smoke test | triton-operator-code-gen | 否 |
| 4 | 静态检视 | 检视报告 | triton-operator-code-review | 否 |
| 5 | 精度验证 | 精度报告 | triton-operator-precision-eval | 否 |
| 6 | 性能评估 | 性能报告 + ratio | triton-operator-performance-eval | 否 |
| 7 | 性能优化 | 优化后代码 | triton-operator-performance-optim | 条件:ratio ≥ 目标则跳过 |
in_progress,完成后 completed| 用户意图 | 正确做法 |
|---|---|
| "开发一个算子"、"从零开发" | 本 skill 全流程 |
| "帮我写算子代码" | 不用本 skill,直接 triton-operator-code-gen |
| "优化算子性能" | 不用本 skill,直接 triton-operator-performance-optim |
| "检查算子精度" | 不用本 skill,直接 triton-operator-precision-eval |
跳过判断:
import torch, torch_npu, triton 且 torch.npu.is_available()docs/context/*.md)或直接给出算子 API 规格调用 Skill(triton-operator-code-gen)。此阶段只生成代码和 smoke test,不运行。
进入下一阶段前:kernel 代码 + 测试文件已写入磁盘
调用 Skill(triton-operator-code-review)。此阶段只静态分析,不运行。
进入下一阶段前:P0/P1 问题已修复
调用 Skill(triton-operator-precision-eval)。
此阶段必须在 NPU 上运行测试。 关键产出:
进入下一阶段前:所有精度测试通过
调用 Skill(triton-operator-performance-eval)。
此阶段必须在 NPU 上运行 benchmark。 关键产出:
触发条件:阶段 6 的 ratio < 用户要求的性能目标。
调用 Skill(triton-operator-performance-optim)。优化后必须重新运行精度验证确认无回归。
| 陷阱 | 症状 | 正确做法 |
|---|---|---|
| 代码生成后停止 | 用户以为开发完成但无验证 | 强制执行阶段 5-6 |
| 精度未通过就优化 | 优化了错误的代码 | 精度通过是优化的前提 |
| 跳过 TaskCreate | 阶段遗漏无法追溯 | 每阶段创建 Task |
| 混淆"生成测试"和"运行测试" | 只有测试文件但从未执行 | 阶段 5-6 必须实际运行 |
全流程完成后,必须在算子目录下输出以下文件:
| 文件 | 内容 | 必须 |
|---|---|---|
{算子名}.py | Kernel 代码 + Host 接口 | 是 |
test_{算子名}.py | Smoke test | 是 |
precision_eval.py | 精度评估脚本 | 是 |
precision_report.md | 精度报告 | 是 |
performance_eval.py | 性能评估脚本 | 是 |
performance_report.md | 性能报告 | 是 |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/external-gitcode-ascend-skills:external-gitcode-ascend-triton-operator-devfrom external-gitcode-ascend-skills
npx claudepluginhub ascend-ai-coding/awesome-ascend-skills --plugin external-gitcode-ascend-skills91 skills in this plugin
/external-gitcode-ascend-analyse-coverage分析测试覆盖率盲区,生成覆盖率分析报告/external-gitcode-ascend-arxiv-recommendation-npu自动化推荐系统论文发现流水线。抓取 arxiv 推荐论文,检测源码,生成待迁移任务清单,由 npu-model-migration skill 完成 NPU 适配。/external-gitcode-ascend-ascendc-operator-code-gen根据设计文档生成 AscendC 算子完整代码实现并完成框架适配。TRIGGER when: 设计文档已完成,需要生成 op_host/op_kernel 代码、注册到 PyTorch 框架、编译测试。关键词:代码生成、op_host、op_kernel、tiling、kernel、框架适配、算子注册。Other plugins' skills for the same job