triton-operator-code-review

Analyze Triton operator code for static defects and Ascend NPU compliance.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Triton 操作符的静态检视,帮助发现 Host/Device 侧潜在缺陷、API 使用误差与性能隐患,确保在 Ascend NPU 上的正确性与可维护性。

Core Features & Use Cases

  • 静态分析:针对 Triton/Host 与 Device 内核进行全面的静态检查,发现硬编码、内存风险、精度问题等。
  • 合规性检查:确保对 tl.load/tl.store 的 mask 要求、BLOCK_SIZE、数据类型约束等规则的符合性。
  • Use Case:在开发 CI 流水线中对 Triton 辅助内核进行一次性合规评审,生成代码审查报告。

Quick Start

Provide a static review of a Triton operator kernel and generate a compliance report.

Frequently Asked Questions about triton-operator-code-review

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

FAQPage Schema
How do I perform a static code review on Triton kernels for Ascend NPU?

To perform static code review on Triton kernels for Ascend NPU, analyze host and device code to identify misuses and static defects. This enforces masking for tl.load/tl.store, checks constexpr BLOCK sizes, and validates supported dtypes for dot inputs.

What are the common Triton API misuses that affect Ascend NPU execution?

Common Triton API misuses affecting Ascend NPU execution include missing masks for tl.load/tl.store operations, unaligned BLOCK sizes, unsupported dot input dtypes, and implicit out_dtype handling during reductions, which static analysis can detect.

Can I integrate Triton static analysis into my development CI pipeline?

Yes, you can integrate Triton static analysis into your development CI pipeline. It performs one-time compliance reviews of Triton auxiliary kernels, generating code review reports that ensure security, correctness, and performance before deployment.

Does Ascend NPU require constexpr BLOCK sizes to be aligned to specific multiples?

Ascend NPU requires constexpr BLOCK sizes to be aligned to 16 multiples. Static analysis enforces this constraint during Triton kernel code review to ensure correct memory access patterns and optimal hardware utilization.

Why does my Triton reduction operation fail precision checks on Ascend NPU?

Triton reduction operations fail precision checks on Ascend NPU when missing explicit out_dtype handling. Static code review identifies these precision issues by requiring explicit output data type declarations during reduction operations.

What is the best way to check Triton code compliance for memory safety and hardcoded values?

The best way to check Triton code compliance for memory safety and hardcoded values is running a comprehensive static analysis scan. It detects hardcoded values, memory risks, and precision problems across both Host and Device kernels.