rocm-kernels

rocm-kernels is a skill for Claude Code from huggingface/kernels. It costs 93 tokens per session (6,420 once invoked), scanned A, original, Apache-2.0.

Development guidance for writing and testing Triton code that runs optimized operations on AMD GPUs through ROCm, AMD's GPU software platform.

In plain words
What is it for?
Implementing, injecting, benchmarking, and tuning RMSNorm, RoPE 3D, GEGLU, and AdaLN kernels in Hugging Face Diffusers and Transformers pipelines.
Why use it?
It provides project-specific patterns for checking and improving GPU kernels used by image, video, and language-model libraries.

Skill for Claude Code ✓ vendor

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions OpenCode.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python scripts/ltx_kernel_injection_example.py.

Good fit Implementing, injecting, benchmarking, and tuning RMSNorm, RoPE 3D, GEGLU, and AdaLN kernels in Hugging Face Diffusers and Transformers pipelines.

Compare 6 skills from other repositories ↓
About the project

Hugging Face Kernels is a system that lets Python libraries and applications load compute kernels directly from the Hugging Face Hub. It is used by Python and PyTorch developers who need portable kernels that can support multiple versions and build configurations. The catalogue skills help agents work with the kernels system and its kernel-building tools.

huggingface/kernels · 774 stars · on GitHub · huggingface.co

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/huggingface/kernels
agentmods
npx agentmods add skills/huggingface/kernels/rocm-kernels

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rocm-kernels

README.md
[![agentmods](https://agentmods.dev/badge/skills/huggingface/kernels/rocm-kernels/github.svg)](https://agentmods.dev/skills/huggingface/kernels/rocm-kernels)
Your own site
<a href="https://agentmods.dev/skills/huggingface/kernels/rocm-kernels"><img src="https://agentmods.dev/badge/skills/huggingface/kernels/rocm-kernels/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rocm-kernels

Your own site · 80×15
<a href="https://agentmods.dev/skills/huggingface/kernels/rocm-kernels"><img src="https://agentmods.dev/badge/skills/huggingface/kernels/rocm-kernels.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,420 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00093 $0.06420
Opus 5.5 $0.00037 $0.02568
Sonnet 5.5 $0.00019 $0.01284
Haiku 4.5 $0.00009 $0.00642

Measured 1mo ago against content hash 4abfad8e0ef0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rocm-kernels scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/benchmark_e2e.py, scripts/benchmark_kernels.py, scripts/huggingface_kernels_example.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

kernel-builder/skills/rocm-kernels/SKILL.md · 509 lines

How it starts

The opening of the file, as written. The whole thing — 509 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ROCm Triton Kernels for Diffusers & Transformers

This skill provides patterns and guidance for developing optimized Triton kernels targeting AMD GPUs (MI355X, R9700) on ROCm, for use with HuggingFace diffusers (LTX-Video, SD3, FLUX) and transformers libraries.

Quick Start

Diffusers (LTX-Video)

Inject optimized kernels into LTX-Video pipeline:

import os
os.environ['TRITON_HIP_USE_BLOCK_PINGPONG'] = '1'
os.environ['TRITON_HIP_USE_ASYNC_COPY'] = '1'

from diffusers import LTXPipeline
pipe = LTXPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16)
pipe.to("cuda")  # ROCm uses same API via HIP
inject_optimized_kernels(pipe)  # BEFORE CPU offloading
pipe.enable_model_cpu_offload()

For a minimal integration example (~150 lines):

python scripts/ltx_kernel_injection_example.py

Isolated Kernel Micro-benchmarks

# All 4 kernels: correctness + performance + bandwidth
python scripts/benchmark_kernels.py

# Single kernel
python scripts/benchmark_kernels.py --kernel rmsnorm
python scripts/benchmark_kernels.py --kernel rope
python scripts/benchmark_kernels.py --kernel geglu
python scripts/benchmark_kernels.py --kernel adaln

End-to-End Pipeline Benchmark

# Compare baseline vs Triton vs torch.compile
python scripts/benchmark_e2e.py --mode all

# Quick test
python scripts/benchmark_e2e.py --mode triton --num-frames 9 --steps 5

# Save results for comparison
python scripts/benchmark_e2e.py --mode all --output-json results.json

Target Model: LTX-Video

Architecture Overview

Component Class Has Weight Count Kernel
transformer_blocks.*.norm1 RMSNorm No (elementwise_affine=False) 56 RMSNorm
transformer_blocks.*.norm2 RMSNorm No 56 RMSNorm
transformer_blocks.*.attn1.norm_q torch.nn.RMSNorm Yes 28 RMSNorm
transformer_blocks.*.attn1.norm_k torch.nn.RMSNorm Yes 28 RMSNorm
transformer_blocks.*.ff FeedForward - 28 GELU (not GEGLU!)
Rotary position encoding LTXVideoRotaryPosEmbed - 1 RoPE 3D

Read the full file on GitHub · 509 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 509 lines · 93 tokens per session scan A 4abfad8e0ef0

Subscribe to this mod's changes

rocm-kernels is a skill published in the GitHub repository huggingface/kernels (774 stars, last pushed yesterday), licensed Apache-2.0. It adds 93 tokens to every session and 6,420 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

jupyter-notebook

Iterative Python via live Jupyter kernel (hamelnb).

NousResearch/hermes-agent · 18 tokens

matlab

Builds, reviews, migrates, and plans MATLAB or GNU Octave numerical workflows. Use for arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 44 tokens

pennylane

Builds and differentiates PennyLane quantum circuits, hybrid PyTorch or JAX models, molecular VQE and QAOA workflows. Use for variational quantum algorithms, quantum machine learning, simulator validation, and moving validated circuits to provider plugins. For hardware-specific compilation use qiskit or cirq; for…

K-Dense-AI/scientific-agent-skills · 74 tokens

cuopt-numerical-optimization-api

LP, MILP, and QP (beta) with cuOpt — Python, C, and CLI. Use when the user is solving LP, MILP, or QP with any cuOpt interface.

NVIDIA/skills · 51 tokens

gh-address-comments

Help address review/issue comments on the open GitHub PR for the current branch using gh CLI; verify gh auth first and prompt the user to authenticate if not logged in.

foryourhealth111-pixel/Vibe-Skills · 39 tokens

pymatgen-materials

Materials science computation with pymatgen. Use when: (1) crystal structure creation and manipulation, (2) phase diagram construction, (3) electronic structure analysis, (4) symmetry and space group operations, (5) VASP input/output parsing. NOT for: molecular chemistry (use rdkit-chemistry), protein structure (use…

beita6969/ScienceClaw · 91 tokens