A Python package for kernel testing
Project description
KernelFoundry
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
- Create a task test class by deriving from
kernelfoundry.custom_test.CustomTest. - Implement build logic (optional) and correctness/performance tests.
- Compile candidate kernel code with
compile_torch_extension(...). - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kernelfoundry-0.1.2-py3-none-any.whl.
File metadata
- Download URL: kernelfoundry-0.1.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c5996e77460193f22a5329e367f64ef414b9c743155d2c93b10d55a87e89231
|
|
| MD5 |
ae370cfdff08583b37f469f6df13b6e1
|
|
| BLAKE2b-256 |
2b3734feccdd0e3fd3b1e921a140fa2dbf8ea365c768ed82b5a5ee6744622762
|
Provenance
The following attestation bundles were made for kernelfoundry-0.1.2-py3-none-any.whl:
Publisher:
release.yml on isl-org/kernelfoundry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kernelfoundry-0.1.2-py3-none-any.whl -
Subject digest:
4c5996e77460193f22a5329e367f64ef414b9c743155d2c93b10d55a87e89231 - Sigstore transparency entry: 1453667404
- Sigstore integration time:
-
Permalink:
isl-org/kernelfoundry@4c9985febf4b8b7b6934502695723c51ce584f9d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/isl-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4c9985febf4b8b7b6934502695723c51ce584f9d -
Trigger Event:
push
-
Statement type: