Skip to main content

A Python package for kernel testing

Project description

KernelFoundry

KernelFoundry Logo

KernelFoundry is a Python package for defining and evaluating GPU kernel tasks.

This repository provides the task-side test harness used in kernel generation workflows:

  • A base task interface (kernelfoundry.custom_test.CustomTest) for implementing task-specific build and pytest test logic.
  • Build helpers for compiling candidate kernels into PyTorch extensions (via Torch or icpx).
  • Pytest fixtures for correctness/performance runs and collecting runtime data.
  • Validation helpers (assert_allclose, cosine similarity, and related utilities).
  • Runtime and machine-info helpers for benchmarking and metadata capture.

In other words, this package is what you use to author tasks and evaluate generated kernels. The external orchestration layers (for example, UI/services that generate candidates) are separate from this repo.

Typical workflow

  1. Create a task test class by deriving from kernelfoundry.custom_test.CustomTest.
  2. Implement build logic (optional) and correctness/performance tests.
  3. Compile candidate kernel code with compile_torch_extension(...).
  4. Run pytest to validate correctness and collect benchmark timings.

KernelFoundry supports SYCL, OpenCL and CUDA kernels.

Installation

Install the package and basic dependencies with

pip install .

The package requires Python 3.10+ (we commonly use Python 3.12). Install into a virtual environment if desired.

The kernelfoundry package has minimal core dependencies. Depending on your task, you may also need framework/toolchain dependencies (for example PyTorch and GPU toolchains) to compile and test kernels locally.

To run PyTorch-based tasks, install torch appropriate for your hardware:

# on Intel hardware:
pip install torch==2.9.0 --index-url https://download.pytorch.org/whl/xpu
# on NVIDIA hardware:
pip install torch==2.9.0 --index-url https://download.pytorch.org/whl/cu129

Documentation

API documentation is available and can be built using Sphinx. To build the documentation:

pip install .[docs]
cd docs
make html

The generated documentation will be in docs/_build/html/. See the docs/README.md for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kernelfoundry-0.1.1-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file kernelfoundry-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: kernelfoundry-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kernelfoundry-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b31235d708677570c2369ecb516b7aacd0159b3d5788d4f74a25d961589c5d25
MD5 ae77f3d879b6242de62f5741019e550d
BLAKE2b-256 f201771fa4bdaa0fb88109063e41d29a483c8207d382881b500a11446639874a

See more details on using hashes here.

Provenance

The following attestation bundles were made for kernelfoundry-0.1.1-py3-none-any.whl:

Publisher: release.yml on isl-org/kernelfoundry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page