triton-operator-precision-eval

Benchmark Triton operator precision against PyTorch references and generate MERE/MARE reports.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires triton, torch, torch_npu, pytest, numpy, and includes scripts (resource) components.

What problem does it solve?

Triton 算子精度评估。通过与 PyTorch 参考实现对比,自动计算误差指标并生成标准化精度报告,确保在进行性能优化前算子数值正确性。

Core Features & Use Cases

  • 基于 Torch 参考实现(标杆)与多种 shape × dtype 组合的对比,生成一致的精度报告。
  • 自动化输出:包括 MERE、MARE、最大相对误差等指标,以及可复现的精度报告。
  • 使用场景:验证新 Triton 内核在生产管线中的数值一致性,保障与 PyTorch 参考实现的一致性。

Quick Start

Run the precision evaluation to compare Triton operator outputs against PyTorch references and generate the precision report.

Frequently Asked Questions about triton-operator-precision-eval

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

FAQPage Schema
How do I verify Triton operator precision against a PyTorch reference implementation?▼

You can verify Triton operator precision by benchmarking outputs against PyTorch reference implementations across diverse shapes, dtypes, and epsilon settings to produce a standardized accuracy report.

What metrics are used for Triton kernel accuracy verification?▼

Triton kernel accuracy verification uses MERE, MARE, and maximum relative error metrics to calculate error against PyTorch references and generate a reproducible precision report.

How do I automate precision evaluation for a fused Triton kernel?▼

Automating precision evaluation for a fused Triton kernel involves running an end-to-end workflow that compares kernel outputs with PyTorch references and automatically generates a report with error metrics.

Do I need pytest and numpy to benchmark Triton operators?▼

Yes, you need pytest and numpy, along with triton, torch, and torch_npu, to execute the benchmarking scripts that compare operator outputs and validate numerical consistency.

What is the best way to ensure numerical consistency before optimizing Triton operators?▼

The best way to ensure numerical consistency before performance optimization is to run automated precision verification that validates your Triton operator against a PyTorch reference implementation across multiple configurations.

Why does my Triton operator output mismatch the PyTorch reference across different shapes?▼

Mismatches across different shapes occur because precision varies by dtype and shape configurations; running a comprehensive benchmark evaluation identifies these specific numerical inconsistencies.