cuda-kernels

Benchmark optimized CUDA kernels for diffusers and transformers on NVIDIA GPUs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you get faster inference and better GPU utilization by using optimized CUDA kernels for common transformer workloads instead of relying only on baseline implementations.

Core Features & Use Cases

  • Benchmark and compare performance for end-to-end diffusion video generation and isolated micro-kernels like RMSNorm.
  • Guide CUDA kernel development and optimization for NVIDIA GPUs (H100, A100, T4) with architecture-specific tuning patterns.
  • Integrate pre-compiled kernels from the Hugging Face Kernels Hub using get_kernel, avoiding local compilation when possible.
  • Use practical integration patterns to inject kernels into diffusers pipelines and patch transformers RMSNorm for faster execution.

Quick Start

Run the end-to-end diffusers benchmark with optimized CUDA kernels by executing the command: python generate_video.py --use-optimized-kernels

Frequently Asked Questions about cuda-kernels

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

FAQPage Schema
How do I accelerate diffusers and transformers workloads with CUDA kernels?

Inject optimized CUDA kernels into diffusers pipelines or patch transformers RMSNorm for faster execution, replacing baseline implementations to improve runtime performance and GPU utilization on NVIDIA hardware.

Can I use pre-compiled CUDA kernels from the Hugging Face Hub to avoid local compilation?

Yes, you can load pre-compiled kernels from the Hugging Face Kernels Hub using the get_kernel function, bypassing local compilation and directly applying them to your transformer or diffuser pipelines.

How do I benchmark CUDA kernel performance for diffusion video generation?

You can run end-to-end diffusers benchmarks using provided scripts to measure speedup and memory behavior, comparing optimized CUDA kernels against baseline implementations for tasks like LTX-Video generation.

Does this CUDA kernel optimization support older NVIDIA GPUs like the T4, or only H100 and A100?

Architecture-aware optimization guidance is provided for multiple NVIDIA GPU architectures, specifically including H100, A100, and T4, ensuring tuned kernel performance across different hardware tiers.

What is the best way to patch transformers RMSNorm for faster LLM execution?

The best way to patch transformers RMSNorm is by applying practical integration patterns to replace the default execution with optimized CUDA kernels, directly accelerating LLM workloads on NVIDIA GPUs.

Why do I need the Nix dependency to use these CUDA kernel integration scripts?

Nix is required as a dependency to ensure reproducible environment setup and package management for executing the kernel benchmarking scripts and integration patterns across your NVIDIA GPU hardware.