triton-operator-code-gen

Generate Triton kernels from Ascend NPU operator designs with smoke tests.

31|1|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/Ascend/agent-skills --skill triton-operator-code-gen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: triton-operator-code-gen
Source: https://github.com/Ascend/agent-skills/tree/main/skills/triton-operator-code-gen
Command: npx skills add https://github.com/Ascend/agent-skills --skill triton-operator-code-gen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

通过将 Ascend NPU 算子设计文档转化为 Triton kernel 代码,降低实现门槛并缩短从设计到可执行实现的周期,同时附带基础正确性测试以确保实现符合设计意图。

Core Features & Use Cases

  • 将算子设计文档自动转译为可编译的 Triton kernel,并附带基本正确性测试。
  • 支持输入/输出规格、分块策略和模板映射等工作流要点,帮助开发者快速落地实现。
  • Use Case: 当需要实现新算子时,从设计输入生成为可运行的内核代码及烟雾测试,用于快速验证正确性。

Quick Start

Generate Triton kernel code from an Ascend NPU operator design and run the included smoke test with your design input.

Frequently Asked Questions about triton-operator-code-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Triton kernels from operator design documents?

To generate Triton kernels from operator designs, provide your design document specifying input/output specs and tiling strategies. The system maps operator types to Triton templates and outputs executable kernel code with basic correctness tests.

What is the process for deploying Triton kernels on Ascend NPU?

Deploying Triton kernels on Ascend NPU involves mapping operator types to Triton templates and selecting correct AI or Vector core counts for kernel deployment. The process outputs executable kernels with smoke tests verifying compilation and basic correctness.

Can I use this to generate code for custom Ascend NPU operators?

Yes, you can generate code for custom Ascend NPU operators by providing a design document. The system supports various operators by mapping them to appropriate Triton templates and producing both executable kernels and smoke tests for verification.

Does the generated Triton kernel code include correctness tests?

Yes, the generated Triton kernel code includes basic correctness tests. The system produces smoke tests that verify compilation and basic correctness, ensuring the implementation aligns with the original operator design intent.

What's the best way to handle tiling strategies when generating Triton kernels?

The best way to handle tiling strategies is to specify them in your operator design document. The system uses these tiling strategies alongside input/output specifications and template selection to produce correctly structured Triton kernels for Ascend NPU deployment.

Why do I need to specify AI or Vector core counts for Triton kernel deployment?

You need to specify AI or Vector core counts because Ascend NPU requires correct core allocation for kernel deployment. The system maps operator types to Triton templates and uses the appropriate core counts to ensure the generated kernel executes correctly on the hardware.