cuda-kernels

Develop and benchmark optimized CUDA kernels for HuggingFace diffusers and transformers.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/m0at/claudemd --skill cuda-kernels-m0at
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cuda-kernels
Source: https://github.com/m0at/claudemd/tree/main/skills/cuda-kernels
Command: npx skills add https://github.com/m0at/claudemd --skill cuda-kernels-m0at

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

CUDA kernel development and benchmarking guidance for NVIDIA GPUs used with HuggingFace diffusers and transformers. It helps practitioners design, implement, and benchmark custom CUDA kernels, compare against baseline implementations, and integrate with the HuggingFace Kernels Hub for loading pre-compiled kernels on H100, A100, and T4.

Core Features & Use Cases

  • Core kernel patterns (RMSNorm, RoPE, GEGLU, AdaLN) for diffusion models and LLMs.
  • Benchmarking workflows to compare optimized kernels against baseline PyTorch implementations, including end-to-end video generation and micro-benchmarks.
  • Hub integration and diffusers/transformers integration patterns to load and apply external kernels with minimal code changes.
  • Use Case: Designers debugging kernel performance or building custom CUDA ops for diffusers pipelines and transformer models.

Quick Start

Run the end-to-end and RMSNorm benchmarks to compare optimized kernels against baseline implementations.

Frequently Asked Questions about cuda-kernels

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

FAQPage Schema
How do I benchmark custom CUDA kernels against baseline PyTorch implementations?

To benchmark custom CUDA kernels against baseline PyTorch implementations, run the provided end-to-end video generation and micro-benchmark scripts. These workflows compare optimized kernel performance against baseline implementations to measure GPU acceleration gains on NVIDIA H100, A100, and T4 hardware.

How do I integrate pre-compiled CUDA kernels from HuggingFace Kernels Hub into diffusers pipelines?

Integrate pre-compiled CUDA kernels from HuggingFace Kernels Hub into diffusers pipelines using the get_kernel function. This integration pattern allows loading and applying external kernels with minimal code changes to your existing transformers and diffusers workflows.

What CUDA kernel patterns are available for optimizing diffusion models and LLMs?

Available CUDA kernel patterns for optimizing diffusion models and LLMs include RMSNorm, RoPE, GEGLU, and AdaLN. These core patterns provide optimized implementations for common operations in transformer architectures and diffusion pipelines.

Can I use this to write new CUDA kernels for NVIDIA GPUs running HuggingFace diffusers?

Yes, you can write new CUDA kernels for NVIDIA GPUs running HuggingFace diffusers. It provides guidance for developing custom CUDA operations targeting diffusion models and LLMs, with practical patterns and integration guides for GPU-accelerated AI workloads.

Do I need PyTorch and diffusers installed to benchmark CUDA kernel performance?

Yes, PyTorch and diffusers are required dependencies to benchmark CUDA kernel performance. The benchmarking workflows also depend on transformers, numpy, and accelerate to compare optimized kernels against baseline implementations in end-to-end video generation scenarios.

Why should I use custom CUDA kernels instead of standard PyTorch operations for HuggingFace transformers?

Custom CUDA kernels provide optimized execution for specific operations like RMSNorm and RoPE compared to standard PyTorch operations. Benchmarking workflows demonstrate measurable performance improvements on NVIDIA GPUs, particularly for compute-intensive diffusion model and LLM workloads.