Catalog PyPI
Back to packageRELEASE DETAILS

0.2.0b1

PyPI

ai-bench-suite

AI kernel benchmarking harness

benchmarkgpuhelionkernelperformancepytorchtritonxpu
Published9 Jan 2026
Direct dependencies6
Transitive dependenciesNot calculated

README

Version 0.2.0b1 documentation

AI-bench: Unified AI Benchmarking Suite

Tests Lint KernelBench Perf Status

A benchmarking framework for evaluating AI kernel implementations across multiple backends (PyTorch, Triton, Helion) and devices (CPU, XPU).

Installation

The project is using uv package manager.

uv can be installed locally using:

pip install uv

The project can be installed with appropriate device-specific extensions using:

# CPU only
uv sync --extra cpu

# CPU + XPU
uv sync --extra xpu

Usage

Command Line Interface

After installation, the ai-bench command is available:

# Show help
ai-bench --help

# PyTorch on CPU (default)
ai-bench

# PyTorch on XPU
ai-bench --xpu

# PyTorch compile on XPU
ai-bench --xpu --torch-compile

# Triton on XPU
ai-bench --xpu --triton

# Helion on XPU
ai-bench --xpu --helion

# Benchmark mode (with timing)
ai-bench --xpu --bench

# Log results to CSV
ai-bench --xpu --bench --csv results.csv --note "baseline run"

Using Scripts Directly

Run KernelBench problems with different backends and devices:

# PyTorch on CPU (default)
python infra/scripts/run_kernel_bench.py

# PyTorch on XPU
python infra/scripts/run_kernel_bench.py --xpu

# PyTorch compile on XPU
python infra/scripts/run_kernel_bench.py --xpu --torch-compile

# Triton on XPU
python infra/scripts/run_kernel_bench.py --xpu --triton

# Helion on XPU
python infra/scripts/run_kernel_bench.py --xpu --helion

# Benchmark mode (with timing)
python infra/scripts/run_kernel_bench.py --xpu --bench

# Triton benchmark on XPU
python infra/scripts/run_kernel_bench.py --xpu --triton --bench

As a Library

import ai_bench
import torch

# Configure paths if running outside project root
ai_bench.configure(
    specs_dir="/path/to/specs",
    kernels_dir="/path/to/kernels",
)

# Create benchmark runner
runner = ai_bench.KernelBenchRunner(
    spec_type=ai_bench.SpecKey.V_BENCH_GPU,
    device=torch.device("xpu"),
    backend=ai_bench.Backend.PYTORCH,
    flops_unit=ai_bench.FlopsUnit.TFLOPS,
    mem_bw_unit=ai_bench.MemBwUnit.GBS,
    csv_path="results.csv",
)
runner.run_kernels()

CSV Logging

Benchmark results can be logged to a CSV file using the --csv option:

# Log results to CSV
python infra/scripts/run_kernel_bench.py --xpu --triton --bench --csv results.csv

# Add a note to identify the run
python infra/scripts/run_kernel_bench.py --xpu --triton --bench --csv results.csv --note "BMG card test"

The CSV file includes the following columns:

  • kernel_name: Name of the kernel
  • kernel_type: Backend used (pytorch/triton)
  • problem_level: KernelBench problem level
  • flops: Number of floating-point operations
  • flops_val: Computed FLOPS value
  • flops_unit: FLOPS unit (GFLOPS/TFLOPS)
  • flops_note: FLOPS measurement annotation (see 'Notes legend')
  • mem_bytes: Number of memory bytes transferred - input reads + output writes
  • mem_bw_val: Computed memory bandwidth value
  • mem_bw_unit: Memory bandwidth unit (MB/s or GB/s)
  • mem_note: Memory measurement annotation (see 'Notes legend')
  • time_us: Execution time in microseconds
  • input_values: Input dimensions as JSON
  • note: User-provided note

Additionally, any environment variables prefixed with AIBENCH_ are automatically captured and included in the CSV output. This is useful for recording system configuration:

# Set environment variables for tracking
export AIBENCH_CARD="BMG"
export AIBENCH_SYSTEM="TestRig1"
python infra/scripts/run_kernel_bench.py --xpu --triton --bench --csv results.csv

Notes legend:

  • ⚠️: estimated value, use with caution

Command Line Options

OptionDescription
--xpuRun on Intel XPU (default: CPU)
--tritonUse Triton backend (default: PyTorch)
--torch-compileUse PyTorch compile mode
--benchRun benchmarks with timing (default: CI validation)
--gflopsReport GFLOPS (default: TFLOPS)
--mbsReport MB/s (default: GB/s)
--csv PATHLog results to specified CSV file
--note TEXTAdd a note to CSV output for identifying runs
--specs-dir PATHPath to specs directory (CLI only)
--kernels-dir PATHPath to kernels directory (CLI only)

Testing

Run tests with pytest:

pytest -v

Linting

The project uses pre-commit to run various checks automatically.

All checks can be run using:

pre-commit run -a

Config variables

Environment variables used for project configuration:

VariableDescription
AIBENCH_LOG=INFO|DEBUG|...Globally overrides logging level
AIBENCH_SPECS_DIRPath to specs directory
AIBENCH_KERNELS_DIRPath to PyTorch kernels directory
AIBENCH_TRITON_KERNELS_DIRPath to Triton kernels directory
AIBENCH_HELION_KERNELS_DIRPath to Helion kernels directory

License

MIT License - see LICENSE for details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 7

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
PyYAML
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
PyYAMLruntime
numpy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
numpyruntime
python-dotenv
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
python-dotenvruntime
torch
Environment
{
  "extras": "",
  "marker": "extra == \"cpu\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
torch==2.9.1+cpu; extra == "cpu"runtime
torch
Environment
{
  "extras": "",
  "marker": "extra == \"xpu\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
torch==2.9.1+xpu; extra == "xpu"runtime
pytorch-triton-xpu
Environment
{
  "extras": "",
  "marker": "extra == \"xpu\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytorch-triton-xpu; extra == "xpu"runtime
helion
Environment
{
  "extras": "",
  "marker": "extra == \"xpu\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
helion==0.2.9; extra == "xpu"runtime

Distribution files

2 collected
ai_bench_suite-0.2.0b1-py3-none-any.whl

bdist_wheel · 21.7 KB · Python py3

Source file
ai_bench_suite-0.2.0b1.tar.gz

sdist · 29.12 KB · Python source

Source file

Repository

PENDING
libxsmm/ai-bench

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:01 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:e6bee85dbcdfd30134a8f510df0eff0905a1970479e9762a924b8b70eb651463

Other collected versions

View all collected versions →