← Explore all skills

MODEL DEVELOPMENT / Hugging Face

Portable Triton Kernels

Writes and benchmarks portable Triton kernels for NVIDIA and AMD GPUs: block-size discipline, autotune configuration, fp16/bf16/fp8 numerics, masked loads, reductions, correctness tests against a PyTorch reference and publishing to the Kernels Hub.

“Provides guidance for writing and benchmarking portable Triton kernels targeting NVIDIA and AMD GPUs. Covers core DSL patterns, @triton.autotune, numerics (fp16/bf16/fp8), masked loads, reductions, tiling, benchmarking harness, correctness testing, and integration with HuggingFace Kernels Hub (get_kernel).”

01 / THE REASONING

Why this made the selection.

  • Its hard constraints encode the silent-failure traps: never autotune BLOCK_SIZE when it controls the reduction axis because partial rows give wrong results silently, and masked loads need a safe other value.
  • Stays vendor-neutral in the core and points to sibling rocm-kernels and xpu-kernels skills for backend-specific tuning, with a patterns reference that shows in-SRAM mask generation cutting dropout memory traffic from roughly 6N to 2N.

02 / THE REVIEW RECORD

What we actually inspected.

Source review has boundaries.
A clear record is more useful than a “safe” badge.

Material inspected

  • kernel-builder/skills/triton-kernels/SKILL.md
  • kernel-builder/skills/triton-kernels/references/kernel-patterns.md
  • LICENSE

Our findings

  • The frontmatter exposes an argument hint enumerating kernel types and workflows (autotune, benchmark, correctness, get_kernel, transformers, diffusers) and limits tools to Read, Grep, Glob and Bash.
  • The patterns reference demonstrates in-SRAM random-mask generation for dropout so the mask is consumed immediately, with the memory-traffic arithmetic stated.
  • The skill routes backend-specific tuning to sibling skills rather than mixing vendor details into the portable core.

Not established by this review

  • No Triton kernel was written, compiled or benchmarked.
  • No kernel was published to the Kernels Hub.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

Add a skill to your workflow.

Upstream setup instructions ↗

DOCUMENTED COMMAND

npx skills add huggingface/kernels/kernel-builder/skills/triton-kernels

Run in your terminal to choose your AI tools, project or global scope, and installation method. This short command follows the current upstream version; the review covers the revision shown above.

Optional: install the reviewed revision

Keeps the original source and installer version where recorded, while leaving your AI tools and installation scope for you to choose.

npx skills add https://github.com/huggingface/kernels/tree/a7a21b11c8c378dc3b720e00be04085f7486b39c/kernel-builder/skills/triton-kernels
  1. Install the complete skill directory with its references and scripts; the patterns and benchmarking guides carry the concrete guidance.
  2. Choose your AI tools and project or global scope in the installer, then review its permissions before using the skill.

Before you start

  • Node.js/npm for this installer
  • An agent that supports the Agent Skills format
  • A Triton-capable environment: NVIDIA or AMD GPU with the matching toolchain, PyTorch for reference tests

04 / FOLLOW THE EVIDENCE

The source trail.

Our notes are separate from the original resource.
Check upstream before adopting a new version.

  1. https://github.com/huggingface/kernels/blob/a7a21b11c8c378dc3b720e00be04085f7486b39c/kernel-builder/skills/triton-kernels/SKILL.md

    Supports: summary, upstreamDescription, whySelected, bestFor, limitations, review, compatibility, access

  2. https://github.com/huggingface/kernels/blob/a7a21b11c8c378dc3b720e00be04085f7486b39c/kernel-builder/skills/triton-kernels/references/kernel-patterns.md

    Supports: review, whySelected, bestFor

  3. https://github.com/huggingface/kernels/blob/a7a21b11c8c378dc3b720e00be04085f7486b39c/LICENSE

    Supports: license

  4. https://github.com/huggingface/kernels/blob/a7a21b11c8c378dc3b720e00be04085f7486b39c/README.md

    Supports: install, compatibility, access

  5. https://github.com/vercel-labs/skills/blob/7407f3893ad4dceab546ac002c3ef806e4000c73/README.md

    Supports: install

Evidence & Ask