> ## Documentation Index
> Fetch the complete documentation index at: https://bench.flashinfer.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Use FlashInfer-Bench from the command line to run benchmarks and inspect results.

## Entry Points

FlashInfer-Bench provides two equivalent command-line entry points:

```bash theme={null}
flashinfer-bench --help
python -m flashinfer_bench --help
```

Use `--help` on any subcommand to inspect all available flags:

```bash theme={null}
flashinfer-bench run --help
flashinfer-bench report --help
flashinfer-bench report summary --help
```

## Run Benchmarks

Run benchmarks against a local FlashInfer-Trace dataset:

```bash theme={null}
flashinfer-bench run --local /path/to/flashinfer-trace
```

This is equivalent to:

```bash theme={null}
python -m flashinfer_bench run --local /path/to/flashinfer-trace
```

Useful options:

```bash theme={null}
flashinfer-bench run --local /path/to/flashinfer-trace \
  --warmup-runs 10 \
  --iterations 100 \
  --num-trials 5 \
  --rtol 1e-3 \
  --atol 1e-3 \
  --timeout 300
```

Run only selected definitions or solutions:

```bash theme={null}
flashinfer-bench run --local /path/to/flashinfer-trace \
  --definitions gemm_n5120_k2048 rmsnorm_h128 \
  --solutions solution_name_1 solution_name_2
```

Resume an interrupted run:

```bash theme={null}
flashinfer-bench run --local /path/to/flashinfer-trace --resume
```

Use a YAML config file to set per-op-type or per-definition eval parameters:

```bash theme={null}
flashinfer-bench run --local /path/to/flashinfer-trace --config my_config.yaml
```

Use the isolated runner instead of the default persistent runner:

```bash theme={null}
flashinfer-bench run --local /path/to/flashinfer-trace --use-isolated-runner
```

## Run The Benchmark Server

Start an HTTP benchmark server against a local trace dataset:

```bash theme={null}
flashinfer-bench serve \
  --local /path/to/flashinfer-trace \
  --host 0.0.0.0 \
  --port 8000
```

Use `--devices` to pin specific CUDA devices, or omit it to use all available CUDA devices.

For endpoint details and request/response examples, see [Benchmark Server API](/docs/docs/tutorials/server-api).

## Inspect Results

Summarize pass/fail counts and author rankings by average speedup:

```bash theme={null}
flashinfer-bench report summary --local /path/to/flashinfer-trace
```

Show the best solution for each definition:

```bash theme={null}
flashinfer-bench report best --local /path/to/flashinfer-trace
```

Merge multiple local datasets into one output directory:

```bash theme={null}
flashinfer-bench report merge \
  --local /path/to/trace-a \
  --local /path/to/trace-b \
  --output /path/to/merged-trace
```

Render a console-oriented visualization of results:

```bash theme={null}
flashinfer-bench report visualize --local /path/to/flashinfer-trace
```

## Notes

* The CLI supports local datasets via `--local`.
* Log verbosity is controlled with `--log-level {DEBUG,INFO,WARNING,ERROR}` on supported commands.
* The `flashinfer-bench` console script and `python -m flashinfer_bench` share the same implementation and behavior.
