rocm-kernels

Develop and benchmark ROCm-optimized Triton kernels for diffusion and transformer workloads.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, triton, diffusers, transformers, accelerate, safetensors, huggingface-hub, imageio, imageio-ffmpeg, kernels, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps engineers build and validate optimized Triton kernels for AMD GPUs on ROCm so they can speed up diffusion and transformer pipelines without manual low-level debugging.

Core Features & Use Cases

  • Kernel optimization guidance: RMSNorm, RoPE 3D, GEGLU, and AdaLN patterns tuned for MI355X (gfx950) and R9700 (gfx1201), including ROCm-specific constraints.
  • Correctness guardrails: concrete pitfalls like wrong BLOCK_D handling, RoPE cos/sin indexing that crashes for batch>1, and ROCm-missing math functions with safe replacements.
  • Integration + benchmarking: diffusers injection patterns for LTX-Video (and notes for transformers/Hub workflows) plus micro-benchmarks and end-to-end pipeline timing.
  • Use case: You’re targeting LTX-Video on ROCm and want faster RMSNorm/attention-related execution by injecting custom Triton kernels, then confirm speedups with repeatable benchmark artifacts.

Quick Start

Run the end-to-end LTX-Video pipeline benchmark in Triton mode with: python scripts/benchmark_e2e.py --mode triton --num-frames 25 --steps 30 --warmup 1 --output-dir examples/ltx-video-benchmark

Frequently Asked Questions about rocm-kernels

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

FAQPage Schema
How do I write and inject custom Triton kernels for ROCm in diffusers?

Injecting custom Triton kernels for ROCm in diffusers involves using specific injection patterns for pipelines like LTX-Video, replacing default operations with optimized RMSNorm and attention kernels for AMD GPUs.

Does Triton on ROCm support all standard math functions for transformer workloads?

Triton on ROCm lacks certain standard math functions required for transformer workloads. You must apply ROCm-compatible math workarounds and safe replacements to execute custom kernels correctly on AMD GPUs.

What's the best way to benchmark end-to-end LTX-Video pipeline performance on AMD GPUs?

Benchmark LTX-Video on AMD GPUs by running the end-to-end pipeline script in Triton mode with specified frame and step counts, generating repeatable artifacts to validate execution speedups.

Why does my RoPE 3D kernel crash on AMD GPUs when processing batches larger than one?

RoPE 3D kernels crash on AMD GPUs for batches larger than one due to incorrect cos/sin indexing. Correcting the RoPE cos/sin indexing logic resolves the batch execution crash.

How do I handle dynamic BLOCK_D configurations for RMSNorm kernels on MI355X?

Handling dynamic BLOCK_D for RMSNorm on MI355X requires deterministic kernel launch configurations. Incorrect BLOCK_D handling causes correctness issues, necessitating specific parameter constraints.