Skip to main content

FlashInfer-Bench Dataset

Download the FlashInfer-Bench dataset.

Benchmarking

Via CLI

Run benchmarks on a local trace dataset:

Analyzing Results

After running benchmarks, use the report subcommands to inspect results:

Custom Options

Via Python API

How to use FlashInfer-Bench to automatically trace and optimize FlashInfer operations with custom kernels.

Tracing and Apply Overview

FlashInfer-Bench provides two key capabilities:
  1. Tracing: Automatically capture workload from your FlashInfer calls
  2. Apply: Automatically substitute optimized custom kernels for FlashInfer operations
With adapters already written for FlashInfer, you can enable these features with minimal code changes.

Basic Usage with Apply

The simplest way to use FlashInfer-Bench is through environment variables. Once you’ve installed FlashInfer-Bench, you can enable tracing and apply by:
  1. Import flashinfer_bench before importing FlashInfer
  2. Set environment variables to control behavior

Example: Drop-in Optimization

Environment Variables

Control FlashInfer-Bench behavior with these environment variables:
  • FIB_ENABLE_TRACING=1: Enable workload tracing to collect performance data
  • FIB_ENABLE_APPLY=1: Enable automatic kernel substitution
  • FIB_DATASET_PATH=/path/to/dataset: Specify where trace data and custom kernels are stored (default: ~/.cache/flashinfer_bench/dataset)