benchmark-kernel

Benchmark FlashInfer GPU kernels with CUPTI or CUDA events.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/ariusewy/flashinfer_dev --skill benchmark-kernel-ariusewy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: benchmark-kernel
Source: https://github.com/ariusewy/flashinfer_dev/tree/main/.claude/skills/benchmark-kernel
Command: npx skills add https://github.com/ariusewy/flashinfer_dev --skill benchmark-kernel-ariusewy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires cupti-python, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a structured and accurate method for benchmarking the performance of FlashInfer's GPU kernels, enabling direct comparison between different backends and configurations.

Core Features & Use Cases

  • Accurate Timing: Utilizes CUPTI for precise GPU kernel execution times, falling back to CUDA events when CUPTI is unavailable.
  • Backend Comparison: Allows benchmarking across multiple backends like FlashAttention-2/3, cuDNN, CUTLASS, and TensorRT-LLM.
  • Reproducible Results: Supports generating reproducible benchmark commands and saving results to CSV for analysis.
  • Use Case: A performance engineer needs to determine the fastest attention kernel for their specific hardware and workload. They can use this Skill to run benchmarks for various attention routines with different batch sizes and sequence lengths, comparing the median execution time and achieved TFLOPS across multiple backends.

Quick Start

Run the benchmark for the BatchDecodeWithPagedKVCacheWrapper routine using FlashAttention 2 and cuDNN backends.

Frequently Asked Questions about benchmark-kernel

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

FAQPage Schema
How do I benchmark FlashInfer GPU kernels accurately?

Benchmark FlashInfer GPU kernels accurately by utilizing CUPTI for precise kernel execution timing, which falls back to CUDA events when CUPTI is unavailable. This enables direct performance comparison across different backends and configurations.

Can I compare FlashAttention performance against cuDNN and TensorRT-LLM backends?

Yes, you can compare FlashAttention performance against cuDNN, CUTLASS, and TensorRT-LLM backends. The benchmarking outputs median execution time and achieved TFLOPS to facilitate direct performance comparison across these multiple backends.

What is the best way to measure GPU kernel execution time for attention and GEMM operations?

The best way to measure GPU kernel execution time for attention and GEMM operations is using CUPTI for precise timing. It supports detailed performance analysis by outputting results to CSV for further evaluation across different batch sizes and sequence lengths.

Do I need cupti-python to run FlashInfer performance analysis?

You need the cupti-python dependency to enable precise GPU kernel execution timing via CUPTI. If CUPTI is unavailable, the benchmarking process automatically falls back to using standard CUDA events for timing your FlashInfer kernels.

How do I generate reproducible benchmark commands for MoE operations?

Generate reproducible benchmark commands for MoE operations by using the built-in command generation feature. This supports saving your benchmarking results to CSV format, ensuring detailed analysis and reproducibility across different hardware and workload configurations.

Why does my CUDA events timing differ from CUPTI when benchmarking GPU kernels?

CUDA events timing differs because it serves as a fallback when CUPTI is unavailable. CUPTI provides precise GPU kernel execution measurements, while CUDA events offer standard timing, which may vary slightly during FlashInfer performance analysis.