cuda-kernels

Develop, benchmark, and integrate CUDA kernels for HuggingFace Diffusers and Transformers.

4|2|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/drunkcoding/AgentSkillsArxiv --skill cuda-kernels-drunkcoding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cuda-kernels
Source: https://github.com/drunkcoding/AgentSkillsArxiv/tree/main/skills/huggingface-kernels/cuda-kernels
Command: npx skills add https://github.com/drunkcoding/AgentSkillsArxiv --skill cuda-kernels-drunkcoding

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, diffusers, transformers, accelerate, numpy, kernels, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Provides patterns, guides, and tooling to write, benchmark, and integrate optimized CUDA kernels for diffusion models and large language models, enabling measurable speedups and easier maintenance across HuggingFace Diffusers and Transformers ecosystems.

Core Features & Use Cases

  • Kernel patterns for RMSNorm, RoPE, GEGLU, AdaLN, and micro-benchmarks to accelerate diffusion and LLM workloads
  • Integration guidance with HuggingFace Kernels Hub (get_kernel) for loading pre-compiled kernels
  • Benchmark scripts and examples that compare optimized kernels against baseline implementations on CUDA GPUs
  • End-to-end workflows showing Diffusers and Transformers pipeline integration, testing, and deployment readiness

Quick Start

Run the included benchmarking and integration examples to reproduce and adapt optimized CUDA kernels for Diffusers and Transformers.

Frequently Asked Questions about cuda-kernels

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

FAQPage Schema
How do I optimize CUDA kernels for HuggingFace Diffusers and Transformers?

You optimize CUDA kernels for HuggingFace Diffusers and Transformers by developing and benchmarking custom kernels for operations like RMSNorm, RoPE, and GEGLU, then integrating them via the HuggingFace Kernels Hub to achieve measurable GPU speedups.

Can I use custom CUDA kernels to accelerate diffusion models on an A100 or T4 GPU?

Yes, you can accelerate diffusion models on A100, T4, or H100 architectures using custom CUDA kernels. The workflow includes building, benchmarking, and loading pre-compiled kernels to integrate directly with your Diffusers pipelines.

What's the best way to benchmark optimized CUDA kernels against baseline PyTorch implementations?

To benchmark optimized CUDA kernels against baseline PyTorch implementations, run micro-benchmarks using the provided benchmark scripts to compare performance metrics on CUDA GPUs for your specific LLM or diffusion model workloads.

Do I need a specific GPU architecture to load pre-compiled kernels from the HuggingFace Kernels Hub?

Loading pre-compiled kernels from the HuggingFace Kernels Hub requires a CUDA-enabled GPU, specifically targeting H100, A100, or T4 architectures, along with PyTorch and the standard build and integration workflow.

How does get_kernel work for loading pre-compiled kernels in Transformers models?

The get_kernel function loads pre-compiled kernels in Transformers models by fetching optimized CUDA kernels from the HuggingFace Kernels Hub, bypassing local compilation to directly integrate them into your LLM pipeline.