diffusion-kernel

Develop and optimize CUDA and Triton kernels for diffusion models in SGLang.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/rayleizhu/sglang --skill diffusion-kernel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diffusion-kernel
Source: https://github.com/rayleizhu/sglang/tree/main/python/sglang/multimodal_gen/.claude/skills/diffusion-kernel
Command: npx skills add https://github.com/rayleizhu/sglang --skill diffusion-kernel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill provides tools and guidance to optimize the performance of diffusion model kernels, reducing inference latency and improving throughput.

Core Features & Use Cases

  • Kernel Development: Guides for writing custom CUDA and Triton kernels for diffusion models.
  • Performance Analysis: Tools for profiling and benchmarking kernel performance using Nsight Compute and Triton.
  • Optimization Strategies: Best practices for memory access, occupancy, and precision tuning on various GPU architectures (H100, A100, T4).
  • Use Case: A developer wants to speed up the RMSNorm operation in a diffusion model. They can follow the add-cuda-kernel.md guide to implement a highly optimized JIT CUDA kernel, test its correctness, benchmark its performance against PyTorch, and profile it with Nsight Compute to ensure it saturates GPU bandwidth.

Quick Start

Use the diffusion-kernel skill to add a new Triton kernel for fused elementwise operations.

Frequently Asked Questions about diffusion-kernel

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

FAQPage Schema
How do I optimize CUDA and Triton kernels for diffusion models?

You can optimize diffusion model kernels by following development guides to write custom JIT CUDA and Triton kernels, benchmarking them against PyTorch, and profiling with Nsight Compute to saturate GPU bandwidth.

What is the best way to profile GPU kernel performance for diffusion models?

The best way to profile diffusion model GPU kernels is using Nsight Compute and Triton benchmarks to analyze performance, achieve optimal memory bandwidth, and improve compute utilization across architectures.

Can I use custom Triton kernels for fused elementwise operations in diffusion models?

Yes, you can use Triton kernels for fused elementwise operations in diffusion models, leveraging JIT compilation and provided reference templates to implement and test them within your framework.

Does this kernel optimization workflow support different GPU architectures like H100 and A100?

Yes, the kernel optimization workflow supports GPU architectures including H100, A100, and T4, providing specific best practices for memory access, occupancy, and precision tuning for each.

How do I speed up RMSNorm operations in a diffusion model?

You can speed up RMSNorm operations by following the add-cuda-kernel guide to implement a highly optimized JIT CUDA kernel, test correctness, benchmark against PyTorch, and profile with Nsight Compute.