flashinfer: Skill for Claude Code

.claude/skills/benchmark-kernel/SKILL.md

benchmark-kernel is a skill for Claude Code from flashinfer-ai/flashinfer. It costs 14 tokens per session (3,616 once invoked), scanned B, original, Apache-2.0.

A guide for measuring the execution speed of FlashInfer GPU kernels with CUPTI, a hardware-level GPU timing tool.

In plain words
What is it for?
Measure kernel runtime, compare FlashAttention, cuDNN, CUTLASS, and TensorRT-LLM backends, and save repeatable results to CSV.
Why use it?
It provides consistent timings, uses CUDA events when CUPTI is unavailable, and supports comparisons between different GPU implementations.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is flashinfer-ai/flashinfer's own configuration. It tells Claude Code how to work on flashinfer itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything flashinfer configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python benchmarks/flashinfer_benchmark.py \.

About the project

FlashInfer is a library and kernel generator that supplies GPU operations used to run large language model inference, including attention, matrix multiplication, and mixture-of-experts computations. It helps engineers build and optimize LLM serving systems across supported GPU hardware and backend implementations. Its catalogue add-ons provide skills and instructions for working with FlashInfer.

flashinfer-ai/flashinfer · 6,763 stars · on GitHub · flashinfer.ai

Reuse

Borrowing it

Nothing to install: this file belongs to flashinfer-ai/flashinfer. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/flashinfer-ai/flashinfer/main/.claude/skills/benchmark-kernel/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/flashinfer-ai/flashinfer

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for benchmark-kernel

README.md
[![agentmods](https://agentmods.dev/badge/skills/flashinfer-ai/flashinfer/benchmark-kernel/github.svg)](https://agentmods.dev/skills/flashinfer-ai/flashinfer/benchmark-kernel)
Your own site
<a href="https://agentmods.dev/skills/flashinfer-ai/flashinfer/benchmark-kernel"><img src="https://agentmods.dev/badge/skills/flashinfer-ai/flashinfer/benchmark-kernel/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for benchmark-kernel

Your own site · 80×15
<a href="https://agentmods.dev/skills/flashinfer-ai/flashinfer/benchmark-kernel"><img src="https://agentmods.dev/badge/skills/flashinfer-ai/flashinfer/benchmark-kernel.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,616 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Privilege Escalation · line 293
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.03616
Opus 5.5 $0.00006 $0.01446
Sonnet 5.5 $0.00003 $0.00723
Haiku 4.5 $0.00001 $0.00362

Measured 1mo ago against content hash 67b34f50f2e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

benchmark-kernel scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo nvidia-smi -lgc <base_clock>
.claude/skills/benchmark-kernel/SKILL.md · 433 lines

How it starts

The opening of the file, as written. The whole thing — 433 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tutorial: Benchmarking FlashInfer Kernels

This tutorial shows you how to accurately benchmark FlashInfer kernels.

Goal

Measure the performance of FlashInfer kernels:

  • Get accurate GPU kernel execution time
  • Compare multiple backends (FlashAttention2/3, cuDNN, CUTLASS, TensorRT-LLM)
  • Generate reproducible benchmark results
  • Save results to CSV for analysis

Timing Methods

FlashInfer supports two timing methods:

  1. CUPTI (Preferred): Hardware-level profiling for most accurate GPU kernel time

    • Measures pure GPU compute time without host-device overhead
    • Requires cupti-python >= 13.0.0 (CUDA 13+)
  2. CUDA Events (Fallback): Standard CUDA event timing

    • Automatically used if CUPTI is not available
    • Good accuracy, slight overhead from host synchronization

The framework automatically uses CUPTI if available, otherwise falls back to CUDA events.

Autotuner timing (separate from the benchmark framework above). The AutoTuner's internal per-tactic timing has its own selector, FLASHINFER_AUTOTUNE_TIMER: globaltimer forces the GPU %globaltimer register, cuda_event forces cudaEvent, and unset/auto uses %globaltimer only when Confidential Computing (CC) is detected. Under CC cudaEventElapsedTime is unreliable (can go negative), which would corrupt tactic ranking — the globaltimer path avoids that. CC auto-detection can be overridden with FLASHINFER_CONFIDENTIAL_COMPUTE=0/1. (Full env-var reference in CLAUDE.md.)

Installation

Install CUPTI (Recommended)

For the most accurate benchmarking:

pip install -U cupti-python

Requirements: CUDA 13+ (CUPTI version 13+)

Without CUPTI

If you don't install CUPTI, the framework will:

  • Print a warning: CUPTI is not installed. Falling back to CUDA events.
  • Automatically use CUDA events for timing
  • Still provide good benchmark results

Step 1: Choose Your Test Routine

Read the full file on GitHub · 433 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed 67b34f50f2e5
  2. 1mo ago First seen · 433 lines · 14 tokens per session scan B 597917dae005

Subscribe to this mod's changes

benchmark-kernel is a skill published in the GitHub repository flashinfer-ai/flashinfer (6,763 stars, last pushed today), licensed Apache-2.0. It adds 14 tokens to every session and 3,616 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

gpu-server-setup

Prepare a Linux server with NVIDIA or Intel Arc GPUs for neural-network and LLM workloads, or diagnose one that misbehaves. Use when the user asks to set up or prepare a GPU server, install NVIDIA drivers or CUDA on Debian/Ubuntu, bring up Intel Arc (A770, A750, B580, Arc Pro B60/B70) with the i915/xe driver and…

EvilFreelancer/gpu-server-setup · 223 tokens

cuopt-skill-evolution

After solving a non-trivial problem, detect generalizable learnings and propose skill updates. Always active — applies to every interaction.

NVIDIA/cuopt · 33 tokens

cuopt-developer

Modify, build, test, debug, and contribute to NVIDIA cuOpt (C++/CUDA, Python, server, CI). Use for solver internals, PRs, DCO, and code conventions.

NVIDIA/cuopt · 47 tokens

cuopt-user-rules

Base rules for end users calling NVIDIA cuOpt (routing/LP/MILP/QP/install/server). Not for cuOpt internals — use cuopt-developer for those.

NVIDIA/cuopt · 42 tokens

perf-optimize

Launch and operate this repo's perf-optimize workflow, which iteratively APPLIES TensorRT-LLM serving optimizations — baseline benchmark at one concurrency or a Pareto curve of them (tok/s/user vs tok/s/gpu), analytical SOL projection on by default (via the internal-perf-sol-analysis skill) sizing the headroom the…

NVIDIA/TensorRT-LLM · 224 tokens

perf-analyze

Launch and operate this repo's perf-analyze workflow, which DIAGNOSES a TensorRT-LLM serving deployment without applying changes — benchmark at one concurrency or a Pareto curve of them (tok/s/user vs tok/s/gpu), analytical SOL projection on by default (via the internal-perf-sol-analysis skill), nsys + ncu per-kernel…

NVIDIA/TensorRT-LLM · 159 tokens