liger-kernel-perf

Profile, generate variants, and validate Liger Kernel Triton kernels for NVIDIA GPUs.

6.6k|578|Updated Aug 6, 2024
One-click install
npx skills add https://github.com/linkedin/Liger-Kernel --skill liger-kernel-perf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: liger-kernel-perf
Source: https://github.com/linkedin/Liger-Kernel/tree/main/.claude/skills/liger-kernel-perf
Command: npx skills add https://github.com/linkedin/Liger-Kernel --skill liger-kernel-perf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The skill automates the end‑to‑end tuning of Liger Kernel Triton kernels, eliminating the manual effort of profiling, diagnosing bottlenecks, generating variant implementations, and validating correctness.

Core Features & Use Cases

  • Profiling: Detects whether a kernel is memory‑bound or compute‑bound and records a detailed optimization profile.
  • Variant Generation: Systematically sweeps parameters and applies diagnosis‑driven strategies from a catalog of optimizations.
  • Safety Gates: Runs smoke tests, full test suites, and checkstyle checks before any code change is applied.
  • Finalization: Commits the winning variant, produces comparison plots, and creates a PR with only the necessary changes.
  • Use Cases: Speed up inference, lower memory footprint, or balance both for kernels like rms_norm, cross_entropy, or any custom Liger kernel on NVIDIA GPUs.

Quick Start

Ask the skill to optimize the rms_norm kernel for faster inference on an Ampere GPU.

Frequently Asked Questions about liger-kernel-perf

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

FAQPage Schema
How do I optimize Triton kernels for better GPU performance?

To optimize Triton kernels for better GPU performance, you can profile existing kernels to detect memory or compute bottlenecks, generate parameter variants, and benchmark them to select the fastest configuration for your specific NVIDIA GPU.

How do I reduce memory usage of Liger kernels during inference?

To reduce memory usage of Liger kernels during inference, you can systematically sweep kernel parameters and apply diagnosis-driven optimization strategies to generate variants with a lower memory footprint while ensuring correctness.

How does profiling identify if a Triton kernel is memory-bound or compute-bound?

Profiling identifies whether a Triton kernel is memory-bound or compute-bound by recording a detailed optimization profile during execution, which then drives the generation of targeted variant implementations to overcome the specific bottleneck.

Can I tune Liger kernels for specific NVIDIA GPU architectures like Ampere or Hopper?

Yes, you can tune Liger kernels for specific NVIDIA GPU architectures like Ampere, Hopper, or Blackwell by profiling the kernel on your target hardware and selecting the best-performing configuration variant from the generated sweep.

Do I need a CUDA-capable GPU to run Triton kernel benchmarking?

Yes, you need a CUDA-capable GPU and a development environment with Triton and Python installed to run Triton kernel benchmarking and validate the correctness of the optimized variants.

What is the best way to automate Triton kernel tuning without breaking existing tests?

The best way to automate Triton kernel tuning without breaking existing tests is to run safety gates that execute smoke tests, full test suites, and checkstyle checks before applying any code changes to the winning variant.