kernel-triton-writing

Design, implement, verify and benchmark Triton kernels with fixed contracts and built-in harnesses.

2.8k|332|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/NVIDIA/skills --skill kernel-triton-writing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kernel-triton-writing
Source: https://github.com/NVIDIA/skills/tree/main/skills/TensorRT-LLM/kernel-triton-writing
Command: npx skills add https://github.com/NVIDIA/skills --skill kernel-triton-writing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Triton kernel development is complex and requires a structured workflow to design, implement, verify, and benchmark kernels that integrate with a fixed contract (kernel_fn, reference_fn, get_inputs) and a library of patterns (elementwise, reductions, tiled GEMM, and flash attention). The workflow articulates a repeatable process from request routing through design, implementation, verification, and optional benchmarking to ensure correctness and performance.

Core Features & Use Cases

  • Phase-driven kernel development: route ambiguous requests, analyze operators, design and implement kernels, verify correctness, and benchmark performance.
  • Pattern coverage: supports elementwise, reductions (softmax, LayerNorm, RMSNorm), matmul/gemm tiling, Flash Attention, and fusion patterns as documented in references.
  • Fixed-contract exports: standardized kernel_fn wrapper, reference_fn, and get_inputs for compatibility with the verification and benchmarking harness.

Quick Start

Describe your kernel requirement and the system will generate a ready-to-run Triton kernel following the fixed-contract workflow.

Frequently Asked Questions about kernel-triton-writing

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

FAQPage Schema
How do I write a Triton kernel for fused operations like softmax and LayerNorm?

Use a guided phase-driven workflow to design, implement, and verify fused Triton kernels like softmax and LayerNorm, exporting standard functions to validate correctness and benchmark GPU performance.

What is the best way to verify and benchmark custom GPU kernels?

Verify and benchmark GPU kernels by leveraging a fixed-contract workflow that exports reference functions and inputs, running built-in harnesses to validate correctness and measure performance automatically.

Can I implement tiled GEMM and Flash Attention using a structured Triton workflow?

Yes, implement tiled GEMM and Flash Attention using a structured phase-driven workflow that guides operator analysis, kernel implementation, and built-in verification to ensure high-performance GPU execution.

Does writing Triton kernels require a specific module structure for testing?

Yes, writing Triton kernels requires a fixed-contract module structure that exports kernel_fn, reference_fn, and get_inputs to ensure compatibility with built-in verification and benchmarking harnesses.

What are common fusion patterns supported for Triton kernel development?

Supported Triton fusion patterns include elementwise operations, reductions like RMSNorm, tiled GEMM, and Flash Attention, all validated through a standardized phase-driven implementation and benchmarking workflow.