huggingface avatar

Cuda Kernels

This walks you through writing optimized CUDA kernels for HuggingFace diffusers and transformers on H100, A100, and T4 GPUs. You get kernel templates for RMSNorm, attention, RoPE, and activation functions, plus benchmarking scripts that compare against PyTorch baselines. The included RMSNorm kernel hits 2.67x speedup in microbenchmarks but only 6% end-to-end improvement in LTX-Video generation because normalization is a small fraction of total compute. Worth using if you're already profiling and know which kernels are your bottleneck. The skill includes working examples for both diffusers and transformers integration, architecture-specific optimization guides, and support for loading pre-compiled kernels from HuggingFace Hub to skip local compilation entirely.

skills.sh installs
212
GitHub stars
783
last updated
Aug 21, 2026

Install

$ npx -y skills add huggingface/kernels --skill cuda-kernels --agent claude-code

Installs into .claude/skills of the current project.

Files

CUDA Kernels for Diffusers & Transformers

This skill provides patterns and guidance for developing optimized CUDA kernels targeting NVIDIA GPUs (H100, A100, T4) for use with HuggingFace diffusers and transformers libraries.

Hard Constraints — Read Before Writing Any Code

Kernels MUST build with kernel-builder and meet the Kernel Hub requirements. kernel-builder compiles against the Python limited API (ABI3) so a single binary works for Python 3.9+ across versions. Several patterns that are standard in generic PyTorch-extension tutorials are therefore hard build failures here. Do not use them, even if PyTorch documentation or your training data suggests them.

Disallowed patterns — never generate these

Sponsors

Details

Repository
github.com/huggingface/kernels
Categories
Documentation, Data Science & ML, Debugging, Generative Media
First seen
Jun 3, 2026
1davila7 avatarform-crodavila7/claude-code-templatesWhen the user wants to optimize any form that is NOT signup/registration — including lead capture forms, contact forms, demo request forms, application forms, s211skills.sh installs
2mhattingpete avatarproject-bootstrappermhattingpete/claude-skills-marketplaceSets up new projects or improves existing projects with development best practices, tooling, documentation, and workflow automation. Use when user wants to star211skills.sh installs
3yonatangross avatarcommityonatangross/orchestkitCreates commits with Conventional Commits format (feat/fix/docs/refactor/test/chore), automatic scope detection, co-author attribution, and pre-commit hook comp210skills.sh installs
4borghei avatarui-design-systemborghei/claude-skillsUI design system toolkit covering design tokens, component documentation, responsive calculations, and developer handoff. Use for creating design systems, maint209skills.sh installs
5easychen avataropc-resource-auditeasychen/opc-methodologyInventory all founder resources across 8 categories for a one-person company. Use when Codex needs to systematically confirm what resources the founder has — ex209skills.sh installs
6johnrogers avatarswift-testingjohnrogers/claude-swift-engineeringUse when writing tests with Swift Testing (@Test,209skills.sh installs